Subversion Repositories ALCASAR

Rev

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

Rev 2319 Rev 2394
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: user_new.php 2319 2017-07-04 23:21:40Z tom.houdayer $
2
# $Id: user_new.php 2394 2017-08-27 13:28:59Z 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'])) {
-
 
18
	if ($_POST['Status-Open-Required'] === '0') {
-
 
19
		$_POST['Idle-Timeout'] = '600'; // 10 minutes
-
 
20
	} else {
-
 
21
		$_POST['Idle-Timeout'] = '';
-
 
22
	}
-
 
23
	$_POST['Idle-Timeout_op'] = '=';
-
 
24
}
-
 
25
 
-
 
26
require('/etc/freeradius-web/config.php');
-
 
27
 
8
if(!isset($create)) $create=0;
28
if(!isset($create)) $create=0;
9
if(!isset($show)) $show=0;
29
if(!isset($show)) $show=0;
10
if(!isset($login)) $login = '';
30
if(!isset($login)) $login = '';
11
if(!isset($cn)) $cn = '';
31
if(!isset($cn)) $cn = '';
12
if(!isset($mail)) $mail = '';
32
if(!isset($mail)) $mail = '';
13
if(!isset($langue_imp)) $langue_imp = '';
33
if(!isset($langue_imp)) $langue_imp = '';
14
if(!isset($selected)) $selected = array();
34
if(!isset($selected)) $selected = array();
15
if(!isset($selected['='])) $selected['='] = '';
35
if(!isset($selected['='])) $selected['='] = '';
16
 
36
 
17
//update Filter-Id for protocol filtering
-
 
18
if (isset($_POST['Filter-Proto']) && isset($_POST['Filter-Id']))
-
 
19
{
-
 
20
	$upId = (int)$_POST['Filter-Proto'];
-
 
21
	$downId = (int)$_POST['Filter-Id'];
-
 
22
	$upId = $upId+$downId;
-
 
23
	$upId = str_pad($upId, 8, '0', STR_PAD_LEFT);
-
 
24
	$_POST['Filter-Id'] = $upId;
-
 
25
}
-
 
26
 
-
 
27
require('/etc/freeradius-web/config.php');
-
 
28
require('../lib/attrshow.php');
37
require('../lib/attrshow.php');
29
require('../lib/defaults.php');
38
require('../lib/defaults.php');
30
 
39
 
31
if (false && /* Hide operator column */ $config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true') {
40
if (false && /* Hide operator column */ $config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true') {
32
	$colspan = 2;
41
	$colspan = 2;
Line 244... Line 253...
244
		</td>
253
		</td>
245
	</tr>
254
	</tr>
246
EOM;
255
EOM;
247
	}
256
	}
248
	foreach ($show_attrs as $key => $desc) {
257
	foreach ($show_attrs as $key => $desc) {
-
 
258
		if ($key === 'Idle-Timeout') continue;
249
		$name = $attrmap["$key"];
259
		$name = $attrmap["$key"];
250
		if ($name == 'none')
260
		if ($name == 'none')
251
			continue;
261
			continue;
252
		$oper_name = $name . '_op';
262
		$oper_name = $name . '_op';
253
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != '') {
263
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != '') {
Line 505... Line 515...
505
			<option value=\"00000000\" selected>$l_proto_0</option>
515
			<option value=\"00000000\" selected>$l_proto_0</option>
506
			<option value=\"10000000\" >$l_proto_1</option>
516
			<option value=\"10000000\" >$l_proto_1</option>
507
			<option value=\"01000000\" >$l_proto_2</option>
517
			<option value=\"01000000\" >$l_proto_2</option>
508
			<option value=\"00100000\" >$l_proto_3</option>
518
			<option value=\"00100000\" >$l_proto_3</option>
509
		</select></td></tr>";
519
		</select></td></tr>";
-
 
520
 
-
 
521
	// User need to keep status page open
-
 
522
	print <<<EOM
-
 
523
	<tr class="advanced-field">
-
 
524
	<td class="etiquette" colspan="$colspan">
510
		
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=\"1\" checked>$l_yes</label>
-
 
530
		<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"0\">$l_no</label>
-
 
531
		</select></td>
-
 
532
	</tr>";
-
 
533
 
-
 
534
 
511
	print <<<EOM
535
	print <<<EOM
512
	<tr>
536
	<tr>
513
		<td class="etiquette" colspan="$colspan">
537
		<td class="etiquette" colspan="$colspan">
514
			$l_lang_ticket
538
			$l_lang_ticket
515
		</td>
539
		</td>