Subversion Repositories ALCASAR

Rev

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

Rev 1377 Rev 1380
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
if ($user_type != 'group'){
8
if ($user_type != 'group'){
9
	if (is_file("../lib/$config[general_lib_type]/user_info.php"))
9
	if (is_file("../lib/$config[general_lib_type]/user_info.php"))
10
		include("../lib/$config[general_lib_type]/user_info.php");
10
		include("../lib/$config[general_lib_type]/user_info.php");
11
	if ($config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
11
	if ($config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
12
		$saved_login = $login;
12
		$saved_login = $login;
13
		$login = '';
13
		$login = '';
14
		if (is_file("../lib/sql/group_info.php"))
14
		if (is_file("../lib/sql/group_info.php"))
15
			include("../lib/sql/group_info.php");
15
			include("../lib/sql/group_info.php");
16
		$login = $saved_login;
16
		$login = $saved_login;
17
	}
17
	}
18
}
18
}
19
else{
19
else{
20
	if (is_file("../lib/$config[general_lib_type]/group_info.php"))
20
	if (is_file("../lib/$config[general_lib_type]/group_info.php"))
21
		include("../lib/$config[general_lib_type]/group_info.php");
21
		include("../lib/$config[general_lib_type]/group_info.php");
22
}
22
}
23
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
23
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
24
	$colspan=2;
24
	$colspan=2;
25
	$show_ops = 1;
25
	$show_ops = 1;
26
	include("../lib/operators.php");
26
	include("../lib/operators.php");
27
}
27
}
28
else{
28
else{
29
	$show_ops = 0;
29
	$show_ops = 0;
30
	$colspan=1;
30
	$colspan=1;
31
}
31
}
32
?>
32
?>
33
<html>
33
<html>
34
<head>
34
<head>
35
<title>Users & groups edition</title>
35
<title>Users & groups edition</title>
36
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
36
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
37
<link rel="stylesheet" href="/css/style.css">
37
<link rel="stylesheet" href="/css/style.css">
38
<script language="javascript" type="text/javascript">
38
<script language="javascript" type="text/javascript">
39
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'
39
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'
40
function password(size)
40
function password(size)
41
  {
41
  {
42
  var pass=''
42
  var pass=''
43
  while(pass.length < size)
43
  while(pass.length < size)
44
  {
44
  {
45
    pass+=chars.charAt(Math.round(Math.random() * (chars.length)))
45
    pass+=chars.charAt(Math.round(Math.random() * (chars.length)))
46
  }
46
  }
47
  document.edituser.passwd.value=pass
47
  document.edituser.passwd.value=pass
48
  document.edituser.pwdgene.value=pass
48
  document.edituser.pwdgene.value=pass
49
}
49
}
50
</script>
50
</script>
51
</head>
51
</head>
52
<body>
52
<body>
53
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
53
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
54
	<tr><th>
54
	<tr><th>
55
<?php
55
<?php
56
if ($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";}
56
if ($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";}
57
?>
57
?>
58
	</th></tr>
58
	</th></tr>
59
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" 
59
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" 
60
height="2"></td></tr>
60
height="2"></td></tr>
61
</TABLE>
61
</TABLE>
62
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
62
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
63
	<tr><td valign="middle" align="left">
63
	<tr><td valign="middle" align="left">
64
	<center>
64
	<center>
65
	<table border=0 width=640 cellpadding=0 cellspacing=2>
65
	<table border=0 width=640 cellpadding=0 cellspacing=2>
66
<?php
66
<?php
67
if ($user_type != 'group')
67
if ($user_type != 'group')
68
	{
68
	{
69
	include("../html/user_toolbar.html.php");
69
	include("../html/user_toolbar.html.php");
70
	$titre=$l_user;
70
	$titre=$l_user;
71
	}
71
	}
72
else
72
else
73
	{
73
	{
74
	include("../html/group_toolbar.html.php");
74
	include("../html/group_toolbar.html.php");
75
	$titre=$l_group;
75
	$titre=$l_group;
76
	}
76
	}
77
print <<<EOM
77
print <<<EOM
78
</table>
78
</table>
79
<br>
79
<br>
80
<table border=0 width=620 cellpadding=1 cellspacing=1>
80
<table border=0 width=620 cellpadding=1 cellspacing=1>
81
<tr valign=top>
81
<tr valign=top>
82
<td width=400></td>
82
<td width=400></td>
83
<td bgcolor="black">
83
<td bgcolor="black">
84
	<table border=0 width=100% cellpadding=2 cellspacing=0>
84
	<table border=0 width=100% cellpadding=2 cellspacing=0>
85
	<tr bgcolor="#907030" align=center valign=top><th>
85
	<tr bgcolor="#907030" align=center valign=top><th>
86
	<font color="white">$titre : $login ($cn)</font>
86
	<font color="white">$titre : $login ($cn)</font>
87
	</th></tr>
87
	</th></tr>
88
	</table>
88
	</table>
89
</td></tr>
89
</td></tr>
90
<tr bgcolor="black" valign=top><td colspan=2>
90
<tr bgcolor="black" valign=top><td colspan=2>
91
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
91
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
92
	<tr><td>
92
	<tr><td>
93
EOM;
93
EOM;
94
   
94
   
95
if ($change == 1){
95
if ($change == 1){
96
	if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
96
	if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
97
		include("../lib/$config[general_lib_type]/change_attrs.php");
97
		include("../lib/$config[general_lib_type]/change_attrs.php");
98
	if ($user_type != 'group'){
98
	if ($user_type != 'group'){
99
		if ($config[general_show_user_password] != 'no' && $passwd != '' 
99
		if ($config[general_show_user_password] != 'no' && $passwd != '' 
100
			&& is_file("../lib/$config[general_lib_type]/change_passwd.php"))
100
			&& is_file("../lib/$config[general_lib_type]/change_passwd.php"))
101
			include("../lib/$config[general_lib_type]/change_passwd.php");
101
			include("../lib/$config[general_lib_type]/change_passwd.php");
102
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
102
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
103
			include("../lib/$config[general_lib_type]/user_info.php");
103
			include("../lib/$config[general_lib_type]/user_info.php");
104
		if ($group_change && $config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
104
		if ($group_change && $config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
105
			include("../lib/sql/group_change.php");
105
			include("../lib/sql/group_change.php");
106
			include("../lib/defaults.php");
106
			include("../lib/defaults.php");
107
		}
107
		}
108
		# Disconnecting user for re-authentication
108
		# Disconnecting user for re-authentication
109
		$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $login \" | awk '{print $1}'");
109
		$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $login \" | awk '{print $1}'");
110
		exec("sudo /usr/sbin/chilli_query logout $mac");
110
		exec("sudo /usr/sbin/chilli_query logout $mac");
111
	}
111
	}
112
	else{
112
	else{
113
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
113
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
114
			include("../lib/$config[general_lib_type]/group_info.php");
114
			include("../lib/$config[general_lib_type]/group_info.php");
115
		# Disconnecting all users from the selected group for re-authentication
115
		# Disconnecting all users from the selected group for re-authentication
116
		if (isset($group_members)){
116
		if (isset($group_members)){
117
			foreach ($group_members as $g_member => $member){
117
			foreach ($group_members as $g_member => $member){
118
				$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $member \" | awk '{print $1}'");
118
				$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $member \" | awk '{print $1}'");
119
				exec("sudo /usr/sbin/chilli_query logout $mac");
119
				exec("sudo /usr/sbin/chilli_query logout $mac");
120
			}
120
			}
121
		}
121
		}
122
	}
122
	}
123
}
123
}
124
else if ($badusers == 1){
124
else if ($badusers == 1){
125
	if (is_file("../lib/add_badusers.php"))
125
	if (is_file("../lib/add_badusers.php"))
126
		include("../lib/add_badusers.php");
126
		include("../lib/add_badusers.php");
127
}
127
}
128
	
128
	
129
?>
129
?>
130
   <form name="edituser" method=post>
130
   <form name="edituser" method=post>
131
      <input type=hidden name=login value=<?php print $login ?>>
131
      <input type=hidden name=login value=<?php print $login ?>>
132
      <input type=hidden name=user_type value=<?php print $user_type ?>>
132
      <input type=hidden name=user_type value=<?php print $user_type ?>>
133
      <input type=hidden name=change value="0">
133
      <input type=hidden name=change value="0">
134
      <input type=hidden name=add value="0">
134
      <input type=hidden name=add value="0">
135
      <input type=hidden name=badusers value="0">
135
      <input type=hidden name=badusers value="0">
136
      <input type=hidden name=group_change value="0">
136
      <input type=hidden name=group_change value="0">
137
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
137
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
138
<?php
138
<?php
139
if ($user_type != 'group' && $config[general_show_user_password] != 'no'){
139
if ($user_type != 'group' && $config[general_show_user_password] != 'no'){
140
	echo <<<EOM
140
	echo <<<EOM
141
<tr>
141
<tr>
142
<td align=right colspan=$colspan bgcolor="#d0ddb0">
142
<td align=right colspan=$colspan bgcolor="#d0ddb0">
143
$l_new_password<br>
143
$l_new_password<br>
144
EOM;
144
EOM;
145
	echo <<<EOM
145
	echo <<<EOM
146
</td>
146
</td>
147
<td>
147
<td>
148
<input type=password name=passwd value="" size=20>
148
<input type=password name=passwd value="" size=20>
149
<br /><input type="button" value="$l_passwd_gen" onclick="password(8)">
149
<br /><input type="button" value="$l_passwd_gen" onclick="password(8)">
150
<input type="text" value="" name="pwdgene" size=10 readonly>
150
<input type="text" value="" name="pwdgene" size=10 readonly>
151
</td>
151
</td>
152
</tr>
152
</tr>
153
EOM;
153
EOM;
154
}
154
}
155
	foreach($show_attrs as $key => $desc){
155
	foreach($show_attrs as $key => $desc){
156
		$name = $attrmap["$key"];
156
		$name = $attrmap["$key"];
157
		$generic = $attrmap[generic]["$key"];
157
		$generic = $attrmap[generic]["$key"];
158
		if ($name == 'none')
158
		if ($name == 'none')
159
			continue;
159
			continue;
160
		unset($vals);
160
		unset($vals);
161
		unset($selected);
161
		unset($selected);
162
		unset($ops);
162
		unset($ops);
163
		$def_added = 0;
163
		$def_added = 0;
164
		if ($item_vals["$key"][count]){
164
		if ($item_vals["$key"][count]){
165
			for($i=0;$i<$item_vals["$key"][count];$i++){
165
			for($i=0;$i<$item_vals["$key"][count];$i++){
166
				$vals[] = $item_vals["$key"][$i];
166
				$vals[] = $item_vals["$key"][$i];
167
				$ops[] = $item_vals["$key"][operator][$i];
167
				$ops[] = $item_vals["$key"][operator][$i];
168
			}
168
			}
169
		}
169
		}
170
		else{
170
		else{
171
			if ($default_vals["$key"][count]){
171
			if ($default_vals["$key"][count]){
172
				for($i=0;$i<$default_vals["$key"][count];$i++){
172
				for($i=0;$i<$default_vals["$key"][count];$i++){
173
					$vals[] = $default_vals["$key"][$i];
173
					$vals[] = $default_vals["$key"][$i];
174
					$ops[] = $default_vals["$key"][operator][$i];
174
					$ops[] = $default_vals["$key"][operator][$i];
175
				}
175
				}
176
			}
176
			}
177
			else{
177
			else{
178
				$vals[] = '';
178
				$vals[] = '';
179
				$ops[] = '=';
179
				$ops[] = '=';
180
			}
180
			}
181
			$def_added = 1;
181
			$def_added = 1;
182
		}
182
		}
183
		if ($generic == 'generic' && $def_added == 0){
183
		if ($generic == 'generic' && $def_added == 0){
184
			for($i=0;$i<$default_vals["$key"][count];$i++){
184
			for($i=0;$i<$default_vals["$key"][count];$i++){
185
				$vals[] = $default_vals["$key"][$i];
185
				$vals[] = $default_vals["$key"][$i];
186
				$ops[] = $default_vals["$key"][operator][$i];
186
				$ops[] = $default_vals["$key"][operator][$i];
187
			}
187
			}
188
		}	
188
		}	
189
		if ($add && $name == $add_attr){
189
		if ($add && $name == $add_attr){
190
			$vals[] = $default_vals["$key"][0];
190
			$vals[] = $default_vals["$key"][0];
191
			$ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '=';
191
			$ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '=';
192
		}
192
		}
193
 
193
 
194
		$i = 0;
194
		$i = 0;
195
		foreach($vals as $val){
195
		foreach($vals as $val){
196
			$name1 = $name . $i;
196
			$name1 = $name . $i;
197
			$val = ereg_replace('"','&quot;',$val);
197
			$val = ereg_replace('"','&quot;',$val);
198
			$oper_name = $name1 . '_op';
198
			$oper_name = $name1 . '_op';
199
			$oper = $ops[$i];
199
			$oper = $ops[$i];
200
			$selected[$oper] = 'selected';
200
			$selected[$oper] = 'selected';
201
			$i++;
201
			$i++;
202
		switch ($key)
202
		switch ($key)
203
		{
203
		{
204
				// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) 
204
				// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) 
205
			case 'Simultaneous-Use' : 
205
			case 'Simultaneous-Use' : 
206
				$advanced=1;
206
				$advanced=1;
207
				$help_link="help/simultaneous_use_help.html";
207
				$help_link="help/simultaneous_use_help.html";
208
				$desc=$l_simultaneous_use;
208
				$desc=$l_simultaneous_use;
209
				break;
209
				break;
210
			case 'Max-All-Session' :
210
			case 'Max-All-Session' :
211
				$advanced=1;
211
				$advanced=1;
212
				$help_link="help/max_all_session_help.html";
212
				$help_link="help/max_all_session_help.html";
213
				$desc=$l_max_all_session;
213
				$desc=$l_max_all_session;
214
				break;
214
				break;
215
			case 'Session-Timeout' : 
215
			case 'Session-Timeout' : 
216
				$advanced=1;
216
				$advanced=1;
217
				$help_link="help/session_timeout_help.html";
217
				$help_link="help/session_timeout_help.html";
218
				$desc=$l_session_timeout;
218
				$desc=$l_session_timeout;
219
				break;
219
				break;
220
			case 'Max-Daily-Session' :
220
			case 'Max-Daily-Session' :
221
				$advanced=1;
221
				$advanced=1;
222
				$help_link="help/session_timeout_help.html";
222
				$help_link="help/session_timeout_help.html";
223
				$desc=$l_daily_timeout;
223
				$desc=$l_daily_timeout;
224
				break;
224
				break;
225
			case 'Max-Monthly-Session' :
225
			case 'Max-Monthly-Session' :
226
				$advanced=1;
226
				$advanced=1;
227
				$help_link="help/session_timeout_help.html";
227
				$help_link="help/session_timeout_help.html";
228
				$desc=$l_monthly_timeout;
228
				$desc=$l_monthly_timeout;
229
				break;
229
				break;
230
			case 'Login-Time' : 
230
			case 'Login-Time' : 
231
				$advanced=1;
231
				$advanced=1;
232
				$help_link="help/login_time_help.html";
232
				$help_link="help/login_time_help.html";
233
				$desc=$l_login_time;
233
				$desc=$l_login_time;
234
				break;
234
				break;
235
			case 'Expiration' :
235
			case 'Expiration' :
236
				$advanced=1;
236
				$advanced=1;
237
				$help_link="help/expiration_help.html";
237
				$help_link="help/expiration_help.html";
238
				$desc=$l_expiration;
238
				$desc=$l_expiration;
239
				break;
239
				break;
240
			case 'ChilliSpot-Max-Input-Octets' :
240
			case 'ChilliSpot-Max-Input-Octets' :
241
				$advanced=1;
241
				$advanced=1;
242
				$help_link="help/chillispot_max_input_octets_help.html";
242
				$help_link="help/chillispot_max_input_octets_help.html";
243
				$desc=$l_max_input_octets;
243
				$desc=$l_max_input_octets;
244
				break;
244
				break;
245
			case 'ChilliSpot-Max-Output-Octets' :
245
			case 'ChilliSpot-Max-Output-Octets' :
246
				$advanced=1;
246
				$advanced=1;
247
				$help_link="help/chillispot_max_output_octets_help.html";
247
				$help_link="help/chillispot_max_output_octets_help.html";
248
				$desc=$l_max_output_octets;
248
				$desc=$l_max_output_octets;
249
				break;
249
				break;
250
			case 'ChilliSpot-Max-Total-Octets' :
250
			case 'ChilliSpot-Max-Total-Octets' :
251
				$advanced=1;
251
				$advanced=1;
252
				$help_link="help/chillispot_max_total_octets_help.html";
252
				$help_link="help/chillispot_max_total_octets_help.html";
253
				$desc=$l_max_total_octets;
253
				$desc=$l_max_total_octets;
254
				break;
254
				break;
255
			case 'ChilliSpot-Bandwidth-Max-Up' :
255
			case 'ChilliSpot-Bandwidth-Max-Up' :
256
				$advanced=1;
256
				$advanced=1;
257
				$help_link="help/chillispot_bandwidth_max_up_help.html";
257
				$help_link="help/chillispot_bandwidth_max_up_help.html";
258
				$desc=$l_max_bandwidth_up;
258
				$desc=$l_max_bandwidth_up;
259
				break;
259
				break;
260
			case 'ChilliSpot-Bandwidth-Max-Down' :
260
			case 'ChilliSpot-Bandwidth-Max-Down' :
261
				$advanced=1;
261
				$advanced=1;
262
				$help_link="help/chillispot_bandwidth_max_down_help.html";
262
				$help_link="help/chillispot_bandwidth_max_down_help.html";
263
				$desc=$l_max_bandwidth_down;
263
				$desc=$l_max_bandwidth_down;
264
				break;
264
				break;
265
			case 'WISPr-Redirection-URL' :
265
			case 'WISPr-Redirection-URL' :
266
				$advanced=1;
266
				$advanced=1;
267
				$help_link="help/wispr_redirection_url_help.html";
267
				$help_link="help/wispr_redirection_url_help.html";
268
				$desc=$l_wispr_redirection;
268
				$desc=$l_wispr_redirection;
269
				break;
269
				break;
270
			case 'Filter-Id' :
270
			case 'Filter-Id' :
271
				$advanced=1;
271
				$advanced=1;
272
				$help_link="help/filtering_help.html";
272
				$help_link="help/filtering_help.html";
273
				$desc=$l_filtering;
273
				$desc=$l_filtering;
274
				break;
274
				break;
275
			default:
275
			default:
276
				$advanced=1;
276
				$advanced=1;
277
				break;
277
				break;
278
		}
278
		}
279
			print <<<EOM
279
			print <<<EOM
280
			<tr>
280
			<tr>
281
			<td class="etiquette">
281
			<td class="etiquette">
282
			<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>
282
			<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>
283
EOM;
283
EOM;
284
			if ($show_ops){
284
			if ($show_ops){
285
				switch ($key)
285
				switch ($key)
286
					{
286
					{
287
					case 'Simultaneous-Use' : 
287
					case 'Simultaneous-Use' : 
288
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
288
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
289
						break;
289
						break;
290
					case 'Login-Time' : 
290
					case 'Login-Time' : 
291
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
291
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
292
						break;
292
						break;
293
					case 'Expiration' :
293
					case 'Expiration' :
-
 
294
						if($login == "sms" && $user_type == 'group'){
-
 
295
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20 disabled></td>";
-
 
296
						} else {
294
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
297
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
298
						}
295
						break;
299
						break;
296
					case 'Max-All-Session' :
300
					case 'Max-All-Session' :
297
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
301
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
298
						break;
302
						break;
299
					case 'Session-Timeout' :
303
					case 'Session-Timeout' :
300
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
304
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
301
						break;
305
						break;
302
					case 'Max-Daily-Session' :
306
					case 'Max-Daily-Session' :
303
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
307
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
304
						break;
308
						break;
305
					case 'Max-Weekly-Session' :
309
					case 'Max-Weekly-Session' :
306
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
310
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
307
						break;
311
						break;
308
					case 'Max-Monthly-Session' :
312
					case 'Max-Monthly-Session' :
309
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
313
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
310
						break;
314
						break;
311
					case 'ChilliSpot-Max-Input-Octets' :
315
					case 'ChilliSpot-Max-Input-Octets' :
312
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
316
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
313
						break;
317
						break;
314
					case 'ChilliSpot-Max-Output-Octets' :
318
					case 'ChilliSpot-Max-Output-Octets' :
315
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
319
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
316
						break;
320
						break;
317
					case 'ChilliSpot-Max-Total-Octets' :
321
					case 'ChilliSpot-Max-Total-Octets' :
318
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
322
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
319
						break;
323
						break;
320
					case 'ChilliSpot-Bandwidth-Max-Up' :
324
					case 'ChilliSpot-Bandwidth-Max-Up' :
321
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
325
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
322
						break;
326
						break;
323
					case 'ChilliSpot-Bandwidth-Max-Down' :
327
					case 'ChilliSpot-Bandwidth-Max-Down' :
324
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
328
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
325
						break;
329
						break;
326
					case 'WISPr-Redirection-URL' :
330
					case 'WISPr-Redirection-URL' :
327
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
331
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
328
						break;
332
						break;
329
					case 'Filter-Id' :
333
					case 'Filter-Id' :
330
						switch($val)
334
						switch($val)
331
						{
335
						{
332
							case "00000001":
336
							case "00000001":
333
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option>$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>";
337
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option>$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>";
334
								break;
338
								break;
335
							case "00000011":
339
							case "00000011":
336
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option>$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>";
340
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option>$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>";
337
								break;
341
								break;
338
							case "00000101":
342
							case "00000101":
339
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option>$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>";
343
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option>$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>";
340
								break;
344
								break;
341
							default :
345
							default :
342
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option 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>";
346
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option 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>";
343
								break;
347
								break;
344
						}
348
						}
345
						break;
349
						break;
346
					default :
350
					default :
347
						print <<<EOM
351
						print <<<EOM
348
<td>
352
<td>
349
<select name=$oper_name>
353
<select name=$oper_name>
350
<option $selected[$op_eq] value="=">=
354
<option $selected[$op_eq] value="=">=
351
<option $selected[$op_set] value=":=">:=
355
<option $selected[$op_set] value=":=">:=
352
<option $selected[$op_add] value="+=">+=
356
<option $selected[$op_add] value="+=">+=
353
<option $selected[$op_eq2] value="==">==
357
<option $selected[$op_eq2] value="==">==
354
<option $selected[$op_ne] value="!=">!=
358
<option $selected[$op_ne] value="!=">!=
355
<option $selected[$op_gt] value=">">&gt;
359
<option $selected[$op_gt] value=">">&gt;
356
<option $selected[$op_ge] value=">=">&gt;=
360
<option $selected[$op_ge] value=">=">&gt;=
357
<option $selected[$op_lt] value="<">&lt;
361
<option $selected[$op_lt] value="<">&lt;
358
<option $selected[$op_le] value="<=">&lt;=
362
<option $selected[$op_le] value="<=">&lt;=
359
<option $selected[$op_regeq] value="=~">=~
363
<option $selected[$op_regeq] value="=~">=~
360
<option $selected[$op_regne] value="!~">!~
364
<option $selected[$op_regne] value="!~">!~
361
<option $selected[$op_exst] value="=*">=*
365
<option $selected[$op_exst] value="=*">=*
362
<option $selected[$op_nexst] value="!*">!*
366
<option $selected[$op_nexst] value="!*">!*
363
</select>
367
</select>
364
</td>
368
</td>
365
<td><input type=text name="$name1" value="$val" size=20></td>
369
<td><input type=text name="$name1" value="$val" size=20></td>
366
EOM;
370
EOM;
367
						break;
371
						break;
368
					}
372
					}
369
				}
373
				}
370
			print <<<EOM
374
			print <<<EOM
371
</tr>
375
</tr>
372
EOM;
376
EOM;
373
		}
377
		}
374
	}
378
	}
375
if ($user_type != 'group'){
379
if ($user_type != 'group'){
376
	echo <<<EOM
380
	echo <<<EOM
377
<tr>
381
<tr>
378
<td align=right colspan=$colspan bgcolor="#d0ddb0">
382
<td align=right colspan=$colspan bgcolor="#d0ddb0">
379
$l_group_member<br><font size=-2><i>($l_main_group)</i></font>
383
$l_group_member<br><font size=-2><i>($l_main_group)</i></font>
380
</td>
384
</td>
381
<td>
385
<td>
382
EOM;
386
EOM;
383
if (isset($member_groups)){
387
if (isset($member_groups)){
384
	echo "<select size=5 name=\"edited_groups[]\" multiple OnChange=\"this.form.group_change.value=1\">";
388
	echo "<select size=5 name=\"edited_groups[]\" multiple OnChange=\"this.form.group_change.value=1\">";
385
	if ($config[sql_show_all_groups] == 'true'){
389
	if ($config[sql_show_all_groups] == 'true'){
386
		foreach ($existing_groups as $group => $count){
390
		foreach ($existing_groups as $group => $count){
387
			if ($member_groups[$group] == $group)
391
			if ($member_groups[$group] == $group)
388
				echo "<option selected value=\"$group\">$group\n";
392
				echo "<option selected value=\"$group\">$group\n";
389
			else
393
			else
390
				echo "<option value=\"$group\">$group\n";
394
				echo "<option value=\"$group\">$group\n";
391
			}
395
			}
392
		}else{
396
		}else{
393
		foreach ($member_groups as $group)
397
		foreach ($member_groups as $group)
394
			echo "<option value=\"$group\">$group\n";
398
			echo "<option value=\"$group\">$group\n";
395
		}
399
		}
396
		echo "</select></td></tr>";
400
		echo "</select></td></tr>";
397
	}
401
	}
398
	else{
402
	else{
399
		echo "aucun group</td></tr>";
403
		echo "aucun group</td></tr>";
400
	}
404
	}
401
} 
405
} 
402
echo "</table><br>";
406
echo "</table><br>";
403
echo "<input type=submit class=button value=$l_change OnClick=\"this.form.change.value=1\">";
407
echo "<input type=submit class=button value=$l_change OnClick=\"this.form.change.value=1\">";
404
//if ($user_type != 'group'){
408
//if ($user_type != 'group'){
405
//	echo <<<EOM
409
//	echo <<<EOM
406
//<br><br>
410
//<br><br>
407
//<input type=submit class=button value="Add to Badusers" OnClick="this.form.badusers.value=1">
411
//<input type=submit class=button value="Add to Badusers" OnClick="this.form.badusers.value=1">
408
//<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>
412
//<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>
409
//EOM;
413
//EOM;
410
//}
414
//}
411
?>
415
?>
412
</form>
416
</form>
413
</td></tr>
417
</td></tr>
414
</table>
418
</table>
415
</tr>
419
</tr>
416
</table>
420
</table>
417
</td></tr>
421
</td></tr>
418
</TABLE>
422
</TABLE>
419
</body>
423
</body>
420
</html>
424
</html>
421
 
425