Subversion Repositories ALCASAR

Rev

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

Rev 2226 Rev 2384
Line 18... Line 18...
18
			if (!$res)
18
			if (!$res)
19
				echo "<b>Error deleting user $login from user group table: " . da_sql_error($link,$config) . "</b><br>\n";
19
				echo "<b>Error deleting user $login from user group table: " . da_sql_error($link,$config) . "</b><br>\n";
20
			if ($config['sql_use_user_info_table'] == 'true'){
20
			if ($config['sql_use_user_info_table'] == 'true'){
21
				$res = da_sql_query($link,$config,
21
				$res = da_sql_query($link,$config,
22
				"DELETE FROM $config[sql_user_info_table] WHERE username = '$login';");
22
				"DELETE FROM $config[sql_user_info_table] WHERE username = '$login';");
23
				if ($res)
23
				if ($res) {
24
					echo "<b>$l_user $login $l_removed</b><br>\n";
24
					echo "<b>$l_user $login $l_removed</b><br>\n";
-
 
25
 
-
 
26
					if (preg_match('/^([a-fA-F0-9]{2}[:|\-]?){6}$/', $login)) {
-
 
27
						$user_ip = exec('sudo chilli_query list | grep '.escapeshellarg($login)." |  cut -d' ' -f2");
-
 
28
						//on vérifie que l'@IP de l'@MAC est différente de celle de l'admin sur l'ACC
-
 
29
						if ((!empty($user_ip)) && ($user_ip !== $_SERVER['REMOTE_ADDR'])) {
-
 
30
							exec('sudo chilli_query logout '.escapeshellarg($login));
-
 
31
						}
-
 
32
					}
-
 
33
				}
25
				else
34
				else
26
					echo "<b>Error deleting user $login from user info table: " . da_sql_error($link,$config) . "</b><br>\n";
35
					echo "<b>Error deleting user $login from user info table: " . da_sql_error($link,$config) . "</b><br>\n";
27
			}
36
			}
28
		}
37
		}
29
		else
38
		else