324 |
richard |
1 |
<?php
|
899 |
richard |
2 |
//gestion de la langue
|
|
|
3 |
$origine='user_edit';
|
|
|
4 |
if (is_file("../lib/langues.php"))
|
|
|
5 |
include("../lib/langues.php");
|
324 |
richard |
6 |
require('/etc/freeradius-web/config.php');
|
|
|
7 |
require('../lib/attrshow.php');
|
|
|
8 |
require('../lib/defaults.php');
|
|
|
9 |
$extra_text = '';
|
|
|
10 |
if ($user_type != 'group'){
|
|
|
11 |
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
|
|
|
12 |
include("../lib/$config[general_lib_type]/user_info.php");
|
|
|
13 |
if ($config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
|
|
|
14 |
$extra_text = "<br><font size=-2><i>(le groupe auquel apartient l'usager est surligné)</i></font>";
|
|
|
15 |
$saved_login = $login;
|
|
|
16 |
$login = '';
|
|
|
17 |
if (is_file("../lib/sql/group_info.php"))
|
|
|
18 |
include("../lib/sql/group_info.php");
|
|
|
19 |
$login = $saved_login;
|
|
|
20 |
}
|
|
|
21 |
}
|
|
|
22 |
else{
|
|
|
23 |
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
|
|
|
24 |
include("../lib/$config[general_lib_type]/group_info.php");
|
|
|
25 |
}
|
|
|
26 |
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
|
|
|
27 |
$colspan=2;
|
|
|
28 |
$show_ops = 1;
|
|
|
29 |
include("../lib/operators.php");
|
|
|
30 |
}
|
|
|
31 |
else{
|
|
|
32 |
$show_ops = 0;
|
|
|
33 |
$colspan=1;
|
|
|
34 |
}
|
901 |
richard |
35 |
?>
|
324 |
richard |
36 |
<html>
|
|
|
37 |
<head>
|
901 |
richard |
38 |
<title>subscription configuration for users and groups</title>
|
324 |
richard |
39 |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
|
|
|
40 |
<link rel="stylesheet" href="/css/style.css">
|
|
|
41 |
<script language="javascript" type="text/javascript">
|
|
|
42 |
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'
|
|
|
43 |
function password(size)
|
|
|
44 |
{
|
|
|
45 |
var pass=''
|
|
|
46 |
while(pass.length < size)
|
|
|
47 |
{
|
|
|
48 |
pass+=chars.charAt(Math.round(Math.random() * (chars.length)))
|
|
|
49 |
}
|
|
|
50 |
document.edituser.passwd.value=pass
|
|
|
51 |
document.edituser.pwdgene.value=pass
|
|
|
52 |
}
|
|
|
53 |
</script>
|
|
|
54 |
</head>
|
|
|
55 |
<body>
|
|
|
56 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
901 |
richard |
57 |
<tr><th>
|
|
|
58 |
<?php
|
|
|
59 |
if ($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";}
|
|
|
60 |
?>
|
|
|
61 |
</th></tr>
|
324 |
richard |
62 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
|
|
|
63 |
height="2"></td></tr>
|
|
|
64 |
</TABLE>
|
|
|
65 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
|
|
|
66 |
<tr><td valign="middle" align="left">
|
|
|
67 |
<center>
|
|
|
68 |
<table border=0 width=550 cellpadding=0 cellspacing=0>
|
|
|
69 |
<tr valign=top>
|
|
|
70 |
<!--<td align=center><img src="images/title2.gif"></td>-->
|
|
|
71 |
</tr>
|
|
|
72 |
</table>
|
|
|
73 |
<table border=0 width=400 cellpadding=0 cellspacing=2>
|
|
|
74 |
<?php
|
|
|
75 |
if ($user_type != 'group')
|
|
|
76 |
{
|
|
|
77 |
include("../html/user_toolbar.html.php");
|
901 |
richard |
78 |
$titre=$l_user;
|
324 |
richard |
79 |
}
|
|
|
80 |
else
|
|
|
81 |
{
|
|
|
82 |
include("../html/group_toolbar.html.php");
|
901 |
richard |
83 |
$titre=$l_group;
|
324 |
richard |
84 |
}
|
|
|
85 |
print <<<EOM
|
|
|
86 |
</table>
|
|
|
87 |
<br>
|
|
|
88 |
<table border=0 width=540 cellpadding=1 cellspacing=1>
|
|
|
89 |
<tr valign=top>
|
|
|
90 |
<td width=75%> </td>
|
|
|
91 |
<td bgcolor="black" width=25% align=right>
|
|
|
92 |
<table border=0 width="200" cellpadding=2 cellspacing=0>
|
|
|
93 |
<tr bgcolor="#907030" align=center valign=top><th>
|
901 |
richard |
94 |
<font color="white">$titre : $login</font>
|
324 |
richard |
95 |
</th></tr>
|
|
|
96 |
</table>
|
|
|
97 |
</td></tr>
|
|
|
98 |
<tr bgcolor="black" valign=top><td colspan=2>
|
|
|
99 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
|
|
|
100 |
<tr><td>
|
|
|
101 |
EOM;
|
|
|
102 |
|
|
|
103 |
if ($change == 1){
|
|
|
104 |
if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
|
|
|
105 |
include("../lib/$config[general_lib_type]/change_attrs.php");
|
|
|
106 |
if ($user_type != 'group'){
|
|
|
107 |
if ($config[general_show_user_password] != 'no' && $passwd != ''
|
|
|
108 |
&& is_file("../lib/$config[general_lib_type]/change_passwd.php"))
|
|
|
109 |
include("../lib/$config[general_lib_type]/change_passwd.php");
|
|
|
110 |
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
|
|
|
111 |
include("../lib/$config[general_lib_type]/user_info.php");
|
|
|
112 |
if ($group_change && $config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
|
|
|
113 |
include("../lib/sql/group_change.php");
|
|
|
114 |
include("../lib/defaults.php");
|
|
|
115 |
}
|
|
|
116 |
}
|
|
|
117 |
else{
|
|
|
118 |
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
|
|
|
119 |
include("../lib/$config[general_lib_type]/group_info.php");
|
|
|
120 |
}
|
|
|
121 |
}
|
|
|
122 |
else if ($badusers == 1){
|
|
|
123 |
if (is_file("../lib/add_badusers.php"))
|
|
|
124 |
include("../lib/add_badusers.php");
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
?>
|
|
|
128 |
<form name="edituser" method=post>
|
|
|
129 |
<input type=hidden name=login value=<?php print $login ?>>
|
|
|
130 |
<input type=hidden name=user_type value=<?php print $user_type ?>>
|
|
|
131 |
<input type=hidden name=change value="0">
|
|
|
132 |
<input type=hidden name=add value="0">
|
|
|
133 |
<input type=hidden name=badusers value="0">
|
|
|
134 |
<input type=hidden name=group_change value="0">
|
|
|
135 |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
|
|
|
136 |
<?php
|
|
|
137 |
if ($user_type != 'group' && $config[general_show_user_password] != 'no'){
|
|
|
138 |
echo <<<EOM
|
|
|
139 |
<tr>
|
|
|
140 |
<td align=right colspan=$colspan bgcolor="#d0ddb0">
|
907 |
richard |
141 |
$l_new_password<br>
|
324 |
richard |
142 |
EOM;
|
|
|
143 |
echo <<<EOM
|
|
|
144 |
</td>
|
|
|
145 |
<td>
|
|
|
146 |
<input type=password name=passwd value="" size=40>
|
907 |
richard |
147 |
<br /><input type="button" value="$l_passwd_gen" onclick="password(8)">
|
324 |
richard |
148 |
<input type="text" value="" name="pwdgene" size=20 readonly>
|
|
|
149 |
</td>
|
|
|
150 |
</tr>
|
|
|
151 |
EOM;
|
|
|
152 |
}
|
|
|
153 |
foreach($show_attrs as $key => $desc){
|
|
|
154 |
$name = $attrmap["$key"];
|
|
|
155 |
$generic = $attrmap[generic]["$key"];
|
|
|
156 |
if ($name == 'none')
|
|
|
157 |
continue;
|
|
|
158 |
unset($vals);
|
|
|
159 |
unset($selected);
|
|
|
160 |
unset($ops);
|
|
|
161 |
$def_added = 0;
|
|
|
162 |
if ($item_vals["$key"][count]){
|
|
|
163 |
for($i=0;$i<$item_vals["$key"][count];$i++){
|
|
|
164 |
$vals[] = $item_vals["$key"][$i];
|
|
|
165 |
$ops[] = $item_vals["$key"][operator][$i];
|
|
|
166 |
}
|
|
|
167 |
}
|
|
|
168 |
else{
|
|
|
169 |
if ($default_vals["$key"][count]){
|
|
|
170 |
for($i=0;$i<$default_vals["$key"][count];$i++){
|
|
|
171 |
$vals[] = $default_vals["$key"][$i];
|
|
|
172 |
$ops[] = $default_vals["$key"][operator][$i];
|
|
|
173 |
}
|
|
|
174 |
}
|
|
|
175 |
else{
|
|
|
176 |
$vals[] = '';
|
|
|
177 |
$ops[] = '=';
|
|
|
178 |
}
|
|
|
179 |
$def_added = 1;
|
|
|
180 |
}
|
|
|
181 |
if ($generic == 'generic' && $def_added == 0){
|
|
|
182 |
for($i=0;$i<$default_vals["$key"][count];$i++){
|
|
|
183 |
$vals[] = $default_vals["$key"][$i];
|
|
|
184 |
$ops[] = $default_vals["$key"][operator][$i];
|
|
|
185 |
}
|
|
|
186 |
}
|
|
|
187 |
if ($add && $name == $add_attr){
|
|
|
188 |
$vals[] = $default_vals["$key"][0];
|
|
|
189 |
$ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '=';
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
$i = 0;
|
|
|
193 |
foreach($vals as $val){
|
|
|
194 |
$name1 = $name . $i;
|
|
|
195 |
$val = ereg_replace('"','"',$val);
|
|
|
196 |
$oper_name = $name1 . '_op';
|
|
|
197 |
$oper = $ops[$i];
|
|
|
198 |
$selected[$oper] = 'selected';
|
|
|
199 |
$i++;
|
899 |
richard |
200 |
switch ($key)
|
|
|
201 |
{
|
|
|
202 |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
|
|
|
203 |
case 'Simultaneous-Use' :
|
|
|
204 |
$advanced=1;
|
|
|
205 |
$help_link="help/simultaneous_use_help.html";
|
|
|
206 |
$desc=$l_simultaneous_use;
|
|
|
207 |
break;
|
|
|
208 |
case 'Max-All-Session' :
|
|
|
209 |
$advanced=1;
|
|
|
210 |
$help_link="help/max_all_session_help.html";
|
|
|
211 |
$desc=$l_max_all_session;
|
|
|
212 |
break;
|
|
|
213 |
case 'Session-Timeout' :
|
|
|
214 |
$advanced=1;
|
|
|
215 |
$help_link="help/session_timeout_help.html";
|
|
|
216 |
$desc=$l_session_timeout;
|
|
|
217 |
break;
|
|
|
218 |
case 'Max-Daily-Session' :
|
|
|
219 |
$advanced=1;
|
|
|
220 |
$help_link="help/session_timeout_help.html";
|
|
|
221 |
$desc=$l_daily_timeout;
|
|
|
222 |
break;
|
|
|
223 |
case 'Max-Monthly-Session' :
|
|
|
224 |
$advanced=1;
|
|
|
225 |
$help_link="help/session_timeout_help.html";
|
|
|
226 |
$desc=$l_monthly_timeout;
|
|
|
227 |
break;
|
|
|
228 |
case 'Login-Time' :
|
|
|
229 |
$advanced=1;
|
|
|
230 |
$help_link="help/login_time_help.html";
|
|
|
231 |
$desc=$l_login_time;
|
|
|
232 |
break;
|
|
|
233 |
case 'Expiration' :
|
|
|
234 |
$advanced=1;
|
|
|
235 |
$help_link="help/expiration_help.html";
|
|
|
236 |
$desc=$l_expiration;
|
|
|
237 |
break;
|
|
|
238 |
case 'ChilliSpot-Max-Input-Octets' :
|
|
|
239 |
$advanced=1;
|
|
|
240 |
$help_link="help/chillispot_max_input_octets_help.html";
|
|
|
241 |
$desc=$l_max_input_octets;
|
|
|
242 |
break;
|
|
|
243 |
case 'ChilliSpot-Max-Output-Octets' :
|
|
|
244 |
$advanced=1;
|
|
|
245 |
$help_link="help/chillispot_max_output_octets_help.html";
|
|
|
246 |
$desc=$l_max_output_octets;
|
|
|
247 |
break;
|
|
|
248 |
case 'ChilliSpot-Max-Total-Octets' :
|
|
|
249 |
$advanced=1;
|
|
|
250 |
$help_link="help/chillispot_max_total_octets_help.html";
|
|
|
251 |
$desc=$l_max_total_octets;
|
|
|
252 |
break;
|
|
|
253 |
case 'ChilliSpot-Bandwidth-Max-Up' :
|
|
|
254 |
$advanced=1;
|
|
|
255 |
$help_link="help/chillispot_bandwidth_max_up_help.html";
|
|
|
256 |
$desc=$l_max_bandwidth_up;
|
|
|
257 |
break;
|
|
|
258 |
case 'ChilliSpot-Bandwidth-Max-Down' :
|
|
|
259 |
$advanced=1;
|
|
|
260 |
$help_link="help/chillispot_bandwidth_max_down_help.html";
|
|
|
261 |
$desc=$l_max_bandwidth_down;
|
|
|
262 |
break;
|
|
|
263 |
case 'WISPr-Redirection-URL' :
|
|
|
264 |
$advanced=1;
|
|
|
265 |
$help_link="help/wispr_redirection_url_help.html";
|
|
|
266 |
$desc=$l_wispr_redirection;
|
|
|
267 |
break;
|
|
|
268 |
default:
|
|
|
269 |
$advanced=1;
|
|
|
270 |
break;
|
|
|
271 |
}
|
324 |
richard |
272 |
print <<<EOM
|
899 |
richard |
273 |
<tr>
|
|
|
274 |
<td class="etiquette">
|
|
|
275 |
<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>
|
324 |
richard |
276 |
EOM;
|
|
|
277 |
if ($show_ops){
|
|
|
278 |
switch ($key)
|
|
|
279 |
{
|
|
|
280 |
case 'Simultaneous-Use' :
|
|
|
281 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
282 |
break;
|
|
|
283 |
case 'Login-Time' :
|
|
|
284 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
285 |
break;
|
|
|
286 |
case 'Expiration' :
|
|
|
287 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
288 |
break;
|
886 |
stephane |
289 |
case 'Max-All-Session' :
|
|
|
290 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
291 |
break;
|
324 |
richard |
292 |
case 'Session-Timeout' :
|
|
|
293 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
294 |
break;
|
|
|
295 |
case 'Max-Daily-Session' :
|
|
|
296 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
297 |
break;
|
|
|
298 |
case 'Max-Weekly-Session' :
|
|
|
299 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
300 |
break;
|
|
|
301 |
case 'Max-Monthly-Session' :
|
|
|
302 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
303 |
break;
|
|
|
304 |
case 'ChilliSpot-Max-Input-Octets' :
|
|
|
305 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
306 |
break;
|
|
|
307 |
case 'ChilliSpot-Max-Output-Octets' :
|
|
|
308 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
309 |
break;
|
|
|
310 |
case 'ChilliSpot-Max-Total-Octets' :
|
|
|
311 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
312 |
break;
|
|
|
313 |
case 'ChilliSpot-Bandwidth-Max-Up' :
|
|
|
314 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
315 |
break;
|
|
|
316 |
case 'ChilliSpot-Bandwidth-Max-Down' :
|
|
|
317 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
318 |
break;
|
|
|
319 |
case 'WISPr-Redirection-URL' :
|
|
|
320 |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=40></td>";
|
|
|
321 |
break;
|
|
|
322 |
default :
|
|
|
323 |
print <<<EOM
|
|
|
324 |
<td>
|
|
|
325 |
<select name=$oper_name>
|
|
|
326 |
<option $selected[$op_eq] value="=">=
|
|
|
327 |
<option $selected[$op_set] value=":=">:=
|
|
|
328 |
<option $selected[$op_add] value="+=">+=
|
|
|
329 |
<option $selected[$op_eq2] value="==">==
|
|
|
330 |
<option $selected[$op_ne] value="!=">!=
|
|
|
331 |
<option $selected[$op_gt] value=">">>
|
|
|
332 |
<option $selected[$op_ge] value=">=">>=
|
|
|
333 |
<option $selected[$op_lt] value="<"><
|
|
|
334 |
<option $selected[$op_le] value="<="><=
|
|
|
335 |
<option $selected[$op_regeq] value="=~">=~
|
|
|
336 |
<option $selected[$op_regne] value="!~">!~
|
|
|
337 |
<option $selected[$op_exst] value="=*">=*
|
|
|
338 |
<option $selected[$op_nexst] value="!*">!*
|
|
|
339 |
</select>
|
|
|
340 |
</td>
|
|
|
341 |
<td><input type=text name="$name1" value="$val" size=40></td>
|
|
|
342 |
EOM;
|
|
|
343 |
break;
|
|
|
344 |
}
|
|
|
345 |
}
|
|
|
346 |
print <<<EOM
|
|
|
347 |
</tr>
|
|
|
348 |
EOM;
|
|
|
349 |
}
|
|
|
350 |
}
|
|
|
351 |
if ($user_type != 'group'){
|
|
|
352 |
echo <<<EOM
|
|
|
353 |
<tr>
|
|
|
354 |
<td align=right colspan=$colspan bgcolor="#d0ddb0">
|
|
|
355 |
Membre de $extra_text
|
|
|
356 |
</td>
|
|
|
357 |
<td>
|
|
|
358 |
EOM;
|
|
|
359 |
if (isset($member_groups)){
|
|
|
360 |
echo "<select size=5 name=\"edited_groups[]\" multiple OnChange=\"this.form.group_change.value=1\">";
|
|
|
361 |
if ($config[sql_show_all_groups] == 'true'){
|
|
|
362 |
foreach ($existing_groups as $group => $count){
|
|
|
363 |
if ($member_groups[$group] == $group)
|
|
|
364 |
echo "<option selected value=\"$group\">$group\n";
|
|
|
365 |
else
|
|
|
366 |
echo "<option value=\"$group\">$group\n";
|
|
|
367 |
}
|
|
|
368 |
}else{
|
|
|
369 |
foreach ($member_groups as $group)
|
|
|
370 |
echo "<option value=\"$group\">$group\n";
|
|
|
371 |
}
|
|
|
372 |
echo "</select></td></tr>";
|
|
|
373 |
}
|
|
|
374 |
else{
|
|
|
375 |
echo "aucun group</td></tr>";
|
|
|
376 |
}
|
|
|
377 |
}
|
|
|
378 |
echo "</table><br>";
|
|
|
379 |
echo "<input type=submit class=button value=Change OnClick=\"this.form.change.value=1\">";
|
|
|
380 |
//if ($user_type != 'group'){
|
|
|
381 |
// echo <<<EOM
|
|
|
382 |
//<br><br>
|
|
|
383 |
//<input type=submit class=button value="Add to Badusers" OnClick="this.form.badusers.value=1">
|
|
|
384 |
//<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>
|
|
|
385 |
//EOM;
|
|
|
386 |
//}
|
|
|
387 |
?>
|
|
|
388 |
</form>
|
|
|
389 |
</td></tr>
|
|
|
390 |
</table>
|
|
|
391 |
</tr>
|
|
|
392 |
</table>
|
|
|
393 |
</td></tr>
|
|
|
394 |
</TABLE>
|
|
|
395 |
</body>
|
|
|
396 |
</html>
|