Subversion Repositories ALCASAR

Rev

Rev 1881 | Rev 1883 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
324 richard 1
<?php
899 richard 2
//gestion de la langue
3
if (is_file("../lib/langues.php"))
4
	include("../lib/langues.php");
324 richard 5
require('/etc/freeradius-web/config.php');
6
require('../lib/attrshow.php');
7
require('../lib/defaults.php');
1805 clement.si 8
 
9
if(!isset($change)) $change = 0;
10
if(!isset($user_type)) $user_type = 'user';
11
if(!isset($badusers)) $badusers = 0;
12
if(!isset($cn)) $cn = '';
13
 
1881 raphael.pi 14
 
324 richard 15
if ($user_type != 'group'){
16
	if (is_file("../lib/$config[general_lib_type]/user_info.php"))
17
		include("../lib/$config[general_lib_type]/user_info.php");
1805 clement.si 18
	if ($config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
324 richard 19
		$saved_login = $login;
20
		$login = '';
21
		if (is_file("../lib/sql/group_info.php"))
22
			include("../lib/sql/group_info.php");
23
		$login = $saved_login;
24
	}
25
}
26
else{
27
	if (is_file("../lib/$config[general_lib_type]/group_info.php"))
28
		include("../lib/$config[general_lib_type]/group_info.php");
29
}
1805 clement.si 30
if ($config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){
324 richard 31
	$colspan=2;
32
	$show_ops = 1;
33
	include("../lib/operators.php");
34
}
35
else{
36
	$show_ops = 0;
37
	$colspan=1;
38
}
901 richard 39
?>
324 richard 40
<html>
41
<head>
911 richard 42
<title>Users & groups edition</title>
1805 clement.si 43
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>">
324 richard 44
<link rel="stylesheet" href="/css/style.css">
45
<script language="javascript" type="text/javascript">
46
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'
47
function password(size)
48
  {
49
  var pass=''
50
  while(pass.length < size)
51
  {
52
    pass+=chars.charAt(Math.round(Math.random() * (chars.length)))
53
  }
54
  document.edituser.passwd.value=pass
55
  document.edituser.pwdgene.value=pass
56
}
57
</script>
1566 richard 58
<script type="text/javascript" src="/js/epoch_classes.js"></script>
59
<script language="javascript" type="text/javascript">
60
/*Insertion du calendrier */
1805 clement.si 61
	var dp_cal;
1566 richard 62
window.onload = function () {
63
	dp_cal  = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
64
};
65
</script>
66
 
324 richard 67
</head>
68
<body>
69
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
901 richard 70
	<tr><th>
71
<?php
1805 clement.si 72
if($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";}
901 richard 73
?>
74
	</th></tr>
1805 clement.si 75
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
324 richard 76
height="2"></td></tr>
77
</TABLE>
78
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
79
	<tr><td valign="middle" align="left">
80
	<center>
925 richard 81
	<table border=0 width=640 cellpadding=0 cellspacing=2>
324 richard 82
<?php
1805 clement.si 83
if ($user_type != 'group'){
324 richard 84
	include("../html/user_toolbar.html.php");
901 richard 85
	$titre=$l_user;
1805 clement.si 86
}else{
324 richard 87
	include("../html/group_toolbar.html.php");
901 richard 88
	$titre=$l_group;
1805 clement.si 89
}
324 richard 90
print <<<EOM
91
</table>
92
<br>
925 richard 93
<table border=0 width=620 cellpadding=1 cellspacing=1>
324 richard 94
<tr valign=top>
925 richard 95
<td width=400></td>
96
<td bgcolor="black">
97
	<table border=0 width=100% cellpadding=2 cellspacing=0>
324 richard 98
	<tr bgcolor="#907030" align=center valign=top><th>
910 richard 99
	<font color="white">$titre : $login ($cn)</font>
324 richard 100
	</th></tr>
101
	</table>
102
</td></tr>
103
<tr bgcolor="black" valign=top><td colspan=2>
104
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
105
	<tr><td>
106
EOM;
1805 clement.si 107
 
324 richard 108
if ($change == 1){
109
	if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
110
		include("../lib/$config[general_lib_type]/change_attrs.php");
111
	if ($user_type != 'group'){
1805 clement.si 112
		if ($config['general_show_user_password'] != 'no' && $passwd != ''
324 richard 113
			&& is_file("../lib/$config[general_lib_type]/change_passwd.php"))
114
			include("../lib/$config[general_lib_type]/change_passwd.php");
115
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
116
			include("../lib/$config[general_lib_type]/user_info.php");
1805 clement.si 117
		if ($group_change && $config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
324 richard 118
			include("../lib/sql/group_change.php");
119
			include("../lib/defaults.php");
120
		}
1377 richard 121
		# Disconnecting user for re-authentication
122
		$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $login \" | awk '{print $1}'");
123
		exec("sudo /usr/sbin/chilli_query logout $mac");
324 richard 124
	}
125
	else{
126
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
127
			include("../lib/$config[general_lib_type]/group_info.php");
1377 richard 128
		# Disconnecting all users from the selected group for re-authentication
129
		if (isset($group_members)){
130
			foreach ($group_members as $g_member => $member){
131
				$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $member \" | awk '{print $1}'");
132
				exec("sudo /usr/sbin/chilli_query logout $mac");
133
			}
134
		}
324 richard 135
	}
136
}
137
else if ($badusers == 1){
138
	if (is_file("../lib/add_badusers.php"))
139
		include("../lib/add_badusers.php");
140
}
1805 clement.si 141
 
1882 raphael.pi 142
 
143
 
144
 
145
//si l'utilisateur fait parti d'un groupe, on charge les attributs du groupe, pour les afficher ensuite.
146
	if(isset($member_groups[0]))
147
	{
148
		echo "<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor=\"#ffffe0\" valign=top>";
149
 
150
		$group = $member_groups[0];
151
		$login_saved = $login;
152
		$login = $member_groups[0];
153
		include("../lib/sql/group_info.php");
154
		$login = $login_saved;
155
 
156
 
157
		echo "<tr>
158
		<td align=right colspan=$colspan bgcolor=\"#d0ddb0\">
159
		$l_new_password<br>
160
		</td>
161
		<td>
162
		<input type=password name=passwd value="" size=20>
163
		<br /><input type=\"button\" value=\"$l_passwd_gen\" onclick=\"password(8)\">
164
		<input type=\"text\" value=\"\" name=\"pwdgene\" size=10 readonly>
165
		</td>
166
		</tr>";
167
 
168
 
169
		foreach($show_attrs as $key => $desc){
170
		$name = $attrmap["$key"];
171
		$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : '';
172
		if ($name == 'none')
173
			continue;
174
		unset($vals);
175
		unset($selected);
176
		unset($ops);
177
		$def_added = 0;
178
		if (isset($item_vals["$key"]['count']) && $item_vals["$key"]['count']){
179
			for($i=0;$i<$item_vals["$key"]['count'];$i++){
180
				$vals[] = $item_vals["$key"][$i];
181
				$ops[] = $item_vals["$key"]['operator'][$i];
182
			}
183
		}
184
		else{
185
			if (isset($default_vals["$key"]['count']) && $default_vals["$key"]['count']){
186
				for($i=0;$i<$default_vals["$key"]['count'];$i++){
187
					$vals[] = $default_vals["$key"][$i];
188
					$ops[] = $default_vals["$key"]['operator'][$i];
189
				}
190
			}
191
			else{
192
				$vals[] = '';
193
				$ops[] = '=';
194
			}
195
			$def_added = 1;
196
		}
197
		if ($generic == 'generic' && $def_added == 0){
198
			for($i=0;$i<$default_vals["$key"]['count'];$i++){
199
				$vals[] = $default_vals["$key"][$i];
200
				$ops[] = $default_vals["$key"]['operator'][$i];
201
			}
202
		}
203
		if (isset($add) && $add && $name == $add_attr){
204
			$vals[] = $default_vals["$key"][0];
205
			$ops[] = ($default_vals["$key"]['operator'][0] != '') ? $default_vals["$key"]['operator'][0] : '=';
206
		}
207
 
208
		$i = 0;
209
		foreach($vals as $val){
210
			$name1 = $name . $i;
211
			$val = preg_replace('/\"/','&quot;',$val);
212
			$oper_name = $name1 . '_op';
213
			$oper = $ops[$i];
214
			$selected[$oper] = 'selected';
215
			$i++;
216
		switch ($key)
217
		{
218
				// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
219
			case 'Simultaneous-Use' :
220
				$advanced=1;
221
				$help_link="help/simultaneous_use_help.html";
222
				$desc=$l_simultaneous_use;
223
				break;
224
			case 'Max-All-Session' :
225
				$advanced=1;
226
				$help_link="help/max_all_session_help.html";
227
				$desc=$l_max_all_session;
228
				break;
229
			case 'Session-Timeout' :
230
				$advanced=1;
231
				$help_link="help/session_timeout_help.html";
232
				$desc=$l_session_timeout;
233
				break;
234
			case 'Max-Daily-Session' :
235
				$advanced=1;
236
				$help_link="help/session_timeout_help.html";
237
				$desc=$l_daily_timeout;
238
				break;
239
			case 'Max-Monthly-Session' :
240
				$advanced=1;
241
				$help_link="help/session_timeout_help.html";
242
				$desc=$l_monthly_timeout;
243
				break;
244
			case 'Login-Time' :
245
				$advanced=1;
246
				$help_link="help/login_time_help.html";
247
				$desc=$l_login_time;
248
				break;
249
			case 'Expiration' :
250
				$advanced=1;
251
				$help_link="help/expiration_help.html";
252
				$desc=$l_expiration;
253
				break;
254
			case 'ChilliSpot-Max-Input-Octets' :
255
				$advanced=1;
256
				$help_link="help/chillispot_max_input_octets_help.html";
257
				$desc=$l_max_input_octets;
258
				break;
259
			case 'ChilliSpot-Max-Output-Octets' :
260
				$advanced=1;
261
				$help_link="help/chillispot_max_output_octets_help.html";
262
				$desc=$l_max_output_octets;
263
				break;
264
			case 'ChilliSpot-Max-Total-Octets' :
265
				$advanced=1;
266
				$help_link="help/chillispot_max_total_octets_help.html";
267
				$desc=$l_max_total_octets;
268
				break;
269
			case 'ChilliSpot-Bandwidth-Max-Up' :
270
				$advanced=1;
271
				$help_link="help/chillispot_bandwidth_max_up_help.html";
272
				$desc=$l_max_bandwidth_up;
273
				break;
274
			case 'ChilliSpot-Bandwidth-Max-Down' :
275
				$advanced=1;
276
				$help_link="help/chillispot_bandwidth_max_down_help.html";
277
				$desc=$l_max_bandwidth_down;
278
				break;
279
			case 'WISPr-Redirection-URL' :
280
				$advanced=1;
281
				$help_link="help/wispr_redirection_url_help.html";
282
				$desc=$l_wispr_redirection;
283
				break;
284
			case 'Filter-Id' :
285
				$advanced=1;
286
				$help_link="help/filtering_help.html";
287
				$desc=$l_filtering;
288
				break;
289
			default:
290
				$advanced=1;
291
				break;
292
		}
293
			print <<<EOM
294
			<tr>
295
			<td class="etiquette">
296
			<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>
297
EOM;
298
			if ($show_ops){
299
				if(!isset($selected[$op_eq])) $selected[$op_eq] = '';
300
				switch ($key)
301
					{
302
					case 'Simultaneous-Use' :
303
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
304
						break;
305
					case 'Login-Time' :
306
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
307
						break;
308
					case 'Expiration' :
309
						if($login == "sms" && $user_type == 'group'){
310
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20 disabled></td>";
311
						} else {
312
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input id=\"popup_container\" type=text name=\"$name1\" value=\"$val\" size=20></td>";
313
						}
314
						break;
315
					case 'Max-All-Session' :
316
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
317
						break;
318
					case 'Session-Timeout' :
319
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
320
						break;
321
					case 'Max-Daily-Session' :
322
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
323
						break;
324
					case 'Max-Weekly-Session' :
325
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
326
						break;
327
					case 'Max-Monthly-Session' :
328
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
329
						break;
330
					case 'ChilliSpot-Max-Input-Octets' :
331
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
332
						break;
333
					case 'ChilliSpot-Max-Output-Octets' :
334
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
335
						break;
336
					case 'ChilliSpot-Max-Total-Octets' :
337
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
338
						break;
339
					case 'ChilliSpot-Bandwidth-Max-Up' :
340
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
341
						break;
342
					case 'ChilliSpot-Bandwidth-Max-Down' :
343
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
344
						break;
345
					case 'WISPr-Redirection-URL' :
346
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
347
						break;
348
					case 'Filter-Id' :
349
						switch($val)
350
						{
351
							case "00000001":
352
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\" selected=\"selected\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
353
								break;
354
							case "00000011":
355
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\" selected=\"selected\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
356
								break;
357
							case "00000101":
358
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\" selected=\"selected\">$l_filtering_havp_wl</option></select></td>";
359
								break;
360
							default :
361
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\" selected=\"selected\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
362
								break;
363
						}
364
						break;
365
					default :
366
						print <<<EOM
367
<td>
368
<select name=$oper_name>
369
<option $selected[$op_eq] value="=">=
370
<option $selected[$op_set] value=":=">:=
371
<option $selected[$op_add] value="+=">+=
372
<option $selected[$op_eq2] value="==">==
373
<option $selected[$op_ne] value="!=">!=
374
<option $selected[$op_gt] value=">">&gt;
375
<option $selected[$op_ge] value=">=">&gt;=
376
<option $selected[$op_lt] value="<">&lt;
377
<option $selected[$op_le] value="<=">&lt;=
378
<option $selected[$op_regeq] value="=~">=~
379
<option $selected[$op_regne] value="!~">!~
380
<option $selected[$op_exst] value="=*">=*
381
<option $selected[$op_nexst] value="!*">!*
382
</select>
383
</td>
384
<td><input type=text name="$name1" value="$val" size=20></td>
385
EOM;
386
						break;
387
					}
388
				}
389
			print <<<EOM
390
</tr>
391
EOM;
392
		}
393
	}
394
 
395
 
396
	}
397
 
398
 
324 richard 399
?>
400
   <form name="edituser" method=post>
401
      <input type=hidden name=login value=<?php print $login ?>>
402
      <input type=hidden name=user_type value=<?php print $user_type ?>>
403
      <input type=hidden name=change value="0">
404
      <input type=hidden name=add value="0">
405
      <input type=hidden name=badusers value="0">
406
      <input type=hidden name=group_change value="0">
407
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
408
<?php
1805 clement.si 409
if ($user_type != 'group' && $config['general_show_user_password'] != 'no'){
324 richard 410
	echo <<<EOM
411
<tr>
412
<td align=right colspan=$colspan bgcolor="#d0ddb0">
907 richard 413
$l_new_password<br>
324 richard 414
EOM;
415
	echo <<<EOM
416
</td>
417
<td>
925 richard 418
<input type=password name=passwd value="" size=20>
907 richard 419
<br /><input type="button" value="$l_passwd_gen" onclick="password(8)">
925 richard 420
<input type="text" value="" name="pwdgene" size=10 readonly>
324 richard 421
</td>
422
</tr>
423
EOM;
424
}
1882 raphael.pi 425
 
426
	/*on charge les attributs utilisateurs afin de montrer les groupes disponibles*/
427
	if ($user_type != 'group'){
428
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
429
			include("../lib/$config[general_lib_type]/user_info.php");
430
		if ($config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
431
			$saved_login = $login;
432
			$login = '';
433
			if (is_file("../lib/sql/group_info.php"))
434
				include("../lib/sql/group_info.php");
435
			$login = $saved_login;
436
		}
1881 raphael.pi 437
	}
438
 
324 richard 439
	foreach($show_attrs as $key => $desc){
440
		$name = $attrmap["$key"];
1805 clement.si 441
		$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : '';
324 richard 442
		if ($name == 'none')
443
			continue;
444
		unset($vals);
445
		unset($selected);
446
		unset($ops);
447
		$def_added = 0;
1805 clement.si 448
		if (isset($item_vals["$key"]['count']) && $item_vals["$key"]['count']){
449
			for($i=0;$i<$item_vals["$key"]['count'];$i++){
324 richard 450
				$vals[] = $item_vals["$key"][$i];
1805 clement.si 451
				$ops[] = $item_vals["$key"]['operator'][$i];
324 richard 452
			}
453
		}
454
		else{
1805 clement.si 455
			if (isset($default_vals["$key"]['count']) && $default_vals["$key"]['count']){
456
				for($i=0;$i<$default_vals["$key"]['count'];$i++){
324 richard 457
					$vals[] = $default_vals["$key"][$i];
1805 clement.si 458
					$ops[] = $default_vals["$key"]['operator'][$i];
324 richard 459
				}
460
			}
461
			else{
462
				$vals[] = '';
463
				$ops[] = '=';
464
			}
465
			$def_added = 1;
466
		}
467
		if ($generic == 'generic' && $def_added == 0){
1805 clement.si 468
			for($i=0;$i<$default_vals["$key"]['count'];$i++){
324 richard 469
				$vals[] = $default_vals["$key"][$i];
1805 clement.si 470
				$ops[] = $default_vals["$key"]['operator'][$i];
324 richard 471
			}
1805 clement.si 472
		}
473
		if (isset($add) && $add && $name == $add_attr){
324 richard 474
			$vals[] = $default_vals["$key"][0];
1805 clement.si 475
			$ops[] = ($default_vals["$key"]['operator'][0] != '') ? $default_vals["$key"]['operator'][0] : '=';
324 richard 476
		}
477
 
478
		$i = 0;
479
		foreach($vals as $val){
480
			$name1 = $name . $i;
1805 clement.si 481
			$val = preg_replace('/\"/','&quot;',$val);
324 richard 482
			$oper_name = $name1 . '_op';
483
			$oper = $ops[$i];
484
			$selected[$oper] = 'selected';
485
			$i++;
899 richard 486
		switch ($key)
487
		{
1805 clement.si 488
				// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
489
			case 'Simultaneous-Use' :
899 richard 490
				$advanced=1;
491
				$help_link="help/simultaneous_use_help.html";
492
				$desc=$l_simultaneous_use;
493
				break;
494
			case 'Max-All-Session' :
495
				$advanced=1;
496
				$help_link="help/max_all_session_help.html";
497
				$desc=$l_max_all_session;
498
				break;
1805 clement.si 499
			case 'Session-Timeout' :
899 richard 500
				$advanced=1;
501
				$help_link="help/session_timeout_help.html";
502
				$desc=$l_session_timeout;
503
				break;
504
			case 'Max-Daily-Session' :
505
				$advanced=1;
506
				$help_link="help/session_timeout_help.html";
507
				$desc=$l_daily_timeout;
508
				break;
509
			case 'Max-Monthly-Session' :
510
				$advanced=1;
511
				$help_link="help/session_timeout_help.html";
512
				$desc=$l_monthly_timeout;
513
				break;
1805 clement.si 514
			case 'Login-Time' :
899 richard 515
				$advanced=1;
516
				$help_link="help/login_time_help.html";
517
				$desc=$l_login_time;
518
				break;
519
			case 'Expiration' :
520
				$advanced=1;
521
				$help_link="help/expiration_help.html";
522
				$desc=$l_expiration;
523
				break;
524
			case 'ChilliSpot-Max-Input-Octets' :
525
				$advanced=1;
526
				$help_link="help/chillispot_max_input_octets_help.html";
527
				$desc=$l_max_input_octets;
528
				break;
529
			case 'ChilliSpot-Max-Output-Octets' :
530
				$advanced=1;
531
				$help_link="help/chillispot_max_output_octets_help.html";
532
				$desc=$l_max_output_octets;
533
				break;
534
			case 'ChilliSpot-Max-Total-Octets' :
535
				$advanced=1;
536
				$help_link="help/chillispot_max_total_octets_help.html";
537
				$desc=$l_max_total_octets;
538
				break;
539
			case 'ChilliSpot-Bandwidth-Max-Up' :
540
				$advanced=1;
541
				$help_link="help/chillispot_bandwidth_max_up_help.html";
542
				$desc=$l_max_bandwidth_up;
543
				break;
544
			case 'ChilliSpot-Bandwidth-Max-Down' :
545
				$advanced=1;
546
				$help_link="help/chillispot_bandwidth_max_down_help.html";
547
				$desc=$l_max_bandwidth_down;
548
				break;
549
			case 'WISPr-Redirection-URL' :
550
				$advanced=1;
551
				$help_link="help/wispr_redirection_url_help.html";
552
				$desc=$l_wispr_redirection;
553
				break;
1377 richard 554
			case 'Filter-Id' :
555
				$advanced=1;
556
				$help_link="help/filtering_help.html";
557
				$desc=$l_filtering;
558
				break;
899 richard 559
			default:
560
				$advanced=1;
561
				break;
562
		}
324 richard 563
			print <<<EOM
899 richard 564
			<tr>
565
			<td class="etiquette">
566
			<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 567
EOM;
568
			if ($show_ops){
1805 clement.si 569
				if(!isset($selected[$op_eq])) $selected[$op_eq] = '';
324 richard 570
				switch ($key)
571
					{
1805 clement.si 572
					case 'Simultaneous-Use' :
925 richard 573
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 574
						break;
1805 clement.si 575
					case 'Login-Time' :
925 richard 576
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 577
						break;
578
					case 'Expiration' :
1380 richard 579
						if($login == "sms" && $user_type == 'group'){
580
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20 disabled></td>";
581
						} else {
1566 richard 582
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input id=\"popup_container\" type=text name=\"$name1\" value=\"$val\" size=20></td>";
1380 richard 583
						}
324 richard 584
						break;
886 stephane 585
					case 'Max-All-Session' :
925 richard 586
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
886 stephane 587
						break;
324 richard 588
					case 'Session-Timeout' :
925 richard 589
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 590
						break;
591
					case 'Max-Daily-Session' :
925 richard 592
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 593
						break;
594
					case 'Max-Weekly-Session' :
925 richard 595
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 596
						break;
597
					case 'Max-Monthly-Session' :
925 richard 598
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 599
						break;
600
					case 'ChilliSpot-Max-Input-Octets' :
925 richard 601
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 602
						break;
603
					case 'ChilliSpot-Max-Output-Octets' :
925 richard 604
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 605
						break;
606
					case 'ChilliSpot-Max-Total-Octets' :
925 richard 607
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 608
						break;
609
					case 'ChilliSpot-Bandwidth-Max-Up' :
925 richard 610
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 611
						break;
612
					case 'ChilliSpot-Bandwidth-Max-Down' :
925 richard 613
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 614
						break;
615
					case 'WISPr-Redirection-URL' :
925 richard 616
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
324 richard 617
						break;
1377 richard 618
					case 'Filter-Id' :
619
						switch($val)
620
						{
621
							case "00000001":
1838 raphael.pi 622
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\" selected=\"selected\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
1377 richard 623
								break;
624
							case "00000011":
1838 raphael.pi 625
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\" selected=\"selected\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
1377 richard 626
								break;
627
							case "00000101":
1838 raphael.pi 628
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\" selected=\"selected\">$l_filtering_havp_wl</option></select></td>";
1377 richard 629
								break;
630
							default :
1838 raphael.pi 631
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\" selected=\"selected\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
1377 richard 632
								break;
633
						}
634
						break;
324 richard 635
					default :
636
						print <<<EOM
637
<td>
638
<select name=$oper_name>
639
<option $selected[$op_eq] value="=">=
640
<option $selected[$op_set] value=":=">:=
641
<option $selected[$op_add] value="+=">+=
642
<option $selected[$op_eq2] value="==">==
643
<option $selected[$op_ne] value="!=">!=
644
<option $selected[$op_gt] value=">">&gt;
645
<option $selected[$op_ge] value=">=">&gt;=
646
<option $selected[$op_lt] value="<">&lt;
647
<option $selected[$op_le] value="<=">&lt;=
648
<option $selected[$op_regeq] value="=~">=~
649
<option $selected[$op_regne] value="!~">!~
650
<option $selected[$op_exst] value="=*">=*
651
<option $selected[$op_nexst] value="!*">!*
652
</select>
653
</td>
925 richard 654
<td><input type=text name="$name1" value="$val" size=20></td>
324 richard 655
EOM;
656
						break;
657
					}
658
				}
659
			print <<<EOM
660
</tr>
661
EOM;
662
		}
663
	}
664
if ($user_type != 'group'){
665
	echo <<<EOM
666
<tr>
667
<td align=right colspan=$colspan bgcolor="#d0ddb0">
910 richard 668
$l_group_member<br><font size=-2><i>($l_main_group)</i></font>
324 richard 669
</td>
670
<td>
671
EOM;
1831 raphael.pi 672
 
673
 
1838 raphael.pi 674
	if (isset($existing_groups)){
1831 raphael.pi 675
	echo "<select size=5 name=\"edited_groups[]\"  OnChange=\"this.form.group_change.value=1\">";
1805 clement.si 676
	if ($config['sql_show_all_groups'] == 'true'){
324 richard 677
		foreach ($existing_groups as $group => $count){
1831 raphael.pi 678
			if (isset($member_groups[$group]) && ($member_groups[$group] == $group))
324 richard 679
				echo "<option selected value=\"$group\">$group\n";
1831 raphael.pi 680
			else if(isset($member_groups[0]) && ($member_groups[0] == $group))
681
				echo "<option selected value=\"$group\">$group\n";
324 richard 682
			else
683
				echo "<option value=\"$group\">$group\n";
684
			}
685
		}else{
686
		foreach ($member_groups as $group)
687
			echo "<option value=\"$group\">$group\n";
688
		}
689
		echo "</select></td></tr>";
690
	}
691
	else{
1831 raphael.pi 692
		echo "Aucun groupe</td></tr>";
324 richard 693
	}
1805 clement.si 694
}
324 richard 695
echo "</table><br>";
910 richard 696
echo "<input type=submit class=button value=$l_change OnClick=\"this.form.change.value=1\">";
324 richard 697
//if ($user_type != 'group'){
698
//	echo <<<EOM
699
//<br><br>
700
//<input type=submit class=button value="Add to Badusers" OnClick="this.form.badusers.value=1">
701
//<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">&lt;--Help</font></a>
702
//EOM;
703
//}
704
?>
705
</form>
706
</td></tr>
707
</table>
708
</tr>
709
</table>
710
</td></tr>
711
</TABLE>
712
</body>
713
</html>
1881 raphael.pi 714