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: user_new.php 2424 2017-10-11 21:50:39Z tom.houdayer $
2
# $Id: user_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($show)) $show=0;
19
if(!isset($show)) $show=0;
Line 333... Line 323...
333
			case 'WISPr-Redirection-URL' :
323
			case 'WISPr-Redirection-URL' :
334
				$advanced = true;
324
				$advanced = true;
335
				$help_link = "help/wispr_redirection_url_help.html";
325
				$help_link = "help/wispr_redirection_url_help.html";
336
				$desc = $l_wispr_redirection;
326
				$desc = $l_wispr_redirection;
337
				break;
327
				break;
338
			case 'Filter-Id' :
328
			case 'Alcasar-Filter' :
339
				$advanced = false;
329
				$advanced = false;
340
				$help_link = "help/filtering_help.html";
330
				$help_link = "help/filtering_help.html";
341
				$desc = $l_filtering;
331
				$desc = $l_filtering;
342
				break;
332
				break;
-
 
333
			case 'Alcasar-Filter-Proto' :
-
 
334
				$advanced = false;
-
 
335
				$help_link = "help/protocols_help.html";
-
 
336
				$desc = $l_proto;
-
 
337
				break;
-
 
338
			case 'Alcasar-Status-Open-Required' :
-
 
339
				$advanced = false;
-
 
340
				$help_link = "help/statusOpenRequired_help.html";
-
 
341
				$desc = $l_statusOpenRequired;
-
 
342
				break;
343
			default:
343
			default:
344
				$advanced = true;
344
				$advanced = true;
345
				break;
345
				break;
346
		}
346
		}
347
 
347
 
Line 362... Line 362...
362
				case 'Max-Monthly-Session' :
362
				case 'Max-Monthly-Session' :
363
				case 'Login-Time' :
363
				case 'Login-Time' :
364
				case 'Expiration' :
364
				case 'Expiration' :
365
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=</option></select></td>";
365
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=</option></select></td>";
366
					break;
366
					break;
367
				case 'Filter-Id' :
-
 
368
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=</option></select></td>";
-
 
369
					break;
-
 
370
				case 'Session-Timeout' :
367
				case 'Session-Timeout' :
371
				case 'ChilliSpot-Max-Input-Octets' :
368
				case 'ChilliSpot-Max-Input-Octets' :
372
				case 'ChilliSpot-Max-Output-Octets' :
369
				case 'ChilliSpot-Max-Output-Octets' :
373
				case 'ChilliSpot-Max-Total-Octets' :
370
				case 'ChilliSpot-Max-Total-Octets' :
374
				case 'ChilliSpot-Bandwidth-Max-Up' :
371
				case 'ChilliSpot-Bandwidth-Max-Up' :
375
				case 'ChilliSpot-Bandwidth-Max-Down' :
372
				case 'ChilliSpot-Bandwidth-Max-Down' :
376
				case 'WISPr-Redirection-URL' :
373
				case 'WISPr-Redirection-URL' :
-
 
374
				case 'Alcasar-Filter' :
-
 
375
				case 'Alcasar-Filter-Proto' :
-
 
376
				case 'Alcasar-Status-Open-Required' :
377
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=</option></select></td>";
377
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=</option></select></td>";
378
					break;
378
					break;
379
				default :
379
				default :
380
					print <<<EOM
380
					print <<<EOM
381
						<td>
381
						<td>
Line 412... Line 412...
412
				case 'Max-Monthly-Session' :
412
				case 'Max-Monthly-Session' :
413
				case 'Login-Time' :
413
				case 'Login-Time' :
414
				case 'Expiration' :
414
				case 'Expiration' :
415
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
415
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
416
					break;
416
					break;
417
				case 'Filter-Id' :
-
 
418
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
-
 
419
					break;
-
 
420
				case 'Session-Timeout' :
417
				case 'Session-Timeout' :
421
				case 'ChilliSpot-Max-Input-Octets' :
418
				case 'ChilliSpot-Max-Input-Octets' :
422
				case 'ChilliSpot-Max-Output-Octets' :
419
				case 'ChilliSpot-Max-Output-Octets' :
423
				case 'ChilliSpot-Max-Total-Octets' :
420
				case 'ChilliSpot-Max-Total-Octets' :
424
				case 'ChilliSpot-Bandwidth-Max-Up' :
421
				case 'ChilliSpot-Bandwidth-Max-Up' :
425
				case 'ChilliSpot-Bandwidth-Max-Down' :
422
				case 'ChilliSpot-Bandwidth-Max-Down' :
426
				case 'WISPr-Redirection-URL' :
423
				case 'WISPr-Redirection-URL' :
-
 
424
				case 'Alcasar-Filter' :
-
 
425
				case 'Alcasar-Filter-Proto' :
-
 
426
				case 'Alcasar-Status-Open-Required' :
427
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
427
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
428
					break;
428
					break;
429
				default :
429
				default :
430
					print <<<EOM
430
					print <<<EOM
431
						<select name=\"$oper_name\">
431
						<select name=\"$oper_name\">
Line 485... Line 485...
485
					break;
485
					break;
486
				case 'Expiration' :
486
				case 'Expiration' :
487
					/*Ajout du calendrier pour choisir la date*/
487
					/*Ajout du calendrier pour choisir la date*/
488
					echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
488
					echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
489
					break;
489
					break;
490
				case 'Filter-Id' :
490
				case 'Alcasar-Filter' :
491
					echo "<select name='Filter-Id'>";
491
					echo "<select name=\"$name\">";
-
 
492
					echo "<option value=\"\"></option>";
492
					echo "<option value=\"\">$l_filtering_none</option>";
493
					echo "<option value=\"1\">$l_filtering_none</option>";
493
					echo "<option value=\"00000001\">$l_filtering_havp</option>";
494
					echo "<option value=\"2\">$l_filtering_havp</option>";
494
					echo "<option value=\"00000011\">$l_filtering_havp_bl</option>";
495
					echo "<option value=\"3\">$l_filtering_havp_bl</option>";
495
					echo "<option value=\"00000101\">$l_filtering_havp_wl</option>";
496
					echo "<option value=\"4\">$l_filtering_havp_wl</option>";
496
					echo "</select>";
497
					echo "</select>";
497
					break;
498
					break;
-
 
499
				case 'Alcasar-Filter-Proto' :
-
 
500
					echo "<select name=\"$name\">";
-
 
501
					echo "<option value=\"\"></option>";
-
 
502
					echo "<option value=\"1\">$l_proto_0</option>";
-
 
503
					echo "<option value=\"2\">$l_proto_1</option>";
-
 
504
					echo "<option value=\"3\">$l_proto_2</option>";
-
 
505
					echo "<option value=\"4\">$l_proto_3</option>";
-
 
506
					echo "</select>";
-
 
507
					break;
-
 
508
				case 'Alcasar-Status-Open-Required' :
-
 
509
					echo "<label><input type=\"radio\" name=\"$name\" value=\"\" checked>$l_yes</label>
-
 
510
						<label><input type=\"radio\" name=\"$name\" value=\"2\">$l_no</label>";
-
 
511
					break;
498
				default :
512
				default :
499
					echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
513
					echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
500
					break;
514
					break;
501
			}
515
			}
502
		}
516
		}
503
		echo '</td>';
517
		echo '</td>';
504
	}
518
	}
505
 
519
 
506
/*Network protocole filtering*/
-
 
507
print <<<EOM
-
 
508
	<tr>
-
 
509
		<td class="etiquette" colspan="$colspan">
-
 
510
		<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>
-
 
511
		</td>
-
 
512
		<td width=20>
-
 
513
EOM;
-
 
514
	echo" <select name='Filter-Proto'>
-
 
515
			<option value=\"00000000\" selected>$l_proto_0</option>
-
 
516
			<option value=\"10000000\" >$l_proto_1</option>
-
 
517
			<option value=\"01000000\" >$l_proto_2</option>
-
 
518
			<option value=\"00100000\" >$l_proto_3</option>
-
 
519
		</select></td></tr>";
-
 
520
 
-
 
521
	// User need to keep status page open
-
 
522
	print <<<EOM
-
 
523
	<tr>
-
 
524
	<td class="etiquette" colspan="$colspan">
-
 
525
		<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>
-
 
526
	</td>
-
 
527
EOM;
-
 
528
	echo "<td width=20>
-
 
529
		<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"0\" checked>$l_yes</label>
-
 
530
		<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"1\">$l_no</label>
-
 
531
		</select></td>
-
 
532
	</tr>";
-
 
533
 
-
 
534
 
520
 
535
	print <<<EOM
521
	print <<<EOM
536
	<tr>
522
	<tr>
537
		<td class="etiquette" colspan="$colspan">
523
		<td class="etiquette" colspan="$colspan">
538
			$l_lang_ticket
524
			$l_lang_ticket