Subversion Repositories ALCASAR

Rev

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

Rev 2653 Rev 2654
1
<?php
1
<?php
2
# $Id: group_new.php 2653 2018-11-04 02:05:54Z tom.houdayer $
2
# $Id: group_new.php 2654 2018-11-04 02:11:25Z tom.houdayer $
3
 
3
 
4
//Gestion de la langue
4
//Gestion de la langue
5
if (is_file("../lib/langues.php"))
5
if (is_file("../lib/langues.php"))
6
	include("../lib/langues.php");
6
	include("../lib/langues.php");
7
 
7
 
8
// Update Alcasar-Status-Page-Must-Stay-Open
8
// Update Alcasar-Status-Page-Must-Stay-Open
9
if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open'] === '2')) {
9
if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open'] === '2')) {
10
	$_POST['Idle-Timeout'] = '600'; // 10 minutes
10
	$_POST['Idle-Timeout'] = '600'; // 10 minutes
11
} else {
11
} else {
12
	$_POST['Idle-Timeout'] = '';
12
	$_POST['Idle-Timeout'] = '';
13
}
13
}
14
$_POST['Idle-Timeout_op'] = '=';
14
$_POST['Idle-Timeout_op'] = '=';
15
 
15
 
16
require('/etc/freeradius-web/config.php');
16
require('/etc/freeradius-web/config.php');
17
 
17
 
18
if (!isset ($create)) $create=0;
18
if (!isset ($create)) $create=0;
19
if (!isset ($login)) $login='';
19
if (!isset ($login)) $login='';
20
if (!isset ($selected)) $selected=array();
20
if (!isset ($selected)) $selected=array();
21
 
21
 
22
require('../lib/attrshow.php');
22
require('../lib/attrshow.php');
23
require('../lib/defaults.php');
23
require('../lib/defaults.php');
24
require("../lib/$config[general_lib_type]/group_info.php");
24
require("../lib/$config[general_lib_type]/group_info.php");
25
 
25
 
26
if ($config['general_lib_type'] != 'sql'){
26
if ($config['general_lib_type'] != 'sql'){
27
	echo <<<EOM
27
	echo <<<EOM
28
<title>$l_title</title>
28
<title>$l_title</title>
29
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
29
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
30
<link rel="stylesheet" href="style.css">
30
<link rel="stylesheet" href="style.css">
31
</head>
31
</head>
32
<body>
32
<body>
33
<center>
33
<center>
34
<b>This page is only available if you are using sql as general library type</b>
34
<b>This page is only available if you are using sql as general library type</b>
35
</body>
35
</body>
36
</html>
36
</html>
37
EOM;
37
EOM;
38
        exit();
38
        exit();
39
}
39
}
40
 
40
 
41
 
41
 
42
if (false && /* Hide operator column */ $config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){
42
if (false && /* Hide operator column */ $config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){
43
	$colspan=2;
43
	$colspan=2;
44
	$show_ops=1;
44
	$show_ops=1;
45
	include_once("../lib/operators.php");
45
	include_once("../lib/operators.php");
46
	if(!isset($selected[$op_eq])) $selected[$op_eq] = '';
46
	if(!isset($selected[$op_eq])) $selected[$op_eq] = '';
47
}else{
47
}else{
48
	$show_ops = 0;
48
	$show_ops = 0;
49
	$colspan=1;
49
	$colspan=1;
50
}
50
}
51
?>
51
?>
52
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
52
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
53
<html><head><title>New group</title>
53
<html><head><title>New group</title>
54
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>">
54
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>">
55
<link rel="stylesheet" href="/css/jquery-ui.min.css">
55
<link rel="stylesheet" href="/css/jquery-ui.min.css">
56
<link rel="stylesheet" href="/css/style.css">
56
<link rel="stylesheet" href="/css/style.css">
57
<link rel="stylesheet" type="text/css" href="/css/epoch_styles.css" />
57
<link rel="stylesheet" type="text/css" href="/css/epoch_styles.css" />
58
<script type="text/javascript" src="/js/epoch_classes.js"></script>
58
<script type="text/javascript" src="/js/epoch_classes.js"></script>
59
<script type="text/javascript" src="/js/fonctions.js"></script>
59
<script type="text/javascript" src="/js/fonctions.js"></script>
60
<script language="javascript" type="text/javascript">
60
<script language="javascript" type="text/javascript">
61
/*Insertion du calendrier*/
61
/*Insertion du calendrier*/
62
	var dp_cal;
62
	var dp_cal;
63
window.onload = function () {
63
window.onload = function () {
64
	dp_cal  = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
64
	dp_cal  = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
65
};
65
};
66
/*Fin calendrier*/
66
/*Fin calendrier*/
67
</script>
67
</script>
68
<script type="text/javascript">
68
<script type="text/javascript">
69
	function showAdvancedFields(show) {
69
	function showAdvancedFields(show) {
70
		var form = document.forms['newgroup'];
70
		var form = document.forms['newgroup'];
71
		var btn_show = document.getElementById('show-advanced-fields');
71
		var btn_show = document.getElementById('show-advanced-fields');
72
		var btn_hide = document.getElementById('hide-advanced-fields');
72
		var btn_hide = document.getElementById('hide-advanced-fields');
73
 
73
 
74
		if (show) {
74
		if (show) {
75
			btn_hide.style.display = null;
75
			btn_hide.style.display = null;
76
			btn_show.style.display = 'none';
76
			btn_show.style.display = 'none';
77
			form.className += ' hide-advanced-fields';
77
			form.className += ' hide-advanced-fields';
78
		} else {
78
		} else {
79
			btn_show.style.display = null;
79
			btn_show.style.display = null;
80
			btn_hide.style.display = 'none';
80
			btn_hide.style.display = 'none';
81
			form.className = form.className.replace(' hide-advanced-fields', '');
81
			form.className = form.className.replace(' hide-advanced-fields', '');
82
 
82
 
83
		}
83
		}
84
	}
84
	}
85
</script>
85
</script>
86
<style type="text/css">
86
<style type="text/css">
87
	.hide-advanced-fields .advanced-field {
87
	.hide-advanced-fields .advanced-field {
88
		display: none;
88
		display: none;
89
	}
89
	}
90
</style>
90
</style>
91
</head>
91
</head>
92
<body>
92
<body>
93
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
93
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
94
	<tr><th><? echo "$l_groups_managment"; ?></th></tr>
94
	<tr><th><? echo "$l_groups_managment"; ?></th></tr>
95
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
95
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
96
height="2"></td></tr>
96
height="2"></td></tr>
97
</TABLE>
97
</TABLE>
98
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
98
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
99
	<tr bgcolor="#666666"><td>
99
	<tr bgcolor="#666666"><td>
100
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
100
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
101
		<tr><td valign="middle" align="left">
101
		<tr><td valign="middle" align="left">
102
<center>
102
<center>
103
<table border=0 width=750 cellpadding=1 cellspacing=1>
103
<table border=0 width=750 cellpadding=1 cellspacing=1>
104
<tr valign=top>
104
<tr valign=top>
105
<td width=340></td>
105
<td width=340></td>
106
<td bgcolor="black" width=200>
106
<td bgcolor="black" width=200>
107
	<table border=0 width=100% cellpadding=2 cellspacing=0>
107
	<table border=0 width=100% cellpadding=2 cellspacing=0>
108
	<tr bgcolor="#907030" align=right valign=top><th>
108
	<tr bgcolor="#907030" align=right valign=top><th>
109
	<font color="white"><? echo "$l_group_create"; ?></font>
109
	<font color="white"><? echo "$l_group_create"; ?></font>
110
	</th></tr>
110
	</th></tr>
111
	</table>
111
	</table>
112
</td></tr>
112
</td></tr>
113
<tr bgcolor="black" valign=top><td colspan=2>
113
<tr bgcolor="black" valign=top><td colspan=2>
114
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
114
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
115
	<tr><td>
115
	<tr><td>
116
 
116
 
117
<?php
117
<?php
118
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
118
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
119
	include("../lib/$config[general_lib_type]/group_info.php");
119
	include("../lib/$config[general_lib_type]/group_info.php");
120
if ($create == 1){
120
if ($create == 1){
121
	if ($group_exists != "no"){
121
	if ($group_exists != "no"){
122
		echo <<<EOM
122
		echo <<<EOM
123
<b><i>$login</i> $l_already_exist</b>
123
<b><i>$login</i> $l_already_exist</b>
124
EOM;
124
EOM;
125
	}
125
	}
126
	else{
126
	else{
-
 
127
		$Members = preg_split("/[\n\s]+/",$members,-1,PREG_SPLIT_NO_EMPTY);
-
 
128
		$group_macs = [];
-
 
129
		if (!empty($Members)){
-
 
130
			foreach ($Members as $member){
-
 
131
				$mac = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($5 == 1) && ($6 == "'.$member.'") {print $1}'));
-
 
132
				if (!empty($mac)) {
-
 
133
					exec('sudo /usr/sbin/chilli_query logout mac '.escapeshellarg($mac));
-
 
134
					if ($member === $mac) {
-
 
135
						$group_macs[] = $mac;
-
 
136
					}
-
 
137
				}
-
 
138
			}
-
 
139
		}
-
 
140
 
127
		if (is_file("../lib/$config[general_lib_type]/create_group.php"))
141
		if (is_file("../lib/$config[general_lib_type]/create_group.php"))
128
			include("../lib/$config[general_lib_type]/create_group.php");
142
			include("../lib/$config[general_lib_type]/create_group.php");
129
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
143
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
130
			include("../lib/$config[general_lib_type]/group_info.php");
144
			include("../lib/$config[general_lib_type]/group_info.php");
-
 
145
 
-
 
146
		// Reconnect allowed MAC from the selected group
-
 
147
		foreach ($group_macs as $mac) {
-
 
148
			exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
-
 
149
		}
131
	}
150
	}
132
}
151
}
133
if ($create == 0){
152
if ($create == 0){
134
?>
153
?>
135
   <form name="newgroup" method="post" class="">
154
   <form name="newgroup" method="post" class="">
136
      <input type="hidden" name="create" value="0">
155
      <input type="hidden" name="create" value="0">
137
      <input type="hidden" name="show" value="0">
156
      <input type="hidden" name="show" value="0">
138
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
157
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
139
<?php
158
<?php
140
	echo <<<EOM
159
	echo <<<EOM
141
	<tr>
160
	<tr>
142
		<td class="etiquette" colspan=$colspan>
161
		<td class="etiquette" colspan=$colspan>
143
		$l_created_groups
162
		$l_created_groups
144
		</td><td>
163
		</td><td>
145
EOM;
164
EOM;
146
		if (!isset($existing_groups))
165
		if (!isset($existing_groups))
147
			echo "<b>$l_group_empty</b>\n";
166
			echo "<b>$l_group_empty</b>\n";
148
		else{
167
		else{
149
			echo "<select name=\"existing_groups\">\n";
168
			echo "<select name=\"existing_groups\">\n";
150
			foreach ($existing_groups as $group => $count)
169
			foreach ($existing_groups as $group => $count)
151
				echo "<option value=\"$group\">$group\n";
170
				echo "<option value=\"$group\">$group\n";
152
			echo "</select>\n";
171
			echo "</select>\n";
153
		}
172
		}
154
	echo <<<EOM
173
	echo <<<EOM
155
		</td>
174
		</td>
156
	</tr>
175
	</tr>
157
	<tr>
176
	<tr>
158
		<td class="etiquette" colspan=$colspan>
177
		<td class="etiquette" colspan=$colspan>
159
		$l_group_name
178
		$l_group_name
160
		</td><td>
179
		</td><td>
161
		<input type=text name="login" value="$login" size=35>
180
		<input type=text name="login" value="$login" size=35>
162
		</td>
181
		</td>
163
	</tr>
182
	</tr>
164
	<tr>
183
	<tr>
165
		<td class="etiquette" colspan=$colspan>
184
		<td class="etiquette" colspan=$colspan>
166
		$l_group_members
185
		$l_group_members
167
		</td><td>
186
		</td><td>
168
		<textarea name=members cols="50" wrap="PHYSICAL" rows=5></textarea>
187
		<textarea name=members cols="50" wrap="PHYSICAL" rows=5></textarea>
169
		</td>
188
		</td>
170
	</tr>
189
	</tr>
171
 
190
 
172
EOM;
191
EOM;
173
	foreach($show_attrs as $key => $desc){
192
	foreach($show_attrs as $key => $desc){
174
		if ($key === 'Idle-Timeout') continue;
193
		if ($key === 'Idle-Timeout') continue;
175
		$name = $attrmap["$key"];
194
		$name = $attrmap["$key"];
176
		if ($name == 'none')
195
		if ($name == 'none')
177
			continue;
196
			continue;
178
		$oper_name = $name . '_op';
197
		$oper_name = $name . '_op';
179
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){
198
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){
180
			$val = $item_vals["$key"][0];
199
			$val = $item_vals["$key"][0];
181
		} else if(isset($default_vals["$key"][0])) {
200
		} else if(isset($default_vals["$key"][0])) {
182
			$val = $default_vals["$key"][0];
201
			$val = $default_vals["$key"][0];
183
		} else {
202
		} else {
184
			$val = '';
203
			$val = '';
185
		}
204
		}
186
		switch ($key)
205
		switch ($key)
187
		{
206
		{
188
		// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
207
		// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
189
			case 'Simultaneous-Use' :
208
			case 'Simultaneous-Use' :
190
				$advanced = false;
209
				$advanced = false;
191
				$help_link = "help/simultaneous_use_help.html";
210
				$help_link = "help/simultaneous_use_help.html";
192
				$desc = $l_simultaneous_use;
211
				$desc = $l_simultaneous_use;
193
				break;
212
				break;
194
			case 'Max-All-Session' :
213
			case 'Max-All-Session' :
195
				$advanced = true;
214
				$advanced = true;
196
				$help_link = "help/max_all_session_help.html";
215
				$help_link = "help/max_all_session_help.html";
197
				$desc = $l_max_all_session;
216
				$desc = $l_max_all_session;
198
				break;
217
				break;
199
			case 'Session-Timeout' :
218
			case 'Session-Timeout' :
200
				$advanced = true;
219
				$advanced = true;
201
				$help_link = "help/session_timeout_help.html";
220
				$help_link = "help/session_timeout_help.html";
202
				$desc = $l_session_timeout;
221
				$desc = $l_session_timeout;
203
				break;
222
				break;
204
			case 'Max-Daily-Session' :
223
			case 'Max-Daily-Session' :
205
				$advanced = true;
224
				$advanced = true;
206
				$help_link = "help/session_timeout_help.html";
225
				$help_link = "help/session_timeout_help.html";
207
				$desc = $l_daily_timeout;
226
				$desc = $l_daily_timeout;
208
				break;
227
				break;
209
			case 'Max-Monthly-Session' :
228
			case 'Max-Monthly-Session' :
210
				$advanced = true;
229
				$advanced = true;
211
				$help_link = "help/session_timeout_help.html";
230
				$help_link = "help/session_timeout_help.html";
212
				$desc = $l_monthly_timeout;
231
				$desc = $l_monthly_timeout;
213
				break;
232
				break;
214
			case 'Login-Time' :
233
			case 'Login-Time' :
215
				$advanced = true;
234
				$advanced = true;
216
				$help_link = "help/login_time_help.html";
235
				$help_link = "help/login_time_help.html";
217
				$desc = $l_login_time;
236
				$desc = $l_login_time;
218
				break;
237
				break;
219
			case 'Expiration' :
238
			case 'Expiration' :
220
				$advanced = false;
239
				$advanced = false;
221
				$help_link = "help/expiration_help.html";
240
				$help_link = "help/expiration_help.html";
222
				$desc = $l_expiration;
241
				$desc = $l_expiration;
223
				break;
242
				break;
224
			case 'CoovaChilli-Max-Input-Octets' :
243
			case 'CoovaChilli-Max-Input-Octets' :
225
				$advanced = true;
244
				$advanced = true;
226
				$help_link = "help/coovachilli_max_input_octets_help.html";
245
				$help_link = "help/coovachilli_max_input_octets_help.html";
227
				$desc = $l_max_input_octets;
246
				$desc = $l_max_input_octets;
228
				break;
247
				break;
229
			case 'CoovaChilli-Max-Output-Octets' :
248
			case 'CoovaChilli-Max-Output-Octets' :
230
				$advanced = true;
249
				$advanced = true;
231
				$help_link = "help/coovachilli_max_output_octets_help.html";
250
				$help_link = "help/coovachilli_max_output_octets_help.html";
232
				$desc = $l_max_output_octets;
251
				$desc = $l_max_output_octets;
233
				break;
252
				break;
234
			case 'CoovaChilli-Max-Total-Octets' :
253
			case 'CoovaChilli-Max-Total-Octets' :
235
				$advanced = true;
254
				$advanced = true;
236
				$help_link = "help/coovachilli_max_total_octets_help.html";
255
				$help_link = "help/coovachilli_max_total_octets_help.html";
237
				$desc = $l_max_total_octets;
256
				$desc = $l_max_total_octets;
238
				break;
257
				break;
239
			case 'CoovaChilli-Max-Total-Octets-Daily' :
258
			case 'CoovaChilli-Max-Total-Octets-Daily' :
240
				$advanced = true;
259
				$advanced = true;
241
				$help_link = "help/coovachilli_max_total_octets_help.html";
260
				$help_link = "help/coovachilli_max_total_octets_help.html";
242
				$desc = $l_max_total_octets_daily;
261
				$desc = $l_max_total_octets_daily;
243
				break;
262
				break;
244
			case 'CoovaChilli-Max-Total-Octets-Monthly' :
263
			case 'CoovaChilli-Max-Total-Octets-Monthly' :
245
				$advanced = true;
264
				$advanced = true;
246
				$help_link = "help/coovachilli_max_total_octets_help.html";
265
				$help_link = "help/coovachilli_max_total_octets_help.html";
247
				$desc = $l_max_total_octets_monthly;
266
				$desc = $l_max_total_octets_monthly;
248
				break;
267
				break;
249
			case 'CoovaChilli-Bandwidth-Max-Up' :
268
			case 'CoovaChilli-Bandwidth-Max-Up' :
250
				$advanced = true;
269
				$advanced = true;
251
				$help_link = "help/coovachilli_bandwidth_max_up_help.html";
270
				$help_link = "help/coovachilli_bandwidth_max_up_help.html";
252
				$desc = $l_max_bandwidth_up;
271
				$desc = $l_max_bandwidth_up;
253
				break;
272
				break;
254
			case 'CoovaChilli-Bandwidth-Max-Down' :
273
			case 'CoovaChilli-Bandwidth-Max-Down' :
255
				$advanced = true;
274
				$advanced = true;
256
				$help_link = "help/coovachilli_bandwidth_max_down_help.html";
275
				$help_link = "help/coovachilli_bandwidth_max_down_help.html";
257
				$desc = $l_max_bandwidth_down;
276
				$desc = $l_max_bandwidth_down;
258
				break;
277
				break;
259
			case 'WISPr-Redirection-URL' :
278
			case 'WISPr-Redirection-URL' :
260
				$advanced = true;
279
				$advanced = true;
261
				$help_link = "help/wispr_redirection_url_help.html";
280
				$help_link = "help/wispr_redirection_url_help.html";
262
				$desc = $l_wispr_redirection;
281
				$desc = $l_wispr_redirection;
263
				break;
282
				break;
264
			case 'Alcasar-Filter' :
283
			case 'Alcasar-Filter' :
265
				$advanced = false;
284
				$advanced = false;
266
				$help_link = "help/filtering_help.html";
285
				$help_link = "help/filtering_help.html";
267
				$desc = $l_filtering;
286
				$desc = $l_filtering;
268
				break;
287
				break;
269
			case 'Alcasar-Protocols-Filter' :
288
			case 'Alcasar-Protocols-Filter' :
270
				$advanced = false;
289
				$advanced = false;
271
				$help_link = "help/protocols_help.html";
290
				$help_link = "help/protocols_help.html";
272
				$desc = $l_proto;
291
				$desc = $l_proto;
273
				break;
292
				break;
274
			case 'Alcasar-Status-Page-Must-Stay-Open' :
293
			case 'Alcasar-Status-Page-Must-Stay-Open' :
275
				$advanced = false;
294
				$advanced = false;
276
				$help_link = "help/statusOpenRequired_help.html";
295
				$help_link = "help/statusOpenRequired_help.html";
277
				$desc = $l_statusOpenRequired;
296
				$desc = $l_statusOpenRequired;
278
				break;
297
				break;
279
			case 'Alcasar-Expire-After' :
298
			case 'Alcasar-Expire-After' :
280
				$advanced = true;
299
				$advanced = true;
281
				$help_link = "help/expire_after_help.html";
300
				$help_link = "help/expire_after_help.html";
282
				$desc = $l_expire_after;
301
				$desc = $l_expire_after;
283
				break;
302
				break;
284
			default:
303
			default:
285
				$advanced = true;
304
				$advanced = true;
286
				break;
305
				break;
287
		}
306
		}
288
 
307
 
289
		$advancedField = ($advanced) ? ' class="advanced-field"' : '';
308
		$advancedField = ($advanced) ? ' class="advanced-field"' : '';
290
 
309
 
291
		if ($show_ops){
310
		if ($show_ops){
292
		print <<<EOM
311
		print <<<EOM
293
			<tr$advancedField>
312
			<tr$advancedField>
294
			<td class="etiquette">
313
			<td class="etiquette">
295
			<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>
314
			<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>
296
			</td>
315
			</td>
297
EOM;
316
EOM;
298
			switch ($key) {
317
			switch ($key) {
299
				case 'Simultaneous-Use' :
318
				case 'Simultaneous-Use' :
300
				case 'Max-All-Session' :
319
				case 'Max-All-Session' :
301
				case 'Max-Daily-Session' :
320
				case 'Max-Daily-Session' :
302
				case 'Max-Weekly-Session' :
321
				case 'Max-Weekly-Session' :
303
				case 'Max-Monthly-Session' :
322
				case 'Max-Monthly-Session' :
304
				case 'Login-Time' :
323
				case 'Login-Time' :
305
				case 'Expiration' :
324
				case 'Expiration' :
306
				case 'Alcasar-Expire-After' :
325
				case 'Alcasar-Expire-After' :
307
				case 'CoovaChilli-Max-Total-Octets-Daily' :
326
				case 'CoovaChilli-Max-Total-Octets-Daily' :
308
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
327
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
309
				case 'CoovaChilli-Max-Total-Octets' :
328
				case 'CoovaChilli-Max-Total-Octets' :
310
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=";
329
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=";
311
					break;
330
					break;
312
				case 'Session-Timeout' :
331
				case 'Session-Timeout' :
313
				case 'CoovaChilli-Max-Input-Octets' :
332
				case 'CoovaChilli-Max-Input-Octets' :
314
				case 'CoovaChilli-Max-Output-Octets' :
333
				case 'CoovaChilli-Max-Output-Octets' :
315
				case 'CoovaChilli-Bandwidth-Max-Up' :
334
				case 'CoovaChilli-Bandwidth-Max-Up' :
316
				case 'CoovaChilli-Bandwidth-Max-Down' :
335
				case 'CoovaChilli-Bandwidth-Max-Down' :
317
				case 'WISPr-Redirection-URL' :
336
				case 'WISPr-Redirection-URL' :
318
				case 'Alcasar-Filter' :
337
				case 'Alcasar-Filter' :
319
				case 'Alcasar-Protocols-Filter' :
338
				case 'Alcasar-Protocols-Filter' :
320
				case 'Alcasar-Status-Page-Must-Stay-Open' :
339
				case 'Alcasar-Status-Page-Must-Stay-Open' :
321
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=";
340
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=";
322
					break;
341
					break;
323
				default :
342
				default :
324
					print <<<EOM
343
					print <<<EOM
325
					<td>
344
					<td>
326
						<select name=\"$oper_name\">
345
						<select name=\"$oper_name\">
327
							<option $selected[$op_eq] value="=">=
346
							<option $selected[$op_eq] value="=">=
328
							<option $selected[$op_set] value=":=">:=
347
							<option $selected[$op_set] value=":=">:=
329
							<option $selected[$op_add] value="+=">+=
348
							<option $selected[$op_add] value="+=">+=
330
							<option $selected[$op_eq2] value="==">==
349
							<option $selected[$op_eq2] value="==">==
331
							<option $selected[$op_ne] value="!=">!=
350
							<option $selected[$op_ne] value="!=">!=
332
							<option $selected[$op_gt] value=">">&gt;
351
							<option $selected[$op_gt] value=">">&gt;
333
							<option $selected[$op_ge] value=">=">&gt;=
352
							<option $selected[$op_ge] value=">=">&gt;=
334
							<option $selected[$op_lt] value="<">&lt;
353
							<option $selected[$op_lt] value="<">&lt;
335
							<option $selected[$op_le] value="<=">&lt;=
354
							<option $selected[$op_le] value="<=">&lt;=
336
							<option $selected[$op_regeq] value="=~">=~
355
							<option $selected[$op_regeq] value="=~">=~
337
							<option $selected[$op_regne] value="!~">!~
356
							<option $selected[$op_regne] value="!~">!~
338
							<option $selected[$op_exst] value="=*">=*
357
							<option $selected[$op_exst] value="=*">=*
339
							<option $selected[$op_nexst] value="!*">!*
358
							<option $selected[$op_nexst] value="!*">!*
340
						</select>
359
						</select>
341
					</td>
360
					</td>
342
EOM;
361
EOM;
343
					break;
362
					break;
344
			}
363
			}
345
		} else {
364
		} else {
346
			print <<<EOM
365
			print <<<EOM
347
				<tr$advancedField>
366
				<tr$advancedField>
348
				<td class="etiquette" colspan="$colspan">
367
				<td class="etiquette" colspan="$colspan">
349
				<a href="$help_link" target="help" onclick="window.open('$help_link','help','width=600,height=350,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$desc</font></a>
368
				<a href="$help_link" target="help" onclick="window.open('$help_link','help','width=600,height=350,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$desc</font></a>
350
EOM;
369
EOM;
351
			switch ($key) {
370
			switch ($key) {
352
				case 'Simultaneous-Use' :
371
				case 'Simultaneous-Use' :
353
				case 'Max-All-Session' :
372
				case 'Max-All-Session' :
354
				case 'Max-Daily-Session' :
373
				case 'Max-Daily-Session' :
355
				case 'Max-Weekly-Session' :
374
				case 'Max-Weekly-Session' :
356
				case 'Max-Monthly-Session' :
375
				case 'Max-Monthly-Session' :
357
				case 'Login-Time' :
376
				case 'Login-Time' :
358
				case 'Expiration' :
377
				case 'Expiration' :
359
				case 'Alcasar-Filter' :
378
				case 'Alcasar-Filter' :
360
				case 'Alcasar-Protocols-Filter' :
379
				case 'Alcasar-Protocols-Filter' :
361
				case 'Alcasar-Status-Page-Must-Stay-Open' :
380
				case 'Alcasar-Status-Page-Must-Stay-Open' :
362
				case 'Alcasar-Expire-After' :
381
				case 'Alcasar-Expire-After' :
363
				case 'CoovaChilli-Max-Total-Octets-Daily' :
382
				case 'CoovaChilli-Max-Total-Octets-Daily' :
364
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
383
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
365
				case 'CoovaChilli-Max-Total-Octets' :
384
				case 'CoovaChilli-Max-Total-Octets' :
366
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
385
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
367
					break;
386
					break;
368
				case 'Session-Timeout' :
387
				case 'Session-Timeout' :
369
				case 'CoovaChilli-Max-Input-Octets' :
388
				case 'CoovaChilli-Max-Input-Octets' :
370
				case 'CoovaChilli-Max-Output-Octets' :
389
				case 'CoovaChilli-Max-Output-Octets' :
371
				case 'CoovaChilli-Bandwidth-Max-Up' :
390
				case 'CoovaChilli-Bandwidth-Max-Up' :
372
				case 'CoovaChilli-Bandwidth-Max-Down' :
391
				case 'CoovaChilli-Bandwidth-Max-Down' :
373
				case 'WISPr-Redirection-URL' :
392
				case 'WISPr-Redirection-URL' :
374
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
393
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
375
					break;
394
					break;
376
				default :
395
				default :
377
					print <<<EOM
396
					print <<<EOM
378
						<select name=\"$oper_name\">
397
						<select name=\"$oper_name\">
379
							<option $selected[$op_eq] value="=">=</option>
398
							<option $selected[$op_eq] value="=">=</option>
380
							<option $selected[$op_set] value=":=">:=</option>
399
							<option $selected[$op_set] value=":=">:=</option>
381
							<option $selected[$op_add] value="+=">+=</option>
400
							<option $selected[$op_add] value="+=">+=</option>
382
							<option $selected[$op_eq2] value="==">==</option>
401
							<option $selected[$op_eq2] value="==">==</option>
383
							<option $selected[$op_ne] value="!=">!=</option>
402
							<option $selected[$op_ne] value="!=">!=</option>
384
							<option $selected[$op_gt] value=">">&gt;</option>
403
							<option $selected[$op_gt] value=">">&gt;</option>
385
							<option $selected[$op_ge] value=">=">&gt;=</option>
404
							<option $selected[$op_ge] value=">=">&gt;=</option>
386
							<option $selected[$op_lt] value="<">&lt;</option>
405
							<option $selected[$op_lt] value="<">&lt;</option>
387
							<option $selected[$op_le] value="<=">&lt;=</option>
406
							<option $selected[$op_le] value="<=">&lt;=</option>
388
							<option $selected[$op_regeq] value="=~">=~</option>
407
							<option $selected[$op_regeq] value="=~">=~</option>
389
							<option $selected[$op_regne] value="!~">!~</option>
408
							<option $selected[$op_regne] value="!~">!~</option>
390
							<option $selected[$op_exst] value="=*">=*</option>
409
							<option $selected[$op_exst] value="=*">=*</option>
391
							<option $selected[$op_nexst] value="!*">!*</option>
410
							<option $selected[$op_nexst] value="!*">!*</option>
392
						</select>
411
						</select>
393
EOM;
412
EOM;
394
					break;
413
					break;
395
			}
414
			}
396
			echo '</td>';
415
			echo '</td>';
397
		}
416
		}
398
 
417
 
399
/*
418
/*
400
Ajout du choix d'unité (pour les durées limites de session, journée et de mois)
419
Ajout du choix d'unité (pour les durées limites de session, journée et de mois)
401
et d'un calendrier pour la date d'expiration
420
et d'un calendrier pour la date d'expiration
402
Sauf dans le cas de la visualisation
421
Sauf dans le cas de la visualisation
403
*/
422
*/
404
	echo '<td>';
423
	echo '<td>';
405
	if ($create == 0) {
424
	if ($create == 0) {
406
		switch ($name){
425
		switch ($name){
407
			/*
426
			/*
408
			Choix de l'unité jour, heures, minutes ou secondes
427
			Choix de l'unité jour, heures, minutes ou secondes
409
			pour les durées limites max, de session,de journée et de mois
428
			pour les durées limites max, de session,de journée et de mois
410
			*/
429
			*/
411
			case 'Session-Timeout' :
430
			case 'Session-Timeout' :
412
			case 'Max-Daily-Session' :
431
			case 'Max-Daily-Session' :
413
				/*valeur d'origine de durée limite */
432
				/*valeur d'origine de durée limite */
414
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
433
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
415
				/* Choix d'unité*/
434
				/* Choix d'unité*/
416
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
435
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
417
						<option value=\"s\" selected>s</option>
436
						<option value=\"s\" selected>s</option>
418
						<option value=\"m\" >m</option>
437
						<option value=\"m\" >m</option>
419
						<option value=\"H\" >H</option>
438
						<option value=\"H\" >H</option>
420
					</select>";
439
					</select>";
421
				break;
440
				break;
422
			case 'Max-Monthly-Session' :
441
			case 'Max-Monthly-Session' :
423
			case 'Max-All-Session' :
442
			case 'Max-All-Session' :
424
			case 'Alcasar-Expire-After' :
443
			case 'Alcasar-Expire-After' :
425
				/*valeur d'origine de durée limite */
444
				/*valeur d'origine de durée limite */
426
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
445
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
427
				/* Choix d'unité*/
446
				/* Choix d'unité*/
428
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
447
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
429
						<option value=\"s\" selected>s</option>
448
						<option value=\"s\" selected>s</option>
430
						<option value=\"m\" >m</option>
449
						<option value=\"m\" >m</option>
431
						<option value=\"H\" >H</option>
450
						<option value=\"H\" >H</option>
432
						<option value=\"J\" >J</option>
451
						<option value=\"J\" >J</option>
433
					</select>";
452
					</select>";
434
				break;
453
				break;
435
			case 'Expiration' :
454
			case 'Expiration' :
436
				/*Ajout du calendrier pour choisir la date*/
455
				/*Ajout du calendrier pour choisir la date*/
437
				echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
456
				echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
438
				break;
457
				break;
439
			case 'Alcasar-Filter' :
458
			case 'Alcasar-Filter' :
440
				echo "<select name=\"$name\">";
459
				echo "<select name=\"$name\">";
441
				echo "<option value=\"\"></option>";
460
				echo "<option value=\"\"></option>";
442
				echo "<option value=\"1\">$l_filtering_none</option>";
461
				echo "<option value=\"1\">$l_filtering_none</option>";
443
				echo "<option value=\"2\">$l_filtering_havp</option>";
462
				echo "<option value=\"2\">$l_filtering_havp</option>";
444
				echo "<option value=\"3\">$l_filtering_havp_bl</option>";
463
				echo "<option value=\"3\">$l_filtering_havp_bl</option>";
445
				echo "<option value=\"4\">$l_filtering_havp_wl</option>";
464
				echo "<option value=\"4\">$l_filtering_havp_wl</option>";
446
				echo "</select>";
465
				echo "</select>";
447
				break;
466
				break;
448
			case 'Alcasar-Protocols-Filter' :
467
			case 'Alcasar-Protocols-Filter' :
449
				echo "<select name=\"$name\">";
468
				echo "<select name=\"$name\">";
450
				echo "<option value=\"\"></option>";
469
				echo "<option value=\"\"></option>";
451
				echo "<option value=\"1\">$l_proto_0</option>";
470
				echo "<option value=\"1\">$l_proto_0</option>";
452
				echo "<option value=\"2\">$l_proto_1</option>";
471
				echo "<option value=\"2\">$l_proto_1</option>";
453
				echo "<option value=\"3\">$l_proto_2</option>";
472
				echo "<option value=\"3\">$l_proto_2</option>";
454
				echo "<option value=\"4\">$l_proto_3</option>";
473
				echo "<option value=\"4\">$l_proto_3</option>";
455
				echo "</select>";
474
				echo "</select>";
456
				break;
475
				break;
457
			case 'Alcasar-Status-Page-Must-Stay-Open' :
476
			case 'Alcasar-Status-Page-Must-Stay-Open' :
458
				echo "<select name=\"$name\">";
477
				echo "<select name=\"$name\">";
459
				echo "<option value=\"\"></option>";
478
				echo "<option value=\"\"></option>";
460
				echo "<option value=\"1\">$l_yes</option>";
479
				echo "<option value=\"1\">$l_yes</option>";
461
				echo "<option value=\"2\">$l_no</option>";
480
				echo "<option value=\"2\">$l_no</option>";
462
				echo "</select>";
481
				echo "</select>";
463
				break;
482
				break;
464
			case 'Login-Time':
483
			case 'Login-Time':
465
				echo "<input type=\"text\" name=\"$name\" id=\"$name\" value=\"$val\" size=\"20\">";
484
				echo "<input type=\"text\" name=\"$name\" id=\"$name\" value=\"$val\" size=\"20\">";
466
				echo "<a id=\"login-time-calendar\" href=\"#\"><img alt=\"schedule\" src=\"images/calendar.png\"/></a>";
485
				echo "<a id=\"login-time-calendar\" href=\"#\"><img alt=\"schedule\" src=\"images/calendar.png\"/></a>";
467
				echo '<div id="login-time-dialog" title="Weekly period"><div id="login-time-schedule"></div></div>';
486
				echo '<div id="login-time-dialog" title="Weekly period"><div id="login-time-schedule"></div></div>';
468
				break;
487
				break;
469
			default :
488
			default :
470
				echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
489
				echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
471
				break;
490
				break;
472
		}
491
		}
473
	}
492
	}
474
/*fin Ajout*/
493
/*fin Ajout*/
475
}
494
}
476
 
495
 
477
echo "</table><BR>";
496
echo "</table><BR>";
478
 
497
 
479
}
498
}
480
if ($create == 1)
499
if ($create == 1)
481
	echo "<br/><center><a href=\"group_admin.php?login=$login\">$l_show_profile</a></center>";
500
	echo "<br/><center><a href=\"group_admin.php?login=$login\">$l_show_profile</a></center>";
482
else {
501
else {
483
	echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newgroup');\">";
502
	echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newgroup');\">";
484
	echo "<button type=\"button\" id =\"show-advanced-fields\" onclick=\"showAdvancedFields(true)\" style=\"float: right;\">$l_simple_menu</button>";
503
	echo "<button type=\"button\" id =\"show-advanced-fields\" onclick=\"showAdvancedFields(true)\" style=\"float: right;\">$l_simple_menu</button>";
485
	echo "<button type=\"button\" id =\"hide-advanced-fields\" onclick=\"showAdvancedFields(false)\" style=\"float: right; display: none;\">$l_advanced_menu</button>";
504
	echo "<button type=\"button\" id =\"hide-advanced-fields\" onclick=\"showAdvancedFields(false)\" style=\"float: right; display: none;\">$l_advanced_menu</button>";
486
}
505
}
487
?>
506
?>
488
<br><br>
507
<br><br>
489
</form>
508
</form>
490
	</td></tr>
509
	</td></tr>
491
</table>
510
</table>
492
</tr>
511
</tr>
493
</table>
512
</table>
494
</center>
513
</center>
495
</TD></TR>
514
</TD></TR>
496
</TABLE>
515
</TABLE>
497
</td></tr>
516
</td></tr>
498
</TABLE>
517
</TABLE>
499
<script type="text/javascript" src="/js/jquery.min.js"></script>
518
<script type="text/javascript" src="/js/jquery.min.js"></script>
500
<script type="text/javascript" src="/js/jquery-ui.min.js"></script>
519
<script type="text/javascript" src="/js/jquery-ui.min.js"></script>
501
<script type="text/javascript" src="/js/schedule.js"></script>
520
<script type="text/javascript" src="/js/schedule.js"></script>
502
<script type="text/javascript" src="/js/login-time.js"></script>
521
<script type="text/javascript" src="/js/login-time.js"></script>
503
</body>
522
</body>
504
</html>
523
</html>
505
 
524