Subversion Repositories ALCASAR

Rev

Rev 2349 | Rev 2394 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2349 Rev 2392
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: user_edit.php 2349 2017-07-22 12:20:21Z tom.houdayer $
2
# $Id: user_edit.php 2392 2017-08-25 15:28:12Z tom.houdayer $
3
 
3
 
4
//gestion de la langue
4
//gestion de la langue
5
if (is_file("../lib/langues.php"))
5
if (is_file("../lib/langues.php"))
6
	include("../lib/langues.php");
6
	include("../lib/langues.php");
7
 
7
 
Line 147... Line 147...
147
			include("../lib/$config[general_lib_type]/user_info.php");
147
			include("../lib/$config[general_lib_type]/user_info.php");
148
		if ($group_change && $config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
148
		if ($group_change && $config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
149
			include("../lib/$config[general_lib_type]/group_change.php");
149
			include("../lib/$config[general_lib_type]/group_change.php");
150
			include("../lib/defaults.php");
150
			include("../lib/defaults.php");
151
		}
151
		}
152
		# Disconnecting user for re-authentication
152
		// Disconnecting user for re-authentication
153
		$mac = exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg(" $login ")." | awk '{print $1}'");
153
		$mac = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($5 == 1) && ($6 == "'.$login.'") {print $1}'));
154
		if (!empty($mac)) {
154
		if (!empty($mac)) {
155
			exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($mac));
155
			exec('sudo /usr/sbin/chilli_query logout mac '.escapeshellarg($mac));
-
 
156
			if ($login === $mac) {	// Reconnect allowed MAC
-
 
157
				exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
-
 
158
			}
156
		}
159
		}
157
	}
160
	}
158
	else{
161
	else{
159
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
162
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
160
			include("../lib/$config[general_lib_type]/group_info.php");
163
			include("../lib/$config[general_lib_type]/group_info.php");
161
		# Disconnecting all users from the selected group for re-authentication
164
		// Disconnecting all users from the selected group for re-authentication
162
		if (isset($group_members)){
165
		if (isset($group_members)) {
163
			foreach ($group_members as $g_member => $member){
166
			foreach ($group_members as $g_member => $member) {
164
				$mac = exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg(" $member ")." | awk '{print $1}'");
167
				$mac = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($5 == 1) && ($6 == "'.$member.'") {print $1}'));
165
				if (!empty($mac)) {
168
				if (!empty($mac)) {
166
					exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($mac));
169
					exec('sudo /usr/sbin/chilli_query logout mac '.escapeshellarg($mac));
-
 
170
					if ($member === $mac) {	// Reconnect allowed MAC
-
 
171
						exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
-
 
172
					}
167
				}
173
				}
168
			}
174
			}
169
		}
175
		}
170
	}
176
	}
171
}
177
}