Subversion Repositories ALCASAR

Rev

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

Rev 2393 Rev 2394
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: group_new.php 2393 2017-08-27 13:04:28Z tom.houdayer $
2
# $Id: group_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
8
//update Filter-Id for protocol filtering
9
if (isset($_POST['Filter-Proto']) && isset($_POST['Filter-Id']))
9
if (isset($_POST['Filter-Proto']) && isset($_POST['Status-Open-Required']) && isset($_POST['Filter-Id']))
10
{
10
{
11
	$upId = (int)$_POST['Filter-Proto'];
11
	$filterId = (int)$_POST['Filter-Id'];
12
	$downId = (int)$_POST['Filter-Id'];
12
	$FilterProto = (int)$_POST['Filter-Proto'];
-
 
13
	$statusOpenRequired = (int)($_POST['Status-Open-Required'].'000');
13
	$upId = $upId+$downId;
14
	$filterId = $filterId+$FilterProto+$statusOpenRequired;
14
	$upId = str_pad($upId, 8, '0', STR_PAD_LEFT);
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 {
15
	$_POST['Filter-Id'] = $upId;
21
		$_POST['Idle-Timeout'] = '';
-
 
22
	}
-
 
23
	$_POST['Idle-Timeout_op'] = '=';
16
}
24
}
17
 
25
 
18
require('/etc/freeradius-web/config.php');
26
require('/etc/freeradius-web/config.php');
19
 
27
 
20
if (!isset ($create)) $create=0;
28
if (!isset ($create)) $create=0;
Line 170... Line 178...
170
		</td>
178
		</td>
171
	</tr>
179
	</tr>
172
 
180
 
173
EOM;
181
EOM;
174
	foreach($show_attrs as $key => $desc){
182
	foreach($show_attrs as $key => $desc){
-
 
183
		if ($key === 'Idle-Timeout') continue;
175
		$name = $attrmap["$key"];
184
		$name = $attrmap["$key"];
176
		if ($name == 'none')
185
		if ($name == 'none')
177
			continue;
186
			continue;
178
		$oper_name = $name . '_op';
187
		$oper_name = $name . '_op';
179
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){
188
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){
Line 432... Line 441...
432
			<option value=\"00000000\" selected>$l_proto_0</option>
441
			<option value=\"00000000\" selected>$l_proto_0</option>
433
			<option value=\"10000000\" >$l_proto_1</option>
442
			<option value=\"10000000\" >$l_proto_1</option>
434
			<option value=\"01000000\" >$l_proto_2</option>
443
			<option value=\"01000000\" >$l_proto_2</option>
435
			<option value=\"00100000\" >$l_proto_3</option>
444
			<option value=\"00100000\" >$l_proto_3</option>
436
		</select></td></tr>";
445
		</select></td></tr>";
-
 
446
 
-
 
447
	// User need to keep status page open
-
 
448
	print <<<EOM
-
 
449
	<tr class="advanced-field">
-
 
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=\"1\" checked>$l_yes</label>
-
 
456
		<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"0\">$l_no</label>
-
 
457
		</select></td>
-
 
458
	</tr>";
437
echo "</table><BR>";
459
echo "</table><BR>";
-
 
460
 
438
}
461
}
439
if ($create == 1)
462
if ($create == 1)
440
	echo "<br/><center><a href=\"group_admin.php?login=$login\">$l_show_profile</a></center>";
463
	echo "<br/><center><a href=\"group_admin.php?login=$login\">$l_show_profile</a></center>";
441
else {
464
else {
442
	echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newgroup');\">";
465
	echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newgroup');\">";