Subversion Repositories ALCASAR

Rev

Rev 2299 | Rev 2339 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

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