Commit 797df667 authored by Franco Fichtner's avatar Franco Fichtner

vpn: going down in style

parent e17d4515
This diff is collapsed.
......@@ -45,7 +45,8 @@ $a_secret = &$config['ipsec']['mobilekey'];
$userkeys = array();
foreach ($config['system']['user'] as $id => $user) {
if (!empty($user['ipsecpsk'])) {
$userkeys[] = array('ident' => $user['name'], 'pre-shared-key' => $user['ipsecpsk'], 'id' => $id);;
$userkeys[] = array('ident' => $user['name'], 'pre-shared-key' => $user['ipsecpsk'], 'id' => $id);
;
}
}
......@@ -54,8 +55,9 @@ if (isset($_POST['apply'])) {
/* reload the filter in the background */
filter_configure();
$savemsg = get_std_save_message($retval);
if (is_subsystem_dirty('ipsec'))
if (is_subsystem_dirty('ipsec')) {
clear_subsystem_dirty('ipsec');
}
}
if ($_GET['act'] == "del") {
......@@ -84,16 +86,19 @@ include("head.inc");
<?php
if ($savemsg)
if ($savemsg) {
print_info_box($savemsg);
if (is_subsystem_dirty('ipsec'))
}
if (is_subsystem_dirty('ipsec')) {
print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
}
?>
<section class="col-xs-12">
<? $active_tab = "/vpn_ipsec_settings.php"; include('vpn_ipsec_tabs.inc'); ?>
<? $active_tab = "/vpn_ipsec_settings.php";
include('vpn_ipsec_tabs.inc'); ?>
<div class="tab-content content-box col-xs-12">
......@@ -115,14 +120,16 @@ include("head.inc");
</table>
</td>
</tr>
<?php $i = 0; foreach ($userkeys as $secretent): ?>
<?php $i = 0; foreach ($userkeys as $secretent) :
?>
<tr>
<td class="listlr gray">
<?php
if ($secretent['ident'] == 'allusers')
if ($secretent['ident'] == 'allusers') {
echo gettext("ANY USER");
else
} else {
echo htmlspecialchars($secretent['ident']);
}
?>
</td>
<td class="listr gray">
......@@ -138,9 +145,12 @@ include("head.inc");
</form>
&nbsp;</td>
</tr>
<?php $i++; endforeach; ?>
<?php $i++;
endforeach; ?>
<?php $i = 0; foreach ($a_secret as $secretent): ?>
<?php $i = 0; foreach ($a_secret as $secretent) :
?>
<tr>
<td class="listlr">
<?=htmlspecialchars($secretent['ident']);?>
......@@ -148,10 +158,17 @@ include("head.inc");
<td class="listr">
<?=htmlspecialchars($secretent['pre-shared-key']);?>
</td>
<td class="list nowrap"><a href="vpn_ipsec_keys_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0" alt="edit" /></a>
&nbsp;<a href="vpn_ipsec_keys.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Pre-Shared Key?"); ?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete key"); ?>" width="17" height="17" border="0" alt="delete" /></a></td>
<td class="list nowrap"><a href="vpn_ipsec_keys_edit.php?id=<?=$i;
?>"><img src="./themes/<?= $g['theme'];
?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0" alt="edit" /></a>
&nbsp;<a href="vpn_ipsec_keys.php?act=del&amp;id=<?=$i;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this Pre-Shared Key?");
?>')"><img src="./themes/<?= $g['theme'];
?>/images/icons/icon_x.gif" title="<?=gettext("delete key"); ?>" width="17" height="17" border="0" alt="delete" /></a></td>
</tr>
<?php $i++; endforeach; ?>
<?php $i++;
endforeach; ?>
<tr>
<td class="list" colspan="2"></td>
<td class="list">
......@@ -183,4 +200,4 @@ include("head.inc");
</div>
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
......@@ -41,10 +41,12 @@ if (!is_array($config['ipsec']['mobilekey'])) {
ipsec_mobilekey_sort();
$a_secret = &$config['ipsec']['mobilekey'];
if (is_numericint($_GET['id']))
if (is_numericint($_GET['id'])) {
$id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id']))
}
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id'];
}
if (isset($id) && $a_secret[$id]) {
$pconfig['ident'] = $a_secret[$id]['ident'];
......@@ -66,11 +68,13 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (preg_match("/[^a-zA-Z0-9@\.\-]/", $_POST['ident']))
if (preg_match("/[^a-zA-Z0-9@\.\-]/", $_POST['ident'])) {
$input_errors[] = gettext("The identifier contains invalid characters.");
}
if (array_key_exists($_POST['ident'], $userids))
if (array_key_exists($_POST['ident'], $userids)) {
$input_errors[] = gettext("A user with this name already exists. Add the key to the user instead.");
}
unset($userids);
if (!$input_errors && !(isset($id) && $a_secret[$id])) {
......@@ -84,9 +88,9 @@ if ($_POST) {
}
if (!$input_errors) {
if (isset($id) && $a_secret[$id])
if (isset($id) && $a_secret[$id]) {
$secretent = $a_secret[$id];
}
$secretent['ident'] = $_POST['ident'];
$secretent['pre-shared-key'] = $_POST['psk'];
......@@ -123,7 +127,9 @@ include("head.inc");
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($input_errors) {
print_input_errors($input_errors);
} ?>
<section class="col-xs-12">
......@@ -136,7 +142,8 @@ include("head.inc");
<tr>
<td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td>
<td class="vtable">
<?=$mandfldhtml;?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=htmlspecialchars($pconfig['ident']);?>" />
<?=$mandfldhtml;
?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=htmlspecialchars($pconfig['ident']);?>" />
<br />
<?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>.
</td>
......@@ -144,16 +151,19 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>" />
<?=$mandfldhtml;
?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>" />
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<?php if (isset($id) && $a_secret[$id]): ?>
<?php if (isset($id) && $a_secret[$id]) :
?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
<?php
endif; ?>
</td>
</tr>
</table>
......@@ -174,4 +184,4 @@ include("head.inc");
</div>
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -40,48 +40,50 @@ if (!is_array($config['ipsec'])) {
$pconfig['noinstalllanspd'] = $config['system']['noinstalllanspd'];
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
foreach ($ipsec_loglevels as $lkey => $ldescr) {
if (!empty($config['ipsec']["ipsec_{$lkey}"]))
if (!empty($config['ipsec']["ipsec_{$lkey}"])) {
$pconfig["ipsec_{$lkey}"] = $config['ipsec']["ipsec_{$lkey}"];
}
}
$pconfig['failoverforcereload'] = isset($config['ipsec']['failoverforcereload']);
$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
$pconfig['maxmss'] = $config['system']['maxmss'];
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
if (!$input_errors) {
if($_POST['noinstalllanspd'] == "yes") {
if ($_POST['noinstalllanspd'] == "yes") {
$config['system']['noinstalllanspd'] = true;
} else {
if (isset($config['system']['noinstalllanspd']))
if (isset($config['system']['noinstalllanspd'])) {
unset($config['system']['noinstalllanspd']);
}
}
if($_POST['preferoldsa_enable'] == "yes")
if ($_POST['preferoldsa_enable'] == "yes") {
$config['ipsec']['preferoldsa'] = true;
elseif (isset($config['ipsec']['preferoldsa']))
} elseif (isset($config['ipsec']['preferoldsa']))
unset($config['ipsec']['preferoldsa']);
if (is_array($config['ipsec'])) {
foreach ($ipsec_loglevels as $lkey => $ldescr) {
if (empty($_POST["ipsec_{$lkey}"])) {
if (isset($config['ipsec']["ipsec_{$lkey}"]))
if (isset($config['ipsec']["ipsec_{$lkey}"])) {
unset($config['ipsec']["ipsec_{$lkey}"]);
} else
}
} else {
$config['ipsec']["ipsec_{$lkey}"] = $_POST["ipsec_{$lkey}"];
}
}
}
if($_POST['failoverforcereload'] == "yes")
if ($_POST['failoverforcereload'] == "yes") {
$config['ipsec']['failoverforcereload'] = true;
elseif (isset($config['ipsec']['failoverforcereload']))
} elseif (isset($config['ipsec']['failoverforcereload']))
unset($config['ipsec']['failoverforcereload']);
if($_POST['maxmss_enable'] == "yes") {
if ($_POST['maxmss_enable'] == "yes") {
$config['system']['maxmss_enable'] = true;
$config['system']['maxmss'] = $_POST['maxmss'];
} else {
......@@ -93,10 +95,11 @@ if ($_POST) {
$retval = 0;
$retval = filter_configure();
if(stristr($retval, "error") <> true)
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message(gettext($retval));
else
} else {
$savemsg = gettext($retval);
}
vpn_ipsec_configure_preferoldsa();
vpn_ipsec_configure();
......@@ -135,16 +138,19 @@ function maxmss_checked(obj) {
<?php
if ($savemsg)
if ($savemsg) {
print_info_box($savemsg);
if ($input_errors)
}
if ($input_errors) {
print_input_errors($input_errors);
}
?>
<section class="col-xs-12">
<? $active_tab = "/vpn_ipsec_settings.php"; include('vpn_ipsec_tabs.inc'); ?>
<? $active_tab = "/vpn_ipsec_settings.php";
include('vpn_ipsec_tabs.inc'); ?>
<div class="tab-content content-box col-xs-12">
......@@ -164,7 +170,9 @@ function maxmss_checked(obj) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("LAN security associsations"); ?></td>
<td width="78%" class="vtable">
<input name="noinstalllanspd" type="checkbox" id="noinstalllanspd" value="yes" <?php if ($pconfig['noinstalllanspd']) echo "checked=\"checked\""; ?> />
<input name="noinstalllanspd" type="checkbox" id="noinstalllanspd" value="yes" <?php if ($pconfig['noinstalllanspd']) {
echo "checked=\"checked\"";
} ?> />
<strong><?=gettext("Do not install LAN SPD"); ?></strong>
<br />
<?=gettext("By default, if IPSec is enabled negating SPD are inserted to provide protection. " .
......@@ -174,7 +182,9 @@ function maxmss_checked(obj) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Security Associations"); ?></td>
<td width="78%" class="vtable">
<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked=\"checked\""; ?> />
<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) {
echo "checked=\"checked\"";
} ?> />
<strong><?=gettext("Prefer older IPsec SAs"); ?></strong>
<br />
<?=gettext("By default, if several SAs match, the newest one is " .
......@@ -188,22 +198,25 @@ function maxmss_checked(obj) {
<strong><?=gettext("Start IPSec in debug mode based on sections selected"); ?></strong>
<br />
<table summary="ipsec debug">
<?php foreach ($ipsec_loglevels as $lkey => $ldescr): ?>
<?php foreach ($ipsec_loglevels as $lkey => $ldescr) :
?>
<tr>
<td width="22%" valign="top" class="vncell"><?=$ldescr;?></td>
<td width="78%" valign="top" class="vncell">
<?php echo "<select name=\"ipsec_{$lkey}\" id=\"ipsec_{$lkey}\">\n";
foreach (array("Silent", "Audit", "Control", "Diag", "Raw", "Highest") as $lidx => $lvalue) {
echo "<option value=\"{$lidx}\" ";
if ($pconfig["ipsec_{$lkey}"] == $lidx)
if ($pconfig["ipsec_{$lkey}"] == $lidx) {
echo "selected=\"selected\"";
}
echo ">{$lvalue}</option>\n";
}
?>
</select>
</td>
</tr>
<?php endforeach; ?>
<?php
endforeach; ?>
<tr style="display:none;"><td></td></tr>
</table>
<br /><?=gettext("Launches IPSec in debug mode so that more verbose logs " .
......@@ -213,7 +226,9 @@ function maxmss_checked(obj) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("IPsec Reload on Failover"); ?></td>
<td width="78%" class="vtable">
<input name="failoverforcereload" type="checkbox" id="failoverforcereload" value="yes" <?php if ($pconfig['failoverforcereload']) echo "checked=\"checked\""; ?> />
<input name="failoverforcereload" type="checkbox" id="failoverforcereload" value="yes" <?php if ($pconfig['failoverforcereload']) {
echo "checked=\"checked\"";
} ?> />
<strong><?=gettext("Force IPsec Reload on Failover"); ?></strong>
<br />
<?=gettext("In some circumstances using a gateway group as the interface for " .
......@@ -225,10 +240,19 @@ function maxmss_checked(obj) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Maximum MSS"); ?></td>
<td width="78%" class="vtable">
<input name="maxmss_enable" type="checkbox" id="maxmss_enable" value="yes" <?php if ($pconfig['maxmss_enable'] == true) echo "checked=\"checked\""; ?> onclick="maxmss_checked(this)" />
<input name="maxmss_enable" type="checkbox" id="maxmss_enable" value="yes" <?php if ($pconfig['maxmss_enable'] == true) {
echo "checked=\"checked\"";
} ?> onclick="maxmss_checked(this)" />
<strong><?=gettext("Enable MSS clamping on VPN traffic"); ?></strong>
<br />
<input name="maxmss" id="maxmss" value="<?php if ($pconfig['maxmss'] <> "") echo $pconfig['maxmss']; else "1400"; ?>" class="formfld unknown" <?php if ($pconfig['maxmss_enable'] == false) echo "disabled=\"disabled\""; ?> />
<input name="maxmss" id="maxmss" value="<?php if ($pconfig['maxmss'] <> "") {
echo $pconfig['maxmss'];
} else {
"1400";
} ?>" class="formfld unknown" <?php if ($pconfig['maxmss_enable'] == false) {
echo "disabled=\"disabled\"";
} ?> />
<br />
<?=gettext("Enable MSS clamping on TCP flows over VPN. " .
"This helps overcome problems with PMTUD on IPsec VPN links. If left blank, the default value is 1400 bytes. "); ?>
......@@ -249,4 +273,4 @@ function maxmss_checked(obj) {
</div>
</div>
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
......@@ -5,4 +5,3 @@
$tab_array[2] = array(gettext("Pre-Shared Keys"), $_SERVER['PHP_SELF'] == "/vpn_ipsec_keys.php", "vpn_ipsec_keys.php");
$tab_array[3] = array(gettext("Advanced Settings"), $_SERVER['PHP_SELF'] == "/vpn_ipsec_settings.php", "vpn_ipsec_settings.php");
display_top_tabs($tab_array);
?>
This diff is collapsed.
......@@ -38,7 +38,6 @@ if (!is_array($config['l2tp']['user'])) {
$a_secret = &$config['l2tp']['user'];
if ($_POST) {
$pconfig = $_POST;
if ($_POST['apply']) {
......@@ -48,10 +47,11 @@ if ($_POST) {
}
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (is_subsystem_dirty('l2tpusers'))
if (is_subsystem_dirty('l2tpusers')) {
clear_subsystem_dirty('l2tpusers');
}
}
}
}
if ($_GET['act'] == "del") {
......@@ -80,12 +80,17 @@ $main_buttons = array(
<div class="container-fluid">
<div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (isset($config['l2tp']['radius']['enable']))
print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used.")); ?>
<?php if (is_subsystem_dirty('l2tpusers')): ?><br/>
<?php if ($savemsg) {
print_info_box($savemsg);
} ?>
<?php if (isset($config['l2tp']['radius']['enable'])) {
print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used."));
} ?>
<?php if (is_subsystem_dirty('l2tpusers')) :
?><br/>
<?php print_info_box_np(gettext("The l2tp user list has been modified") . ".<br />" . gettext("You must apply the changes in order for them to take effect") . ".<br /><b>" . gettext("Warning: this will terminate all current l2tp sessions!") . "</b>");?>
<?php endif; ?>
<?php
endif; ?>
<div id="inputerrors"></div>
......@@ -110,23 +115,30 @@ $main_buttons = array(
<td class="listhdr"><?=gettext("IP address");?></td>
<td class="list"></td>
</tr>
<?php $i = 0; foreach ($a_secret as $secretent): ?>
<?php $i = 0; foreach ($a_secret as $secretent) :
?>
<tr>
<td class="listlr">
<?=htmlspecialchars($secretent['name']);?>
</td>
<td class="listr">
<?php if($secretent['ip'] == "") $secretent['ip'] = "Dynamic"; ?>
<?php if ($secretent['ip'] == "") {
$secretent['ip'] = "Dynamic";
} ?>
<?=htmlspecialchars($secretent['ip']);?>&nbsp;
</td>
<td class="list nowrap" width="150">
<a href="vpn_l2tp_users_edit.php?id=<?=$i;?>" class="btn btn-default"><span class="glyphicon glyphicon-edit"></span></a>
<a href="vpn_l2tp_users.php?act=del&amp;id=<?=$i;?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this user?");?>')"title="<?=gettext("delete user"); ?>"><span class="glyphicon glyphicon-remove"></span></a>
<a href="vpn_l2tp_users.php?act=del&amp;id=<?=$i;
?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this user?");
?>')"title="<?=gettext("delete user"); ?>"><span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
<?php $i++; endforeach; ?>
<?php $i++;
endforeach; ?>
</table>
</div>
......@@ -138,4 +150,4 @@ $main_buttons = array(
</div>
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
......@@ -29,15 +29,18 @@
$pgtitle = array(gettext("VPN"),gettext("L2TP"),gettext("User"),gettext("Edit"));
$shortcut_section = "l2tps";
function l2tpusercmp($a, $b) {
function l2tpusercmp($a, $b)
{
return strcasecmp($a['name'], $b['name']);
}
function l2tp_users_sort() {
function l2tp_users_sort()
{
global $config;
if (!is_array($config['l2tp']['user']))
if (!is_array($config['l2tp']['user'])) {
return;
}
usort($config['l2tp']['user'], "l2tpusercmp");
}
......@@ -52,10 +55,12 @@ if (!is_array($config['l2tp']['user'])) {
}
$a_secret = &$config['l2tp']['user'];
if (is_numericint($_GET['id']))
if (is_numericint($_GET['id'])) {
$id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id']))
}
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id'];
}
if (isset($id) && $a_secret[$id]) {
$pconfig['usernamefld'] = $a_secret[$id]['name'];
......@@ -63,7 +68,6 @@ if (isset($id) && $a_secret[$id]) {
}
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
......@@ -78,11 +82,13 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['usernamefld']))
if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['usernamefld'])) {
$input_errors[] = gettext("The username contains invalid characters.");
}
if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['passwordfld']))
if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['passwordfld'])) {
$input_errors[] = gettext("The password contains invalid characters.");
}
if (($_POST['passwordfld']) && ($_POST['passwordfld'] != $_POST['password2'])) {
$input_errors[] = gettext("The passwords do not match.");
......@@ -102,26 +108,28 @@ if ($_POST) {
}
/* if this is an AJAX caller then handle via JSON */
if(isAjax() && is_array($input_errors)) {
if (isAjax() && is_array($input_errors)) {
input_errors2Ajax($input_errors);
exit;
}
if (!$input_errors) {
if (isset($id) && $a_secret[$id])
if (isset($id) && $a_secret[$id]) {
$secretent = $a_secret[$id];
}
$secretent['name'] = $_POST['usernamefld'];
$secretent['ip'] = $_POST['ip'];
if ($_POST['passwordfld'])
if ($_POST['passwordfld']) {
$secretent['password'] = $_POST['passwordfld'];
}
if (isset($id) && $a_secret[$id])
if (isset($id) && $a_secret[$id]) {
$a_secret[$id] = $secretent;
else
} else {
$a_secret[] = $secretent;
}
l2tp_users_sort();
write_config();
......@@ -144,7 +152,9 @@ include("head.inc");
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($input_errors) {
print_input_errors($input_errors);
} ?>
<div id="inputerrors"></div>
......@@ -167,7 +177,8 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="usernamefld" type="text" class="form-control user" id="usernamefld" size="20" value="<?=htmlspecialchars($pconfig['usernamefld']);?>" />
<?=$mandfldhtml;
?><input name="usernamefld" type="text" class="form-control user" id="usernamefld" size="20" value="<?=htmlspecialchars($pconfig['usernamefld']);?>" />
</td>
</tr>
<tr>
......@@ -175,9 +186,11 @@ include("head.inc");
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="passwordfld" type="password" class="form-control pwd" id="passwordfld" size="20" />
<br /><?=$mandfldhtml;?><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
&nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]): ?><br />
&nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) :
?><br />
<p class="text-muted"><em><small><?=gettext("If you want to change the users password, enter it here twice.");?></small></em></p>
<?php endif; ?></td>
<?php
endif; ?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("IP address");?></td>
......@@ -189,10 +202,13 @@ include("head.inc");
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input id="submit" name="Submit" type="submit" class="btn btn-primary" value="<?=gettext('Save');?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
<?php if (isset($id) && $a_secret[$id]): ?>
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");
?>" onclick="window.location.href='<?=$referer;?>'" />
<?php if (isset($id) && $a_secret[$id]) :
?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
<?php
endif; ?>
</td>
</tr>
</table>
......@@ -205,4 +221,4 @@ include("head.inc");
</div>
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -48,8 +48,9 @@ if ($_POST) {
if (file_exists('/tmp/.vpn_pppoe.apply')) {
$toapplylist = unserialize(file_get_contents('/tmp/.vpn_pppoe.apply'));
foreach ($toapplylist as $pppoeid) {
if (!is_numeric($pppoeid))
if (!is_numeric($pppoeid)) {
continue;
}
if (is_array($config['pppoes']['pppoe'])) {
foreach ($config['pppoes']['pppoe'] as $pppoe) {
if ($pppoe['pppoeid'] == $pppoeid) {
......@@ -95,10 +96,14 @@ $main_buttons = array(
<div class="container-fluid">
<div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('vpnpppoe')): ?><br/>
<?php if ($savemsg) {
print_info_box($savemsg);
} ?>
<?php if (is_subsystem_dirty('vpnpppoe')) :
?><br/>
<?php print_info_box_np(gettext("The PPPoE entry list has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?>
<?php endif; ?>
<?php
endif; ?>
......@@ -120,7 +125,8 @@ $main_buttons = array(
<td width="10%" class="list">
</td>
</tr>
<?php $i = 0; foreach ($a_pppoes as $pppoe): ?>
<?php $i = 0; foreach ($a_pppoes as $pppoe) :
?>
<tr>
<td class="listlr" ondblclick="document.location='vpn_pppoe_edit.php?id=<?=$i;?>';">
<?=htmlspecialchars(strtoupper($pppoe['interface']));?>
......@@ -135,12 +141,17 @@ $main_buttons = array(
<?=htmlspecialchars($pppoe['descr']);?>&nbsp;
</td>
<td valign="middle" class="list nowrap">
<a href="vpn_pppoe_edit.php?id=<?=$i;?>" title="<?=gettext("edit pppoe instance"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="vpn_pppoe_edit.php?id=<?=$i;
?>" title="<?=gettext("edit pppoe instance"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="vpn_pppoe.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry? All elements that still use it will become invalid (e.g. filter rules)!");?>')" title="<?=gettext("delete pppoe instance");?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
<a href="vpn_pppoe.php?act=del&amp;id=<?=$i;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry? All elements that still use it will become invalid (e.g. filter rules)!");
?>')" title="<?=gettext("delete pppoe instance");?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
<?php $i++; endforeach; ?>
<?php $i++;
endforeach; ?>
</table>
</div>
......@@ -152,4 +163,4 @@ $main_buttons = array(
</div>
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
This diff is collapsed.
This diff is collapsed.
......@@ -36,7 +36,6 @@ if (!is_array($config['pptpd']['user'])) {
$a_secret = &$config['pptpd']['user'];
if ($_POST) {
$pconfig = $_POST;
if ($_POST['apply']) {
......@@ -44,10 +43,11 @@ if ($_POST) {
$retval = vpn_setup();
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (is_subsystem_dirty('pptpusers'))
if (is_subsystem_dirty('pptpusers')) {
clear_subsystem_dirty('pptpusers');
}
}
}
}
if ($_GET['act'] == "del") {
......@@ -77,12 +77,17 @@ $main_buttons = array(
<div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (isset($config['pptpd']['radius']['enable']))
print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used.")); ?>
<?php if (is_subsystem_dirty('pptpusers')): ?><br/>
<?php if ($savemsg) {
print_info_box($savemsg);
} ?>
<?php if (isset($config['pptpd']['radius']['enable'])) {
print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used."));
} ?>
<?php if (is_subsystem_dirty('pptpusers')) :
?><br/>
<?php print_info_box_np(gettext("The PPTP user list has been modified").".<br />".gettext("You must apply the changes in order for them to take effect").".<br /></b><b>".gettext("Warning: this will terminate all current PPTP sessions")."!");?><br />
<?php endif; ?>
<?php
endif; ?>
<section class="col-xs-12">
......@@ -106,7 +111,8 @@ $main_buttons = array(
</td>
</tr>
<?php $i = 0; foreach ($a_secret as $secretent): ?>
<?php $i = 0; foreach ($a_secret as $secretent) :
?>
<tr>
<td class="listlr">
<?=htmlspecialchars($secretent['name']);?>
......@@ -117,9 +123,13 @@ $main_buttons = array(
<td class="list nowrap">
<a href="vpn_pptp_users_edit.php?id=<?=$i;?>" class="btn btn-default"><span class="glyphicon glyphicon-edit"></span></a>
<a href="vpn_pptp_users.php?act=del&amp;id=<?=$i;?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this user?");?>')"title="<?=gettext("delete user"); ?>"><span class="glyphicon glyphicon-remove"></span></a></td>
<a href="vpn_pptp_users.php?act=del&amp;id=<?=$i;
?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this user?");
?>')"title="<?=gettext("delete user"); ?>"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
<?php $i++; endforeach; ?>
<?php $i++;
endforeach; ?>
</table>
</div>
......@@ -131,4 +141,4 @@ $main_buttons = array(
</div>
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment