Subversion Repositories ALCASAR

Rev

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

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