Subversion Repositories ALCASAR

Rev

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

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