324 |
richard |
1 |
<?php
|
|
|
2 |
require('/etc/freeradius-web/config.php');
|
|
|
3 |
require('../lib/attrshow.php');
|
|
|
4 |
require('../lib/defaults.php');
|
|
|
5 |
$extra_text = '';
|
|
|
6 |
if ($user_type != 'group'){
|
|
|
7 |
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
|
|
|
8 |
include("../lib/$config[general_lib_type]/user_info.php");
|
|
|
9 |
if ($config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
|
|
|
10 |
$extra_text = "<br><font size=-2><i>(le groupe auquel apartient l'usager est surligné)</i></font>";
|
|
|
11 |
$saved_login = $login;
|
|
|
12 |
$login = '';
|
|
|
13 |
if (is_file("../lib/sql/group_info.php"))
|
|
|
14 |
include("../lib/sql/group_info.php");
|
|
|
15 |
$login = $saved_login;
|
|
|
16 |
}
|
|
|
17 |
}
|
|
|
18 |
else{
|
|
|
19 |
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
|
|
|
20 |
include("../lib/$config[general_lib_type]/group_info.php");
|
|
|
21 |
}
|
|
|
22 |
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
|
|
|
23 |
$colspan=2;
|
|
|
24 |
$show_ops = 1;
|
|
|
25 |
include("../lib/operators.php");
|
|
|
26 |
}
|
|
|
27 |
else{
|
|
|
28 |
$show_ops = 0;
|
|
|
29 |
$colspan=1;
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
echo <<<EOM
|
|
|
34 |
<html>
|
|
|
35 |
<head>
|
|
|
36 |
EOM;
|
|
|
37 |
|
|
|
38 |
if ($user_type != 'group'){
|
|
|
39 |
echo " <title>subscription configuration for $login ($cn)</title>\n";
|
|
|
40 |
$util = "usagers";}
|
|
|
41 |
else{
|
|
|
42 |
echo " <title>subscription configuration for $login</title>\n";
|
|
|
43 |
$util = "groupes";}
|
|
|
44 |
?>
|
|
|
45 |
|
|
|
46 |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
|
|
|
47 |
<link rel="stylesheet" href="/css/style.css">
|
|
|
48 |
<script language="javascript" type="text/javascript">
|
|
|
49 |
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'
|
|
|
50 |
function password(size)
|
|
|
51 |
{
|
|
|
52 |
var pass=''
|
|
|
53 |
while(pass.length < size)
|
|
|
54 |
{
|
|
|
55 |
pass+=chars.charAt(Math.round(Math.random() * (chars.length)))
|
|
|
56 |
}
|
|
|
57 |
document.edituser.passwd.value=pass
|
|
|
58 |
document.edituser.pwdgene.value=pass
|
|
|
59 |
}
|
|
|
60 |
</script>
|
|
|
61 |
</head>
|
|
|
62 |
<body>
|
|
|
63 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
64 |
<tr><th>Gestion des <?php echo $util?></th></tr>
|
|
|
65 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
|
|
|
66 |
height="2"></td></tr>
|
|
|
67 |
</TABLE>
|
|
|
68 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
|
|
69 |
<tr><td valign="middle" align="left">
|
|
|
70 |
<center>
|
|
|
71 |
<table border=0 width=550 cellpadding=0 cellspacing=0>
|
|
|
72 |
<tr valign=top>
|
|
|
73 |
<!--<td align=center><img src="images/title2.gif"></td>-->
|
|
|
74 |
</tr>
|
|
|
75 |
</table>
|
|
|
76 |
<table border=0 width=400 cellpadding=0 cellspacing=2>
|
|
|
77 |
<?php
|
|
|
78 |
if ($user_type != 'group')
|
|
|
79 |
{
|
|
|
80 |
include("../html/user_toolbar.html.php");
|
|
|
81 |
$titre="de l'usager";
|
|
|
82 |
}
|
|
|
83 |
else
|
|
|
84 |
{
|
|
|
85 |
include("../html/group_toolbar.html.php");
|
|
|
86 |
$titre="du groupe";
|
|
|
87 |
}
|
|
|
88 |
print <<<EOM
|
|
|
89 |
</table>
|
|
|
90 |
<br>
|
|
|
91 |
<table border=0 width=540 cellpadding=1 cellspacing=1>
|
|
|
92 |
<tr valign=top>
|
|
|
93 |
<td width=75%> </td>
|
|
|
94 |
<td bgcolor="black" width=25% align=right>
|
|
|
95 |
<table border=0 width="200" cellpadding=2 cellspacing=0>
|
|
|
96 |
<tr bgcolor="#907030" align=center valign=top><th>
|
|
|
97 |
<font color="white">Attributs $titre : $login</font>
|
|
|
98 |
</th></tr>
|
|
|
99 |
</table>
|
|
|
100 |
</td></tr>
|
|
|
101 |
<tr bgcolor="black" valign=top><td colspan=2>
|
|
|
102 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
|
|
|
103 |
<tr><td>
|
|
|
104 |
EOM;
|
|
|
105 |
|
|
|
106 |
if ($change == 1){
|
|
|
107 |
if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
|
|
|
108 |
include("../lib/$config[general_lib_type]/change_attrs.php");
|
|
|
109 |
if ($user_type != 'group'){
|
|
|
110 |
if ($config[general_show_user_password] != 'no' && $passwd != ''
|
|
|
111 |
&& is_file("../lib/$config[general_lib_type]/change_passwd.php"))
|
|
|
112 |
include("../lib/$config[general_lib_type]/change_passwd.php");
|
|
|
113 |
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
|
|
|
114 |
include("../lib/$config[general_lib_type]/user_info.php");
|
|
|
115 |
if ($group_change && $config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
|
|
|
116 |
include("../lib/sql/group_change.php");
|
|
|
117 |
include("../lib/defaults.php");
|
|
|
118 |
}
|
|
|
119 |
}
|
|
|
120 |
else{
|
|
|
121 |
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
|
|
|
122 |
include("../lib/$config[general_lib_type]/group_info.php");
|
|
|
123 |
}
|
|
|
124 |
}
|
|
|
125 |
else if ($badusers == 1){
|
|
|
126 |
if (is_file("../lib/add_badusers.php"))
|
|
|
127 |
include("../lib/add_badusers.php");
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
?>
|
|
|
131 |
<form name="edituser" method=post>
|
|
|
132 |
<input type=hidden name=login value=<?php print $login ?>>
|
|
|
133 |
<input type=hidden name=user_type value=<?php print $user_type ?>>
|
|
|
134 |
<input type=hidden name=change value="0">
|
|
|
135 |
<input type=hidden name=add value="0">
|
|
|
136 |
<input type=hidden name=badusers value="0">
|
|
|
137 |
<input type=hidden name=group_change value="0">
|
|
|
138 |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
|
|
|
139 |
<?php
|
|
|
140 |
if ($user_type != 'group' && $config[general_show_user_password] != 'no'){
|
|
|
141 |
echo <<<EOM
|
|
|
142 |
<tr>
|
|
|
143 |
<td align=right colspan=$colspan bgcolor="#d0ddb0">
|
|
|
144 |
Nouveau mot de passe<br>
|
|
|
145 |
EOM;
|
|
|
146 |
if ($user_password_exists == 'yes')
|
|
|
147 |
echo "<font size=-2>Le mot de passe <font color=\"green\"><b>existe</b></font></font>\n";
|
|
|
148 |
else
|
|
|
149 |
echo "<font size=-2>Le mot de passe <font color=\"red\"><b> n'existe pas</b></font></font>\n";
|
|
|
150 |
echo <<<EOM
|
|
|
151 |
</td>
|
|
|
152 |
<td>
|
|
|
153 |
<input type=password name=passwd value="" size=40>
|
|
|
154 |
<br /><input type="button" value="générer" onclick="password(8)">
|
|
|
155 |
<input type="text" value="" name="pwdgene" size=20 readonly>
|
|
|
156 |
</td>
|
|
|
157 |
</tr>
|
|
|
158 |
EOM;
|
|
|
159 |
}
|
|
|
160 |
foreach($show_attrs as $key => $desc){
|
|
|
161 |
$name = $attrmap["$key"];
|
|
|
162 |
$generic = $attrmap[generic]["$key"];
|
|
|
163 |
if ($name == 'none')
|
|
|
164 |
continue;
|
|
|
165 |
unset($vals);
|
|
|
166 |
unset($selected);
|
|
|
167 |
unset($ops);
|
|
|
168 |
$def_added = 0;
|
|
|
169 |
if ($item_vals["$key"][count]){
|
|
|
170 |
for($i=0;$i<$item_vals["$key"][count];$i++){
|
|
|
171 |
$vals[] = $item_vals["$key"][$i];
|
|
|
172 |
$ops[] = $item_vals["$key"][operator][$i];
|
|
|
173 |
}
|
|
|
174 |
}
|
|
|
175 |
else{
|
|
|
176 |
if ($default_vals["$key"][count]){
|
|
|
177 |
for($i=0;$i<$default_vals["$key"][count];$i++){
|
|
|
178 |
$vals[] = $default_vals["$key"][$i];
|
|
|
179 |
$ops[] = $default_vals["$key"][operator][$i];
|
|
|
180 |
}
|
|
|
181 |
}
|
|
|
182 |
else{
|
|
|
183 |
$vals[] = '';
|
|
|
184 |
$ops[] = '=';
|
|
|
185 |
}
|
|
|
186 |
$def_added = 1;
|
|
|
187 |
}
|
|
|
188 |
if ($generic == 'generic' && $def_added == 0){
|
|
|
189 |
for($i=0;$i<$default_vals["$key"][count];$i++){
|
|
|
190 |
$vals[] = $default_vals["$key"][$i];
|
|
|
191 |
$ops[] = $default_vals["$key"][operator][$i];
|
|
|
192 |
}
|
|
|
193 |
}
|
|
|
194 |
if ($add && $name == $add_attr){
|
|
|
195 |
$vals[] = $default_vals["$key"][0];
|
|
|
196 |
$ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '=';
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
$i = 0;
|
|
|
200 |
foreach($vals as $val){
|
|
|
201 |
$name1 = $name . $i;
|
|
|
202 |
$val = ereg_replace('"','"',$val);
|
|
|
203 |
$oper_name = $name1 . '_op';
|
|
|
204 |
$oper = $ops[$i];
|
|
|
205 |
$selected[$oper] = 'selected';
|
|
|
206 |
$i++;
|
|
|
207 |
print <<<EOM
|
|
|
208 |
<tr>
|
|
|
209 |
<td align=right bgcolor="#d0ddb0">
|
|
|
210 |
EOM;
|
|
|
211 |
$desc = addslashes($desc);
|
|
|
212 |
eval("\$desc = \"$desc\";");
|
|
|
213 |
$desc = stripslashes($desc);
|
|
|
214 |
if ($i == 1)
|
|
|
215 |
echo "$desc\n";
|
|
|
216 |
else
|
|
|
217 |
echo "$desc ($i)\n";
|
|
|
218 |
echo "</td>";
|
|
|
219 |
if ($show_ops){
|
|
|
220 |
switch ($key)
|
|
|
221 |
{
|
|
|
222 |
case 'Simultaneous-Use' :
|
|
|
223 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
224 |
break;
|
|
|
225 |
case 'Login-Time' :
|
|
|
226 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
227 |
break;
|
|
|
228 |
case 'Expiration' :
|
|
|
229 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
230 |
break;
|
|
|
231 |
case 'Session-Timeout' :
|
|
|
232 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
233 |
break;
|
|
|
234 |
case 'Max-Daily-Session' :
|
|
|
235 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
236 |
break;
|
|
|
237 |
case 'Max-Weekly-Session' :
|
|
|
238 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
239 |
break;
|
|
|
240 |
case 'Max-Monthly-Session' :
|
|
|
241 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
242 |
break;
|
|
|
243 |
case 'ChilliSpot-Max-Input-Octets' :
|
|
|
244 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
245 |
break;
|
|
|
246 |
case 'ChilliSpot-Max-Output-Octets' :
|
|
|
247 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
248 |
break;
|
|
|
249 |
case 'ChilliSpot-Max-Total-Octets' :
|
|
|
250 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
251 |
break;
|
|
|
252 |
case 'ChilliSpot-Bandwidth-Max-Up' :
|
|
|
253 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
254 |
break;
|
|
|
255 |
case 'ChilliSpot-Bandwidth-Max-Down' :
|
|
|
256 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
257 |
break;
|
|
|
258 |
case 'WISPr-Redirection-URL' :
|
|
|
259 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
260 |
break;
|
|
|
261 |
default :
|
|
|
262 |
print <<<EOM
|
|
|
263 |
<td>
|
|
|
264 |
<select name=$oper_name>
|
|
|
265 |
<option $selected[$op_eq] value="=">=
|
|
|
266 |
<option $selected[$op_set] value=":=">:=
|
|
|
267 |
<option $selected[$op_add] value="+=">+=
|
|
|
268 |
<option $selected[$op_eq2] value="==">==
|
|
|
269 |
<option $selected[$op_ne] value="!=">!=
|
|
|
270 |
<option $selected[$op_gt] value=">">>
|
|
|
271 |
<option $selected[$op_ge] value=">=">>=
|
|
|
272 |
<option $selected[$op_lt] value="<"><
|
|
|
273 |
<option $selected[$op_le] value="<="><=
|
|
|
274 |
<option $selected[$op_regeq] value="=~">=~
|
|
|
275 |
<option $selected[$op_regne] value="!~">!~
|
|
|
276 |
<option $selected[$op_exst] value="=*">=*
|
|
|
277 |
<option $selected[$op_nexst] value="!*">!*
|
|
|
278 |
</select>
|
|
|
279 |
</td>
|
|
|
280 |
<td><input type=text name="$name1" value="$val" size=40></td>
|
|
|
281 |
EOM;
|
|
|
282 |
break;
|
|
|
283 |
}
|
|
|
284 |
}
|
|
|
285 |
print <<<EOM
|
|
|
286 |
</tr>
|
|
|
287 |
EOM;
|
|
|
288 |
}
|
|
|
289 |
}
|
|
|
290 |
if ($user_type != 'group'){
|
|
|
291 |
echo <<<EOM
|
|
|
292 |
<tr>
|
|
|
293 |
<td align=right colspan=$colspan bgcolor="#d0ddb0">
|
|
|
294 |
Membre de $extra_text
|
|
|
295 |
</td>
|
|
|
296 |
<td>
|
|
|
297 |
EOM;
|
|
|
298 |
if (isset($member_groups)){
|
|
|
299 |
echo "<select size=5 name=\"edited_groups[]\" multiple OnChange=\"this.form.group_change.value=1\">";
|
|
|
300 |
if ($config[sql_show_all_groups] == 'true'){
|
|
|
301 |
foreach ($existing_groups as $group => $count){
|
|
|
302 |
if ($member_groups[$group] == $group)
|
|
|
303 |
echo "<option selected value=\"$group\">$group\n";
|
|
|
304 |
else
|
|
|
305 |
echo "<option value=\"$group\">$group\n";
|
|
|
306 |
}
|
|
|
307 |
}else{
|
|
|
308 |
foreach ($member_groups as $group)
|
|
|
309 |
echo "<option value=\"$group\">$group\n";
|
|
|
310 |
}
|
|
|
311 |
echo "</select></td></tr>";
|
|
|
312 |
}
|
|
|
313 |
else{
|
|
|
314 |
echo "aucun group</td></tr>";
|
|
|
315 |
}
|
|
|
316 |
}
|
|
|
317 |
echo "</table><br>";
|
|
|
318 |
echo "<input type=submit class=button value=Change OnClick=\"this.form.change.value=1\">";
|
|
|
319 |
//if ($user_type != 'group'){
|
|
|
320 |
// echo <<<EOM
|
|
|
321 |
//<br><br>
|
|
|
322 |
//<input type=submit class=button value="Add to Badusers" OnClick="this.form.badusers.value=1">
|
|
|
323 |
//<a href="help/badusers_help.html" target=bu_help onclick=window.open("help/badusers_help.html","bu_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="BADUSERS Help Page"><font color="blue"><--Help</font></a>
|
|
|
324 |
//EOM;
|
|
|
325 |
//}
|
|
|
326 |
?>
|
|
|
327 |
</form>
|
|
|
328 |
</td></tr>
|
|
|
329 |
</table>
|
|
|
330 |
</tr>
|
|
|
331 |
</table>
|
|
|
332 |
</td></tr>
|
|
|
333 |
</TABLE>
|
|
|
334 |
</body>
|
|
|
335 |
</html>
|