Subversion Repositories ALCASAR

Rev

Rev 1883 | Rev 2299 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

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