Commit 4734cb7b authored by Franco Fichtner's avatar Franco Fichtner

vpn: moar style for almost all pages

parent 5708d2fd
This diff is collapsed.
......@@ -64,8 +64,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
} else {
// nothing to post, redirect
header("Location: vpn_ipsec_keys.php");
exit;
header("Location: vpn_ipsec_keys.php");
exit;
}
}
......@@ -110,12 +110,12 @@ $( document ).ready(function() {
<div class="container-fluid">
<div class="row">
<?php
if (isset($savemsg)) {
print_info_box($savemsg);
}
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."));
}
if (isset($savemsg)) {
print_info_box($savemsg);
}
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">
......@@ -136,45 +136,48 @@ $( document ).ready(function() {
</tr>
<?php $i = 0;
$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);
;
}
}
foreach ($userkeys as $secretent) :
foreach ($config['system']['user'] as $id => $user) {
if (!empty($user['ipsecpsk'])) {
$userkeys[] = array('ident' => $user['name'], 'pre-shared-key' => $user['ipsecpsk'], 'id' => $id);
;
}
}
foreach ($userkeys as $secretent) :
?>
<tr>
<td>
<?=$secretent['ident'] == 'allusers' ? gettext("ANY USER") : htmlspecialchars($secretent['ident']) ;?>
</td>
<td>
<?=htmlspecialchars($secretent['pre-shared-key']);?>
</td>
<td>
<a href="system_usermanager.php?userid=<?=$secretent['id'];?>&act=edit" title="<?=gettext("edit"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
</tr>
<tr>
<td>
<?=$secretent['ident'] == 'allusers' ? gettext("ANY USER") : htmlspecialchars($secretent['ident']) ;?>
</td>
<td>
<?=htmlspecialchars($secretent['pre-shared-key']);?>
</td>
<td>
<a href="system_usermanager.php?userid=<?=$secretent['id'];
?>&act=edit" title="<?=gettext("edit"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
</tr>
<?php $i++;
endforeach; ?>
endforeach; ?>
<?php
$i = 0;
foreach ($config['ipsec']['mobilekey'] as $secretent) :
foreach ($config['ipsec']['mobilekey'] as $secretent) :
?>
<tr>
<td>
<?=htmlspecialchars($secretent['ident']);?>
</td>
<td>
<?=htmlspecialchars($secretent['pre-shared-key']);?>
</td>
<td>
<a href="vpn_ipsec_keys_edit.php?id=<?=$i;?>" title="<?=gettext("edit key"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a id="del_<?=$i;?>" title="<?=gettext("delete key"); ?>" class="act_delete btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
<tr>
<td>
<?=htmlspecialchars($secretent['ident']);?>
</td>
<td>
<?=htmlspecialchars($secretent['pre-shared-key']);?>
</td>
<td>
<a href="vpn_ipsec_keys_edit.php?id=<?=$i;
?>" title="<?=gettext("edit key"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a id="del_<?=$i;
?>" title="<?=gettext("delete key"); ?>" class="act_delete btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
<?php $i++;
endforeach; ?>
endforeach; ?>
<tr>
<td colspan="2"></td>
<td>
......
......@@ -44,7 +44,7 @@ if (!isset($config['ipsec']['mobilekey'])) {
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = array();
if(isset($_GET['id']) && is_numericint($_GET['id']) && isset($config['ipsec']['mobilekey'][$_GET['id']])) {
if (isset($_GET['id']) && is_numericint($_GET['id']) && isset($config['ipsec']['mobilekey'][$_GET['id']])) {
// fetch record
$id = $_GET['id'];
$pconfig['ident'] = $config['ipsec']['mobilekey'][$id]['ident'];
......@@ -58,7 +58,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors = array();
$pconfig = $_POST;
// fetch record number if valid
if (isset($_POST['id']) && is_numericint($_POST['id']) && isset($config['ipsec']['mobilekey'][$_POST['id']]) ) {
if (isset($_POST['id']) && is_numericint($_POST['id']) && isset($config['ipsec']['mobilekey'][$_POST['id']])) {
$id = $_POST['id'];
} else {
$id = null;
......@@ -133,7 +133,7 @@ include("head.inc");
<div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) {
print_input_errors($input_errors);
}
}
?>
<section class="col-xs-12">
<div class="content-box">
......
This diff is collapsed.
This diff is collapsed.
......@@ -142,12 +142,12 @@ function maxmss_checked(obj) {
<div class="row">
<?php
if (isset($savemsg)) {
print_info_box($savemsg);
}
if (isset($input_errors) && count($input_errors) > 0) {
print_input_errors($input_errors);
}
if (isset($savemsg)) {
print_info_box($savemsg);
}
if (isset($input_errors) && count($input_errors) > 0) {
print_input_errors($input_errors);
}
?>
<section class="col-xs-12">
<? $active_tab = "/vpn_ipsec_settings.php";
......@@ -169,7 +169,7 @@ function maxmss_checked(obj) {
<input name="noinstalllanspd" type="checkbox" id="noinstalllanspd" value="yes" <?=!empty($pconfig['noinstalllanspd']) ? "checked=\"checked\"" : "";?> />
<strong><?=gettext("Do not install LAN SPD"); ?></strong>
<div class="hidden" for="help_for_noinstalllanspd">
<?=gettext("By default, if IPSec is enabled negating SPD are inserted to provide protection. " .
<?=gettext("By default, if IPSec is enabled negating SPD are inserted to provide protection. " .
"This behaviour can be changed by enabling this setting which will prevent installing these SPDs."); ?>
</div>
</td>
......@@ -180,7 +180,7 @@ function maxmss_checked(obj) {
<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?= !empty($pconfig['preferoldsa_enable']) ? "checked=\"checked\"" : "";?> />
<strong><?=gettext("Prefer older IPsec SAs"); ?></strong>
<div class="hidden" for="help_for_preferoldsa_enable">
<?=gettext("By default, if several SAs match, the newest one is " .
<?=gettext("By default, if several SAs match, the newest one is " .
"preferred if it's at least 30 seconds old. Select this " .
"option to always prefer old SAs over new ones."); ?>
</div>
......@@ -196,16 +196,16 @@ function maxmss_checked(obj) {
?>
<?=$ldescr?>
<select name="ipsec_<?=$lkey?>" id="ipsec_<?=$lkey?>">
<?php foreach (array("Silent", "Audit", "Control", "Diag", "Raw", "Highest") as $lidx => $lvalue):
<?php foreach (array("Silent", "Audit", "Control", "Diag", "Raw", "Highest") as $lidx => $lvalue) :
?>
<option value="<?=$lidx?>" <?= isset($pconfig["ipsec_{$lkey}"]) && $pconfig["ipsec_{$lkey}"] == $lidx ? "selected=\"selected\"" : "";?> ?>
<?=$lvalue?>
<?=$lvalue?>
</option>
<?php
endforeach; ?>
endforeach; ?>
</select>
<?php
endforeach; ?>
endforeach; ?>
<div class="hidden" for="help_for_ipsec_debug">
<?=gettext("Launches IPSec in debug mode so that more verbose logs " .
"will be generated to aid in troubleshooting."); ?>
......@@ -218,7 +218,7 @@ function maxmss_checked(obj) {
<input name="failoverforcereload" type="checkbox" id="failoverforcereload" value="yes" <?= !empty($pconfig['failoverforcereload']) ? "checked=\"checked\"" : "";?> />
<strong><?=gettext("Force IPsec Reload on Failover"); ?></strong>
<div class="hidden" for="help_for_failoverforcereloadg">
<?=gettext("In some circumstances using a gateway group as the interface for " .
<?=gettext("In some circumstances using a gateway group as the interface for " .
"an IPsec tunnel does not function properly, and IPsec must be forcefully reloaded " .
"when a failover occurs. Because this will disrupt all IPsec tunnels, this behavior" .
" is disabled by default. Check this box to force IPsec to fully reload on failover."); ?>
......@@ -230,7 +230,8 @@ function maxmss_checked(obj) {
<td>
<input name="maxmss_enable" type="checkbox" id="maxmss_enable" value="yes" <?= !empty($pconfig['maxmss_enable']) ? "checked=\"checked\"" : "" ;?> onclick="maxmss_checked()" />
<strong><?=gettext("Enable MSS clamping on VPN traffic"); ?></strong>
<input name="maxmss" id="maxmss" type="text" value="<?= !empty($pconfig['maxmss']) ? $pconfig['maxmss'] : "1400";?>" <?= !empty($pconfig['maxmss_enable']) ? "disabled=\"disabled\"" : "" ;?> />
<input name="maxmss" id="maxmss" type="text" value="<?= !empty($pconfig['maxmss']) ? $pconfig['maxmss'] : "1400";
?>" <?= !empty($pconfig['maxmss_enable']) ? "disabled=\"disabled\"" : "" ;?> />
<div class="hidden" for="help_for_maxmss_enable">
<?=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. "); ?>
......
This diff is collapsed.
This diff is collapsed.
......@@ -74,19 +74,19 @@ if (isset($config['openvpn']['openvpn-server'])) {
$ras_userent['certname'] = $cert['descr'];
$ras_user[] = $ras_userent;
}
}
}
}
}
} elseif (($server['mode'] == "server_tls") || (($server['mode'] == "server_tls_user") && ($server['authmode'] != "Local Database"))) {
if (isset($config['cert'])) {
foreach ($config['cert'] as $cindex => $cert) {
if (($cert['caref'] != $server['caref']) || ($cert['refid'] == $server['certref'])) {
continue;
}
$ras_cert_entry['cindex'] = $cindex;
$ras_cert_entry['certname'] = $cert['descr'];
$ras_cert_entry['certref'] = $cert['refid'];
$ras_certs[] = $ras_cert_entry;
}
foreach ($config['cert'] as $cindex => $cert) {
if (($cert['caref'] != $server['caref']) || ($cert['refid'] == $server['certref'])) {
continue;
}
$ras_cert_entry['cindex'] = $cindex;
$ras_cert_entry['certname'] = $cert['descr'];
$ras_cert_entry['certref'] = $cert['refid'];
$ras_certs[] = $ras_cert_entry;
}
}
}
......@@ -174,18 +174,18 @@ if (isset($config['openvpn']['openvpn-server'])) {
}
if (isset($_GET['proxy_authtype'])) {
$proxy['proxy_authtype'] = $_GET['proxy_authtype'];
if ($_GET['proxy_authtype'] != "none") {
if (empty($_GET['proxy_user'])) {
$input_errors[] = "You need to specify a username with the proxy config.";
} else {
$proxy['user'] = $_GET['proxy_user'];
}
if (!empty($_GET['proxy_user']) && empty($_GET['proxy_password'])) {
$input_errors[] = "You need to specify a password with the proxy user.";
} else {
$proxy['password'] = $_GET['proxy_password'];
}
}
if ($_GET['proxy_authtype'] != "none") {
if (empty($_GET['proxy_user'])) {
$input_errors[] = "You need to specify a username with the proxy config.";
} else {
$proxy['user'] = $_GET['proxy_user'];
}
if (!empty($_GET['proxy_user']) && empty($_GET['proxy_password'])) {
$input_errors[] = "You need to specify a password with the proxy user.";
} else {
$proxy['password'] = $_GET['proxy_password'];
}
}
}
}
......@@ -623,7 +623,7 @@ if (isset($savemsg)) {
$tab_array[] = array(gettext("Client Export"), true, "vpn_openvpn_export.php");
$tab_array[] = array(gettext("Shared Key Export"), false, "vpn_openvpn_export_shared.php");
display_top_tabs($tab_array);
?>
?>
<div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table width="100%" border="0" class="table table-striped" cellpadding="0" cellspacing="0">
......@@ -640,9 +640,10 @@ if (isset($savemsg)) {
<select name="server" id="server" class="formselect" onchange="server_changed()">
<?php foreach ($ras_server as & $server) :
?>
<option value="<?=$server['index'];?>"><?=htmlspecialchars($server['name']);?></option>
<option value="<?=$server['index'];
?>"><?=htmlspecialchars($server['name']);?></option>
<?php
endforeach; ?>
endforeach; ?>
</select>
</td>
</tr>
......@@ -656,19 +657,21 @@ if (isset($savemsg)) {
<option value="serverhostname" ><?=gettext("Installation hostname");?></option>
<?php if (isset($config['dyndnses']['dyndns'])) :
?>
<?php foreach ($config['dyndnses']['dyndns'] as $ddns) :
<?php foreach ($config['dyndnses']['dyndns'] as $ddns) :
?>
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<?php
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");
?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<?php
endforeach; ?>
<?php
endif; ?>
<?php if (isset($config['dnsupdates']['dnsupdate'])) :
?>
<?php foreach ($config['dnsupdates']['dnsupdate'] as $ddns) :
<?php foreach ($config['dnsupdates']['dnsupdate'] as $ddns) :
?>
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<?php
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");
?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<?php
endforeach; ?>
<?php
endif; ?>
......@@ -676,7 +679,7 @@ endif; ?>
</select>
<div id="HostName" style="display:none;" >
<div>
<?=gettext("Enter the hostname or IP address the client will use to connect to this server.");?>
<?=gettext("Enter the hostname or IP address the client will use to connect to this server.");?>
</div>
<input name="useaddr_hostname" type="text" id="useaddr_hostname" size="40" />
</div>
......@@ -745,7 +748,7 @@ endif; ?>
<?=gettext("Port");?> :
<input name="proxyport" id="proxyport" type="text" class="formfld unknown" size="5" value="" />
<div>
<?=gettext("Choose proxy authentication if any.");?>
<?=gettext("Choose proxy authentication if any.");?>
<select name="useproxypass" id="useproxypass" class="formselect" onchange="useproxy_changed(this)">
<option value="none"><?=gettext("none");?></option>
<option value="basic"><?=gettext("basic");?></option>
......@@ -754,9 +757,9 @@ endif; ?>
<div id="useproxypass_opts" style="display:none">
<?=gettext("Username");?> :
<input name="proxyuser" id="proxyuser" type="text" class="formfld unknown" size="20" value="" />
<?=gettext("Password");?> :
<?=gettext("Password");?> :
<input name="proxypass" id="proxypass" type="password" class="formfld pwd" size="20" value="" />
<?=gettext("Confirm");?> :
<?=gettext("Confirm");?> :
<input name="proxyconf" id="proxyconf" type="password" class="formfld pwd" size="20" value="" />
</div>
</div>
......
......@@ -38,28 +38,28 @@ $pgtitle = array("OpenVPN", "Client Export Utility");
$ras_server = array();
if (isset($config['openvpn']['openvpn-server'])) {
foreach ($config['openvpn']['openvpn-server'] as $sindex => $server) {
if (isset($server['disable'])) {
continue;
}
$ras_user = array();
if ($server['mode'] != "p2p_shared_key") {
continue;
}
$ras_serverent = array();
$prot = $server['protocol'];
$port = $server['local_port'];
if ($server['description']) {
$name = "{$server['description']} {$prot}:{$port}";
} else {
$name = "Shared Key Server {$prot}:{$port}";
}
$ras_serverent['index'] = $sindex;
$ras_serverent['name'] = $name;
$ras_serverent['mode'] = $server['mode'];
$ras_server[] = $ras_serverent;
}
foreach ($config['openvpn']['openvpn-server'] as $sindex => $server) {
if (isset($server['disable'])) {
continue;
}
$ras_user = array();
if ($server['mode'] != "p2p_shared_key") {
continue;
}
$ras_serverent = array();
$prot = $server['protocol'];
$port = $server['local_port'];
if ($server['description']) {
$name = "{$server['description']} {$prot}:{$port}";
} else {
$name = "Shared Key Server {$prot}:{$port}";
}
$ras_serverent['index'] = $sindex;
$ras_serverent['name'] = $name;
$ras_serverent['mode'] = $server['mode'];
$ras_server[] = $ras_serverent;
}
}
if (isset($_GET['act'])) {
......@@ -67,7 +67,7 @@ if (isset($_GET['act'])) {
$act = $_GET['act'];
if (($act == "skconf") || ($act == "skzipconf")) {
$srvid = isset($_GET['srvid']) ? $_GET['srvid'] : false;
if ( $srvid === false || !isset($config['openvpn']['openvpn-server'][$srvid]['mode']) ||
if ($srvid === false || !isset($config['openvpn']['openvpn-server'][$srvid]['mode']) ||
$config['openvpn']['openvpn-server'][$srvid]['mode'] != "p2p_shared_key") {
redirectHeader("vpn_openvpn_export.php");
exit;
......@@ -302,7 +302,7 @@ if (isset($savemsg)) {
$tab_array[] = array(gettext("Client Export"), false, "vpn_openvpn_export.php");
$tab_array[] = array(gettext("Shared Key Export"), true, "vpn_openvpn_export_shared.php");
display_top_tabs($tab_array);
?>
?>
<div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table width="100%" border="0" class="table table-striped" cellpadding="0" cellspacing="0">
......@@ -319,9 +319,10 @@ if (isset($savemsg)) {
<select name="server" id="server" class="formselect" onchange="server_changed()">
<?php foreach ($ras_server as & $server) :
?>
<option value="<?=htmlspecialchars($server['sindex']);?>"><?=htmlspecialchars($server['name']);?></option>
<option value="<?=htmlspecialchars($server['sindex']);
?>"><?=htmlspecialchars($server['name']);?></option>
<?php
endforeach; ?>
endforeach; ?>
</select>
</td>
</tr>
......@@ -333,10 +334,12 @@ if (isset($savemsg)) {
<option value="serverhostname" ><?=gettext("Installation hostname");?></option>
<?php if (isset($config['dyndnses']['dyndns'])) :
?>
<?php foreach ($config['dyndnses']['dyndns'] as $ddns) :
<?php foreach ($config['dyndnses']['dyndns'] as $ddns) :
?>
<option value="<?= htmlspecialchars($ddns["host"]); ?>"><?=gettext("DynDNS:");?> <?= htmlspecialchars($ddns["host"]);?></option>
<?php
<option value="<?= htmlspecialchars($ddns["host"]);
?>"><?=gettext("DynDNS:");
?> <?= htmlspecialchars($ddns["host"]);?></option>
<?php
endforeach; ?>
<?php
endif; ?>
......@@ -354,17 +357,17 @@ endif; ?>
<input name="useproxy" id="useproxy" type="checkbox" value="yes" onclick="useproxy_changed(this)" />
<div id="useproxy_opts" style="display:none">
<?=gettext("Type");?> :
<?=gettext("Type");?> :
<select name="useproxytype" id="useproxytype" class="formselect">
<option value="http"><?=gettext("HTTP");?></option>
<option value="socks"><?=gettext("Socks");?></option>
</select>
<?=gettext("IP Address")?> :
<?=gettext("IP Address")?> :
<input name="proxyaddr" id="proxyaddr" type="text" class="formfld unknown" size="30" value="" />
<?=gettext("Port");?> :
<?=gettext("Port");?> :
<input name="proxyport" id="proxyport" type="text" class="formfld unknown" size="5" value="" />
<?=gettext("Choose proxy authentication if any.");?>
<?=gettext("Choose proxy authentication if any.");?>
<select name="useproxypass" id="useproxypass" class="formselect" onchange="useproxy_changed(this)">
<option value="none"><?=gettext("none");?></option>
<option value="basic"><?=gettext("basic");?></option>
......@@ -380,7 +383,7 @@ endif; ?>
</div>
</div>
<div class="hidden" for="help_for_use_proxy">
<?= gettext("Use proxy to communicate with the server.");?>
<?= gettext("Use proxy to communicate with the server.");?>
</div>
</td>
</tr>
......@@ -394,8 +397,8 @@ endif; ?>
</tr>
</table>
<div class="hidden" for="help_for_client_conf_pkg">
<?= gettext("NOTE:") ?> <br/>
<?= gettext("These are shared key configurations for use in site-to-site tunnels with other routers. Shared key tunnels are not normally used for remote access connections to end users.") ?>
<?= gettext("NOTE:") ?> <br/>
<?= gettext("These are shared key configurations for use in site-to-site tunnels with other routers. Shared key tunnels are not normally used for remote access connections to end users.") ?>
</div>
</td>
</tr>
......
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