Subversion Repositories ALCASAR

Rev

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

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