Subversion Repositories ALCASAR

Rev

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

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