Subversion Repositories ALCASAR

Rev

Rev 2424 | Rev 2505 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2424 Rev 2501
Line 1... Line 1...
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='';
Line 258... Line 248...
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
 
Line 287... Line 287...
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>
Line 335... Line 335...
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' :
Line 411... Line 411...
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>";