Subversion Repositories ALCASAR

Rev

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