5,10 → 5,16 |
require('/etc/freeradius-web/config.php'); |
require('../lib/attrshow.php'); |
require('../lib/defaults.php'); |
|
if(!isset($change)) $change = 0; |
if(!isset($user_type)) $user_type = 'user'; |
if(!isset($badusers)) $badusers = 0; |
if(!isset($cn)) $cn = ''; |
|
if ($user_type != 'group'){ |
if (is_file("../lib/$config[general_lib_type]/user_info.php")) |
include("../lib/$config[general_lib_type]/user_info.php"); |
if ($config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){ |
if ($config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){ |
$saved_login = $login; |
$login = ''; |
if (is_file("../lib/sql/group_info.php")) |
20,7 → 26,7 |
if (is_file("../lib/$config[general_lib_type]/group_info.php")) |
include("../lib/$config[general_lib_type]/group_info.php"); |
} |
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){ |
if ($config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){ |
$colspan=2; |
$show_ops = 1; |
include("../lib/operators.php"); |
33,7 → 39,7 |
<html> |
<head> |
<title>Users & groups edition</title> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>"> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>"> |
<link rel="stylesheet" href="/css/style.css"> |
<script language="javascript" type="text/javascript"> |
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ' |
51,7 → 57,7 |
<script type="text/javascript" src="/js/epoch_classes.js"></script> |
<script language="javascript" type="text/javascript"> |
/*Insertion du calendrier */ |
var dp_cal; |
var dp_cal; |
window.onload = function () { |
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container')); |
}; |
62,10 → 68,10 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th> |
<?php |
if ($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";} |
if($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";} |
?> |
</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1> |
73,16 → 79,13 |
<center> |
<table border=0 width=640 cellpadding=0 cellspacing=2> |
<?php |
if ($user_type != 'group') |
{ |
if ($user_type != 'group'){ |
include("../html/user_toolbar.html.php"); |
$titre=$l_user; |
} |
else |
{ |
}else{ |
include("../html/group_toolbar.html.php"); |
$titre=$l_group; |
} |
} |
print <<<EOM |
</table> |
<br> |
100,17 → 103,17 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
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 ($config[general_show_user_password] != 'no' && $passwd != '' |
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'){ |
if ($group_change && $config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){ |
include("../lib/sql/group_change.php"); |
include("../lib/defaults.php"); |
} |
134,7 → 137,7 |
if (is_file("../lib/add_badusers.php")) |
include("../lib/add_badusers.php"); |
} |
|
|
?> |
<form name="edituser" method=post> |
<input type=hidden name=login value=<?php print $login ?>> |
145,7 → 148,7 |
<input type=hidden name=group_change value="0"> |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
<?php |
if ($user_type != 'group' && $config[general_show_user_password] != 'no'){ |
if ($user_type != 'group' && $config['general_show_user_password'] != 'no'){ |
echo <<<EOM |
<tr> |
<td align=right colspan=$colspan bgcolor="#d0ddb0"> |
163,7 → 166,7 |
} |
foreach($show_attrs as $key => $desc){ |
$name = $attrmap["$key"]; |
$generic = $attrmap[generic]["$key"]; |
$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : ''; |
if ($name == 'none') |
continue; |
unset($vals); |
170,17 → 173,17 |
unset($selected); |
unset($ops); |
$def_added = 0; |
if ($item_vals["$key"][count]){ |
for($i=0;$i<$item_vals["$key"][count];$i++){ |
if (isset($item_vals["$key"]['count']) && $item_vals["$key"]['count']){ |
for($i=0;$i<$item_vals["$key"]['count'];$i++){ |
$vals[] = $item_vals["$key"][$i]; |
$ops[] = $item_vals["$key"][operator][$i]; |
$ops[] = $item_vals["$key"]['operator'][$i]; |
} |
} |
else{ |
if ($default_vals["$key"][count]){ |
for($i=0;$i<$default_vals["$key"][count];$i++){ |
if (isset($default_vals["$key"]['count']) && $default_vals["$key"]['count']){ |
for($i=0;$i<$default_vals["$key"]['count'];$i++){ |
$vals[] = $default_vals["$key"][$i]; |
$ops[] = $default_vals["$key"][operator][$i]; |
$ops[] = $default_vals["$key"]['operator'][$i]; |
} |
} |
else{ |
190,20 → 193,20 |
$def_added = 1; |
} |
if ($generic == 'generic' && $def_added == 0){ |
for($i=0;$i<$default_vals["$key"][count];$i++){ |
for($i=0;$i<$default_vals["$key"]['count'];$i++){ |
$vals[] = $default_vals["$key"][$i]; |
$ops[] = $default_vals["$key"][operator][$i]; |
$ops[] = $default_vals["$key"]['operator'][$i]; |
} |
} |
if ($add && $name == $add_attr){ |
} |
if (isset($add) && $add && $name == $add_attr){ |
$vals[] = $default_vals["$key"][0]; |
$ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '='; |
$ops[] = ($default_vals["$key"]['operator'][0] != '') ? $default_vals["$key"]['operator'][0] : '='; |
} |
|
$i = 0; |
foreach($vals as $val){ |
$name1 = $name . $i; |
$val = ereg_replace('"','"',$val); |
$val = preg_replace('/\"/','"',$val); |
$oper_name = $name1 . '_op'; |
$oper = $ops[$i]; |
$selected[$oper] = 'selected'; |
210,8 → 213,8 |
$i++; |
switch ($key) |
{ |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
$advanced=1; |
$help_link="help/simultaneous_use_help.html"; |
$desc=$l_simultaneous_use; |
221,7 → 224,7 |
$help_link="help/max_all_session_help.html"; |
$desc=$l_max_all_session; |
break; |
case 'Session-Timeout' : |
case 'Session-Timeout' : |
$advanced=1; |
$help_link="help/session_timeout_help.html"; |
$desc=$l_session_timeout; |
236,7 → 239,7 |
$help_link="help/session_timeout_help.html"; |
$desc=$l_monthly_timeout; |
break; |
case 'Login-Time' : |
case 'Login-Time' : |
$advanced=1; |
$help_link="help/login_time_help.html"; |
$desc=$l_login_time; |
291,12 → 294,13 |
<a href="$help_link" target=help onclick=window.open("$help_link","help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="$l_click_for_help"><font color="blue">$desc</font></a> |
EOM; |
if ($show_ops){ |
if(!isset($selected[$op_eq])) $selected[$op_eq] = ''; |
switch ($key) |
{ |
case 'Simultaneous-Use' : |
case 'Simultaneous-Use' : |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>"; |
break; |
case 'Login-Time' : |
case 'Login-Time' : |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>"; |
break; |
case 'Expiration' : |
395,7 → 399,7 |
EOM; |
if (isset($member_groups)){ |
echo "<select size=5 name=\"edited_groups[]\" multiple OnChange=\"this.form.group_change.value=1\">"; |
if ($config[sql_show_all_groups] == 'true'){ |
if ($config['sql_show_all_groups'] == 'true'){ |
foreach ($existing_groups as $group => $count){ |
if ($member_groups[$group] == $group) |
echo "<option selected value=\"$group\">$group\n"; |
411,7 → 415,7 |
else{ |
echo "aucun group</td></tr>"; |
} |
} |
} |
echo "</table><br>"; |
echo "<input type=submit class=button value=$l_change OnClick=\"this.form.change.value=1\">"; |
//if ($user_type != 'group'){ |