Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2654 → Rev 2655

/web/acc/manager/htdocs/user_edit.php
114,9 → 114,11
if ($user_type != 'group'){
include("../html/user_toolbar.html.php");
$titre=$l_user;
$cnName = " ($cn)";
}else{
include("../html/group_toolbar.html.php");
$titre=$l_group;
$cnName = '';
}
print <<<EOM
</table>
127,7 → 129,7
<td bgcolor="black">
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=center valign=top><th>
<font color="white">$titre : $login ($cn)</font>
<font color="white">$titre : $login$cnName</font>
</th></tr>
</table>
</td></tr>
137,42 → 139,56
EOM;
 
if ($change == 1) {
if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
include("../lib/$config[general_lib_type]/change_attrs.php");
if ($user_type != 'group'){
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
 
// Disconnecting user for re-authentication
$mac = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($5 == 1) && ($6 == "'.$login.'") {print $1}'));
if (!empty($mac)) {
exec('sudo /usr/sbin/chilli_query logout mac '.escapeshellarg($mac));
}
 
if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
include("../lib/$config[general_lib_type]/change_attrs.php");
if ($config['general_show_user_password'] != 'no' && $passwd != ''
&& is_file("../lib/$config[general_lib_type]/change_passwd.php"))
include("../lib/$config[general_lib_type]/change_passwd.php");
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
if ($group_change && $config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
include("../lib/$config[general_lib_type]/group_change.php");
include("../lib/defaults.php");
}
// Disconnecting user for re-authentication
$mac = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($5 == 1) && ($6 == "'.$login.'") {print $1}'));
if (!empty($mac)) {
exec('sudo /usr/sbin/chilli_query logout mac '.escapeshellarg($mac));
if ($login === $mac) { // Reconnect allowed MAC
exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
}
 
// Reconnect allowed MAC
if (!empty($mac) && ($login === $mac)) {
exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
}
}
else{
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
include("../lib/$config[general_lib_type]/group_info.php");
 
// Disconnecting all users from the selected group for re-authentication
if (isset($group_members)) {
$group_macs = [];
foreach ($group_members as $g_member => $member) {
$mac = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($5 == 1) && ($6 == "'.$member.'") {print $1}'));
if (!empty($mac)) {
exec('sudo /usr/sbin/chilli_query logout mac '.escapeshellarg($mac));
if ($member === $mac) { // Reconnect allowed MAC
exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
if ($member === $mac) {
$group_macs[] = $mac;
}
}
}
}
 
if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
include("../lib/$config[general_lib_type]/change_attrs.php");
 
// Reconnect allowed MAC from the selected group
foreach ($group_macs as $mac) {
exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
}
}
}
else if ($badusers == 1){