Subversion Repositories ALCASAR

Rev

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

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