Subversion Repositories ALCASAR

Rev

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

Rev 2626 Rev 2628
1
<?php
1
<?php
2
# $Id: group_new.php 2626 2018-09-06 17:36:16Z lucas.echard $
2
# $Id: group_new.php 2628 2018-09-09 07:49:50Z lucas.echard $
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
		if (is_file("../lib/$config[general_lib_type]/create_group.php"))
127
		if (is_file("../lib/$config[general_lib_type]/create_group.php"))
128
			include("../lib/$config[general_lib_type]/create_group.php");
128
			include("../lib/$config[general_lib_type]/create_group.php");
129
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
129
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
130
			include("../lib/$config[general_lib_type]/group_info.php");
130
			include("../lib/$config[general_lib_type]/group_info.php");
131
	}
131
	}
132
}
132
}
133
if ($create == 0){
133
if ($create == 0){
134
?>
134
?>
135
   <form name="newgroup" method="post" class="">
135
   <form name="newgroup" method="post" class="">
136
      <input type="hidden" name="create" value="0">
136
      <input type="hidden" name="create" value="0">
137
      <input type="hidden" name="show" value="0">
137
      <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>
138
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
139
<?php
139
<?php
140
	echo <<<EOM
140
	echo <<<EOM
141
	<tr>
141
	<tr>
142
		<td class="etiquette" colspan=$colspan>
142
		<td class="etiquette" colspan=$colspan>
143
		$l_created_groups
143
		$l_created_groups
144
		</td><td>
144
		</td><td>
145
EOM;
145
EOM;
146
		if (!isset($existing_groups))
146
		if (!isset($existing_groups))
147
			echo "<b>$l_group_empty</b>\n";
147
			echo "<b>$l_group_empty</b>\n";
148
		else{
148
		else{
149
			echo "<select name=\"existing_groups\">\n";
149
			echo "<select name=\"existing_groups\">\n";
150
			foreach ($existing_groups as $group => $count)
150
			foreach ($existing_groups as $group => $count)
151
				echo "<option value=\"$group\">$group\n";
151
				echo "<option value=\"$group\">$group\n";
152
			echo "</select>\n";
152
			echo "</select>\n";
153
		}
153
		}
154
	echo <<<EOM
154
	echo <<<EOM
155
		</td>
155
		</td>
156
	</tr>
156
	</tr>
157
	<tr>
157
	<tr>
158
		<td class="etiquette" colspan=$colspan>
158
		<td class="etiquette" colspan=$colspan>
159
		$l_group_name
159
		$l_group_name
160
		</td><td>
160
		</td><td>
161
		<input type=text name="login" value="$login" size=35>
161
		<input type=text name="login" value="$login" size=35>
162
		</td>
162
		</td>
163
	</tr>
163
	</tr>
164
	<tr>
164
	<tr>
165
		<td class="etiquette" colspan=$colspan>
165
		<td class="etiquette" colspan=$colspan>
166
		$l_group_members
166
		$l_group_members
167
		</td><td>
167
		</td><td>
168
		<textarea name=members cols="50" wrap="PHYSICAL" rows=5></textarea>
168
		<textarea name=members cols="50" wrap="PHYSICAL" rows=5></textarea>
169
		</td>
169
		</td>
170
	</tr>
170
	</tr>
171
 
171
 
172
EOM;
172
EOM;
173
	foreach($show_attrs as $key => $desc){
173
	foreach($show_attrs as $key => $desc){
174
		if ($key === 'Idle-Timeout') continue;
174
		if ($key === 'Idle-Timeout') continue;
175
		$name = $attrmap["$key"];
175
		$name = $attrmap["$key"];
176
		if ($name == 'none')
176
		if ($name == 'none')
177
			continue;
177
			continue;
178
		$oper_name = $name . '_op';
178
		$oper_name = $name . '_op';
179
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){
179
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){
180
			$val = $item_vals["$key"][0];
180
			$val = $item_vals["$key"][0];
181
		} else if(isset($default_vals["$key"][0])) {
181
		} else if(isset($default_vals["$key"][0])) {
182
			$val = $default_vals["$key"][0];
182
			$val = $default_vals["$key"][0];
183
		} else {
183
		} else {
184
			$val = '';
184
			$val = '';
185
		}
185
		}
186
		switch ($key)
186
		switch ($key)
187
		{
187
		{
188
		// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
188
		// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
189
			case 'Simultaneous-Use' :
189
			case 'Simultaneous-Use' :
190
				$advanced = false;
190
				$advanced = false;
191
				$help_link = "help/simultaneous_use_help.html";
191
				$help_link = "help/simultaneous_use_help.html";
192
				$desc = $l_simultaneous_use;
192
				$desc = $l_simultaneous_use;
193
				break;
193
				break;
194
			case 'Max-All-Session' :
194
			case 'Max-All-Session' :
195
				$advanced = true;
195
				$advanced = true;
196
				$help_link = "help/max_all_session_help.html";
196
				$help_link = "help/max_all_session_help.html";
197
				$desc = $l_max_all_session;
197
				$desc = $l_max_all_session;
198
				break;
198
				break;
199
			case 'Session-Timeout' :
199
			case 'Session-Timeout' :
200
				$advanced = true;
200
				$advanced = true;
201
				$help_link = "help/session_timeout_help.html";
201
				$help_link = "help/session_timeout_help.html";
202
				$desc = $l_session_timeout;
202
				$desc = $l_session_timeout;
203
				break;
203
				break;
204
			case 'Max-Daily-Session' :
204
			case 'Max-Daily-Session' :
205
				$advanced = true;
205
				$advanced = true;
206
				$help_link = "help/session_timeout_help.html";
206
				$help_link = "help/session_timeout_help.html";
207
				$desc = $l_daily_timeout;
207
				$desc = $l_daily_timeout;
208
				break;
208
				break;
209
			case 'Max-Monthly-Session' :
209
			case 'Max-Monthly-Session' :
210
				$advanced = true;
210
				$advanced = true;
211
				$help_link = "help/session_timeout_help.html";
211
				$help_link = "help/session_timeout_help.html";
212
				$desc = $l_monthly_timeout;
212
				$desc = $l_monthly_timeout;
213
				break;
213
				break;
214
			case 'Login-Time' :
214
			case 'Login-Time' :
215
				$advanced = true;
215
				$advanced = true;
216
				$help_link = "help/login_time_help.html";
216
				$help_link = "help/login_time_help.html";
217
				$desc = $l_login_time;
217
				$desc = $l_login_time;
218
				break;
218
				break;
219
			case 'Expiration' :
219
			case 'Expiration' :
220
				$advanced = false;
220
				$advanced = false;
221
				$help_link = "help/expiration_help.html";
221
				$help_link = "help/expiration_help.html";
222
				$desc = $l_expiration;
222
				$desc = $l_expiration;
223
				break;
223
				break;
224
			case 'CoovaChilli-Max-Input-Octets' :
224
			case 'CoovaChilli-Max-Input-Octets' :
225
				$advanced = true;
225
				$advanced = true;
226
				$help_link = "help/coovachilli_max_input_octets_help.html";
226
				$help_link = "help/coovachilli_max_input_octets_help.html";
227
				$desc = $l_max_input_octets;
227
				$desc = $l_max_input_octets;
228
				break;
228
				break;
229
			case 'CoovaChilli-Max-Output-Octets' :
229
			case 'CoovaChilli-Max-Output-Octets' :
230
				$advanced = true;
230
				$advanced = true;
231
				$help_link = "help/coovachilli_max_output_octets_help.html";
231
				$help_link = "help/coovachilli_max_output_octets_help.html";
232
				$desc = $l_max_output_octets;
232
				$desc = $l_max_output_octets;
233
				break;
233
				break;
234
			case 'CoovaChilli-Max-Total-Octets' :
234
			case 'CoovaChilli-Max-Total-Octets' :
235
				$advanced = true;
235
				$advanced = true;
236
				$help_link = "help/coovachilli_max_total_octets_help.html";
236
				$help_link = "help/coovachilli_max_total_octets_help.html";
237
				$desc = $l_max_total_octets;
237
				$desc = $l_max_total_octets;
238
				break;
238
				break;
239
			case 'CoovaChilli-Max-Total-Octets-Daily' :
239
			case 'CoovaChilli-Max-Total-Octets-Daily' :
240
				$advanced = true;
240
				$advanced = true;
241
				$help_link = "help/coovachilli_max_total_octets_help.html";
241
				$help_link = "help/coovachilli_max_total_octets_help.html";
242
				$desc = $l_max_total_octets_daily;
242
				$desc = $l_max_total_octets_daily;
243
				break;
243
				break;
244
			case 'CoovaChilli-Max-Total-Octets-Monthly' :
244
			case 'CoovaChilli-Max-Total-Octets-Monthly' :
245
				$advanced = true;
245
				$advanced = true;
246
				$help_link = "help/coovachilli_max_total_octets_help.html";
246
				$help_link = "help/coovachilli_max_total_octets_help.html";
247
				$desc = $l_max_total_octets_monthly;
247
				$desc = $l_max_total_octets_monthly;
248
				break;
248
				break;
249
			case 'CoovaChilli-Bandwidth-Max-Up' :
249
			case 'CoovaChilli-Bandwidth-Max-Up' :
250
				$advanced = true;
250
				$advanced = true;
251
				$help_link = "help/coovachilli_bandwidth_max_up_help.html";
251
				$help_link = "help/coovachilli_bandwidth_max_up_help.html";
252
				$desc = $l_max_bandwidth_up;
252
				$desc = $l_max_bandwidth_up;
253
				break;
253
				break;
254
			case 'CoovaChilli-Bandwidth-Max-Down' :
254
			case 'CoovaChilli-Bandwidth-Max-Down' :
255
				$advanced = true;
255
				$advanced = true;
256
				$help_link = "help/coovachilli_bandwidth_max_down_help.html";
256
				$help_link = "help/coovachilli_bandwidth_max_down_help.html";
257
				$desc = $l_max_bandwidth_down;
257
				$desc = $l_max_bandwidth_down;
258
				break;
258
				break;
259
			case 'WISPr-Redirection-URL' :
259
			case 'WISPr-Redirection-URL' :
260
				$advanced = true;
260
				$advanced = true;
261
				$help_link = "help/wispr_redirection_url_help.html";
261
				$help_link = "help/wispr_redirection_url_help.html";
262
				$desc = $l_wispr_redirection;
262
				$desc = $l_wispr_redirection;
263
				break;
263
				break;
264
			case 'Alcasar-Filter' :
264
			case 'Alcasar-Filter' :
265
				$advanced = false;
265
				$advanced = false;
266
				$help_link = "help/filtering_help.html";
266
				$help_link = "help/filtering_help.html";
267
				$desc = $l_filtering;
267
				$desc = $l_filtering;
268
				break;
268
				break;
269
			case 'Alcasar-Protocols-Filter' :
269
			case 'Alcasar-Protocols-Filter' :
270
				$advanced = false;
270
				$advanced = false;
271
				$help_link = "help/protocols_help.html";
271
				$help_link = "help/protocols_help.html";
272
				$desc = $l_proto;
272
				$desc = $l_proto;
273
				break;
273
				break;
274
			case 'Alcasar-Status-Page-Must-Stay-Open' :
274
			case 'Alcasar-Status-Page-Must-Stay-Open' :
275
				$advanced = false;
275
				$advanced = false;
276
				$help_link = "help/statusOpenRequired_help.html";
276
				$help_link = "help/statusOpenRequired_help.html";
277
				$desc = $l_statusOpenRequired;
277
				$desc = $l_statusOpenRequired;
278
				break;
278
				break;
279
			case 'Alcasar-Expire-After' :
279
			case 'Alcasar-Expire-After' :
280
				$advanced = true;
280
				$advanced = true;
281
				$help_link = "help/expire_after_help.html";
281
				$help_link = "help/expire_after_help.html";
282
				$desc = $l_expire_after;
282
				$desc = $l_expire_after;
283
				break;
283
				break;
284
			default:
284
			default:
285
				$advanced = true;
285
				$advanced = true;
286
				break;
286
				break;
287
		}
287
		}
288
 
288
 
289
		$advancedField = ($advanced) ? ' class="advanced-field"' : '';
289
		$advancedField = ($advanced) ? ' class="advanced-field"' : '';
290
 
290
 
291
		if ($show_ops){
291
		if ($show_ops){
292
		print <<<EOM
292
		print <<<EOM
293
			<tr$advancedField>
293
			<tr$advancedField>
294
			<td class="etiquette">
294
			<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>
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>
296
			</td>
296
			</td>
297
EOM;
297
EOM;
298
			switch ($key) {
298
			switch ($key) {
299
				case 'Simultaneous-Use' :
299
				case 'Simultaneous-Use' :
300
				case 'Max-All-Session' :
300
				case 'Max-All-Session' :
301
				case 'Max-Daily-Session' :
301
				case 'Max-Daily-Session' :
302
				case 'Max-Weekly-Session' :
302
				case 'Max-Weekly-Session' :
303
				case 'Max-Monthly-Session' :
303
				case 'Max-Monthly-Session' :
304
				case 'Login-Time' :
304
				case 'Login-Time' :
305
				case 'Expiration' :
305
				case 'Expiration' :
306
				case 'Alcasar-Expire-After' :
306
				case 'Alcasar-Expire-After' :
307
				case 'CoovaChilli-Max-Total-Octets-Daily' :
307
				case 'CoovaChilli-Max-Total-Octets-Daily' :
308
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
308
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
309
				case 'CoovaChilli-Max-Total-Octets' :
309
				case 'CoovaChilli-Max-Total-Octets' :
310
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=";
310
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=";
311
					break;
311
					break;
312
				case 'Session-Timeout' :
312
				case 'Session-Timeout' :
313
				case 'CoovaChilli-Max-Input-Octets' :
313
				case 'CoovaChilli-Max-Input-Octets' :
314
				case 'CoovaChilli-Max-Output-Octets' :
314
				case 'CoovaChilli-Max-Output-Octets' :
315
				case 'CoovaChilli-Bandwidth-Max-Up' :
315
				case 'CoovaChilli-Bandwidth-Max-Up' :
316
				case 'CoovaChilli-Bandwidth-Max-Down' :
316
				case 'CoovaChilli-Bandwidth-Max-Down' :
317
				case 'WISPr-Redirection-URL' :
317
				case 'WISPr-Redirection-URL' :
318
				case 'Alcasar-Filter' :
318
				case 'Alcasar-Filter' :
319
				case 'Alcasar-Protocols-Filter' :
319
				case 'Alcasar-Protocols-Filter' :
320
				case 'Alcasar-Status-Page-Must-Stay-Open' :
320
				case 'Alcasar-Status-Page-Must-Stay-Open' :
321
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=";
321
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=";
322
					break;
322
					break;
323
				default :
323
				default :
324
					print <<<EOM
324
					print <<<EOM
325
					<td>
325
					<td>
326
						<select name=\"$oper_name\">
326
						<select name=\"$oper_name\">
327
							<option $selected[$op_eq] value="=">=
327
							<option $selected[$op_eq] value="=">=
328
							<option $selected[$op_set] value=":=">:=
328
							<option $selected[$op_set] value=":=">:=
329
							<option $selected[$op_add] value="+=">+=
329
							<option $selected[$op_add] value="+=">+=
330
							<option $selected[$op_eq2] value="==">==
330
							<option $selected[$op_eq2] value="==">==
331
							<option $selected[$op_ne] value="!=">!=
331
							<option $selected[$op_ne] value="!=">!=
332
							<option $selected[$op_gt] value=">">&gt;
332
							<option $selected[$op_gt] value=">">&gt;
333
							<option $selected[$op_ge] value=">=">&gt;=
333
							<option $selected[$op_ge] value=">=">&gt;=
334
							<option $selected[$op_lt] value="<">&lt;
334
							<option $selected[$op_lt] value="<">&lt;
335
							<option $selected[$op_le] value="<=">&lt;=
335
							<option $selected[$op_le] value="<=">&lt;=
336
							<option $selected[$op_regeq] value="=~">=~
336
							<option $selected[$op_regeq] value="=~">=~
337
							<option $selected[$op_regne] value="!~">!~
337
							<option $selected[$op_regne] value="!~">!~
338
							<option $selected[$op_exst] value="=*">=*
338
							<option $selected[$op_exst] value="=*">=*
339
							<option $selected[$op_nexst] value="!*">!*
339
							<option $selected[$op_nexst] value="!*">!*
340
						</select>
340
						</select>
341
					</td>
341
					</td>
342
EOM;
342
EOM;
343
					break;
343
					break;
344
			}
344
			}
345
		} else {
345
		} else {
346
			print <<<EOM
346
			print <<<EOM
347
				<tr$advancedField>
347
				<tr$advancedField>
348
				<td class="etiquette" colspan="$colspan">
348
				<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>
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>
350
EOM;
350
EOM;
351
			switch ($key) {
351
			switch ($key) {
352
				case 'Simultaneous-Use' :
352
				case 'Simultaneous-Use' :
353
				case 'Max-All-Session' :
353
				case 'Max-All-Session' :
354
				case 'Max-Daily-Session' :
354
				case 'Max-Daily-Session' :
355
				case 'Max-Weekly-Session' :
355
				case 'Max-Weekly-Session' :
356
				case 'Max-Monthly-Session' :
356
				case 'Max-Monthly-Session' :
357
				case 'Login-Time' :
357
				case 'Login-Time' :
358
				case 'Expiration' :
358
				case 'Expiration' :
359
				case 'Alcasar-Filter' :
359
				case 'Alcasar-Filter' :
360
				case 'Alcasar-Protocols-Filter' :
360
				case 'Alcasar-Protocols-Filter' :
361
				case 'Alcasar-Status-Page-Must-Stay-Open' :
361
				case 'Alcasar-Status-Page-Must-Stay-Open' :
362
				case 'Alcasar-Expire-After' :
362
				case 'Alcasar-Expire-After' :
363
				case 'CoovaChilli-Max-Total-Octets-Daily' :
363
				case 'CoovaChilli-Max-Total-Octets-Daily' :
364
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
364
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
365
				case 'CoovaChilli-Max-Total-Octets' :
365
				case 'CoovaChilli-Max-Total-Octets' :
366
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
366
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
367
					break;
367
					break;
368
				case 'Session-Timeout' :
368
				case 'Session-Timeout' :
369
				case 'CoovaChilli-Max-Input-Octets' :
369
				case 'CoovaChilli-Max-Input-Octets' :
370
				case 'CoovaChilli-Max-Output-Octets' :
370
				case 'CoovaChilli-Max-Output-Octets' :
371
				case 'CoovaChilli-Bandwidth-Max-Up' :
371
				case 'CoovaChilli-Bandwidth-Max-Up' :
372
				case 'CoovaChilli-Bandwidth-Max-Down' :
372
				case 'CoovaChilli-Bandwidth-Max-Down' :
373
				case 'WISPr-Redirection-URL' :
373
				case 'WISPr-Redirection-URL' :
374
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
374
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
375
					break;
375
					break;
376
				default :
376
				default :
377
					print <<<EOM
377
					print <<<EOM
378
						<select name=\"$oper_name\">
378
						<select name=\"$oper_name\">
379
							<option $selected[$op_eq] value="=">=</option>
379
							<option $selected[$op_eq] value="=">=</option>
380
							<option $selected[$op_set] value=":=">:=</option>
380
							<option $selected[$op_set] value=":=">:=</option>
381
							<option $selected[$op_add] value="+=">+=</option>
381
							<option $selected[$op_add] value="+=">+=</option>
382
							<option $selected[$op_eq2] value="==">==</option>
382
							<option $selected[$op_eq2] value="==">==</option>
383
							<option $selected[$op_ne] value="!=">!=</option>
383
							<option $selected[$op_ne] value="!=">!=</option>
384
							<option $selected[$op_gt] value=">">&gt;</option>
384
							<option $selected[$op_gt] value=">">&gt;</option>
385
							<option $selected[$op_ge] value=">=">&gt;=</option>
385
							<option $selected[$op_ge] value=">=">&gt;=</option>
386
							<option $selected[$op_lt] value="<">&lt;</option>
386
							<option $selected[$op_lt] value="<">&lt;</option>
387
							<option $selected[$op_le] value="<=">&lt;=</option>
387
							<option $selected[$op_le] value="<=">&lt;=</option>
388
							<option $selected[$op_regeq] value="=~">=~</option>
388
							<option $selected[$op_regeq] value="=~">=~</option>
389
							<option $selected[$op_regne] value="!~">!~</option>
389
							<option $selected[$op_regne] value="!~">!~</option>
390
							<option $selected[$op_exst] value="=*">=*</option>
390
							<option $selected[$op_exst] value="=*">=*</option>
391
							<option $selected[$op_nexst] value="!*">!*</option>
391
							<option $selected[$op_nexst] value="!*">!*</option>
392
						</select>
392
						</select>
393
EOM;
393
EOM;
394
					break;
394
					break;
395
			}
395
			}
396
			echo '</td>';
396
			echo '</td>';
397
		}
397
		}
398
 
398
 
399
/*
399
/*
400
Ajout du choix d'unité (pour les durées limites de session, journée et de mois)
400
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
401
et d'un calendrier pour la date d'expiration
402
Sauf dans le cas de la visualisation
402
Sauf dans le cas de la visualisation
403
*/
403
*/
404
	echo '<td>';
404
	echo '<td>';
405
	if ($create == 0) {
405
	if ($create == 0) {
406
		switch ($name){
406
		switch ($name){
407
			/*
407
			/*
408
			Choix de l'unité jour, heures, minutes ou secondes
408
			Choix de l'unité jour, heures, minutes ou secondes
409
			pour les durées limites max, de session,de journée et de mois
409
			pour les durées limites max, de session,de journée et de mois
410
			*/
410
			*/
411
			case 'Session-Timeout' :
411
			case 'Session-Timeout' :
412
			case 'Max-Daily-Session' :
412
			case 'Max-Daily-Session' :
413
				/*valeur d'origine de durée limite */
413
				/*valeur d'origine de durée limite */
414
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
414
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
415
				/* Choix d'unité*/
415
				/* Choix d'unité*/
416
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
416
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
417
						<option value=\"s\" selected>s</option>
417
						<option value=\"s\" selected>s</option>
418
						<option value=\"m\" >m</option>
418
						<option value=\"m\" >m</option>
419
						<option value=\"H\" >H</option>
419
						<option value=\"H\" >H</option>
420
					</select>";
420
					</select>";
421
				break;
421
				break;
422
			case 'Max-Monthly-Session' :
422
			case 'Max-Monthly-Session' :
423
			case 'Max-All-Session' :
423
			case 'Max-All-Session' :
424
			case 'Alcasar-Expire-After' :
424
			case 'Alcasar-Expire-After' :
425
				/*valeur d'origine de durée limite */
425
				/*valeur d'origine de durée limite */
426
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
426
				echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
427
				/* Choix d'unité*/
427
				/* Choix d'unité*/
428
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
428
				echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newgroup')\">
429
						<option value=\"s\" selected>s</option>
429
						<option value=\"s\" selected>s</option>
430
						<option value=\"m\" >m</option>
430
						<option value=\"m\" >m</option>
431
						<option value=\"H\" >H</option>
431
						<option value=\"H\" >H</option>
432
						<option value=\"J\" >J</option>
432
						<option value=\"J\" >J</option>
433
					</select>";
433
					</select>";
434
				break;
434
				break;
435
			case 'Expiration' :
435
			case 'Expiration' :
436
				/*Ajout du calendrier pour choisir la date*/
436
				/*Ajout du calendrier pour choisir la date*/
437
				echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
437
				echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
438
				break;
438
				break;
439
			case 'Alcasar-Filter' :
439
			case 'Alcasar-Filter' :
440
				echo "<select name=\"$name\">";
440
				echo "<select name=\"$name\">";
441
				echo "<option value=\"\"></option>";
441
				echo "<option value=\"\"></option>";
442
				echo "<option value=\"1\">$l_filtering_none</option>";
442
				echo "<option value=\"1\">$l_filtering_none</option>";
443
				echo "<option value=\"2\">$l_filtering_havp</option>";
443
				echo "<option value=\"2\">$l_filtering_havp</option>";
444
				echo "<option value=\"3\">$l_filtering_havp_bl</option>";
444
				echo "<option value=\"3\">$l_filtering_havp_bl</option>";
445
				echo "<option value=\"4\">$l_filtering_havp_wl</option>";
445
				echo "<option value=\"4\">$l_filtering_havp_wl</option>";
446
				echo "</select>";
446
				echo "</select>";
447
				break;
447
				break;
448
			case 'Alcasar-Protocols-Filter' :
448
			case 'Alcasar-Protocols-Filter' :
449
				echo "<select name=\"$name\">";
449
				echo "<select name=\"$name\">";
450
				echo "<option value=\"\"></option>";
450
				echo "<option value=\"\"></option>";
451
				echo "<option value=\"1\">$l_proto_0</option>";
451
				echo "<option value=\"1\">$l_proto_0</option>";
452
				echo "<option value=\"2\">$l_proto_1</option>";
452
				echo "<option value=\"2\">$l_proto_1</option>";
453
				echo "<option value=\"3\">$l_proto_2</option>";
453
				echo "<option value=\"3\">$l_proto_2</option>";
454
				echo "<option value=\"4\">$l_proto_3</option>";
454
				echo "<option value=\"4\">$l_proto_3</option>";
455
				echo "</select>";
455
				echo "</select>";
456
				break;
456
				break;
457
			case 'Alcasar-Status-Page-Must-Stay-Open' :
457
			case 'Alcasar-Status-Page-Must-Stay-Open' :
458
				echo "<label><input type=\"radio\" name=\"$name\" value=\"\" checked>$l_yes</label>
458
				echo "<label><input type=\"radio\" name=\"$name\" value=\"\" checked>$l_yes</label>
459
					<label><input type=\"radio\" name=\"$name\" value=\"2\">$l_no</label>";
459
					<label><input type=\"radio\" name=\"$name\" value=\"2\">$l_no</label>";
460
				break;
460
				break;
461
			case 'Login-Time':
461
			case 'Login-Time':
462
				echo "<input type=\"text\" name=\"$name\" id=\"$name\" value=\"$val\" size=\"20\" pattern=\"^((Mo|Tu|We|Th|Fr|Sa|Su|Wk|Any|Al)([0-9]{4}-[0-9]{4})?(,|\|)){0,}(Mo|Tu|We|Th|Fr|Sa|Su|Wk|Any|Al)([0-9]{4}-[0-9]{4})?$\">";
462
				echo "<input type=\"text\" name=\"$name\" id=\"$name\" value=\"$val\" size=\"20\">";
463
				echo "<a id=\"login-time-calendar\" href=\"#\"><img alt=\"schedule\" src=\"images/calendar.png\"/></a>";
463
				echo "<a id=\"login-time-calendar\" href=\"#\"><img alt=\"schedule\" src=\"images/calendar.png\"/></a>";
464
				echo '<div id="login-time-dialog" title="Weekly period"><div id="login-time-schedule"></div></div>';
464
				echo '<div id="login-time-dialog" title="Weekly period"><div id="login-time-schedule"></div></div>';
465
				break;
465
				break;
466
			default :
466
			default :
467
				echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
467
				echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
468
				break;
468
				break;
469
		}
469
		}
470
	}
470
	}
471
/*fin Ajout*/
471
/*fin Ajout*/
472
}
472
}
473
 
473
 
474
echo "</table><BR>";
474
echo "</table><BR>";
475
 
475
 
476
}
476
}
477
if ($create == 1)
477
if ($create == 1)
478
	echo "<br/><center><a href=\"group_admin.php?login=$login\">$l_show_profile</a></center>";
478
	echo "<br/><center><a href=\"group_admin.php?login=$login\">$l_show_profile</a></center>";
479
else {
479
else {
480
	echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newgroup');\">";
480
	echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newgroup');\">";
481
	echo "<button type=\"button\" id =\"show-advanced-fields\" onclick=\"showAdvancedFields(true)\" style=\"float: right;\">$l_simple_menu</button>";
481
	echo "<button type=\"button\" id =\"show-advanced-fields\" onclick=\"showAdvancedFields(true)\" style=\"float: right;\">$l_simple_menu</button>";
482
	echo "<button type=\"button\" id =\"hide-advanced-fields\" onclick=\"showAdvancedFields(false)\" style=\"float: right; display: none;\">$l_advanced_menu</button>";
482
	echo "<button type=\"button\" id =\"hide-advanced-fields\" onclick=\"showAdvancedFields(false)\" style=\"float: right; display: none;\">$l_advanced_menu</button>";
483
}
483
}
484
?>
484
?>
485
<br><br>
485
<br><br>
486
</form>
486
</form>
487
	</td></tr>
487
	</td></tr>
488
</table>
488
</table>
489
</tr>
489
</tr>
490
</table>
490
</table>
491
</center>
491
</center>
492
</TD></TR>
492
</TD></TR>
493
</TABLE>
493
</TABLE>
494
</td></tr>
494
</td></tr>
495
</TABLE>
495
</TABLE>
496
<script type="text/javascript" src="/js/jquery.min.js"></script>
496
<script type="text/javascript" src="/js/jquery.min.js"></script>
497
<script type="text/javascript" src="/js/jquery-ui.min.js"></script>
497
<script type="text/javascript" src="/js/jquery-ui.min.js"></script>
498
<script type="text/javascript" src="/js/schedule.js"></script>
498
<script type="text/javascript" src="/js/schedule.js"></script>
499
<script type="text/javascript" src="/js/login-time.js"></script>
499
<script type="text/javascript" src="/js/login-time.js"></script>
500
</body>
500
</body>
501
</html>
501
</html>
502
 
502