Subversion Repositories ALCASAR

Rev

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