Subversion Repositories ALCASAR

Rev

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

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