Commit 2720f74f authored by Franco Fichtner's avatar Franco Fichtner

vpn: moar style for almost all pages

parent a4736cbf
This diff is collapsed.
......@@ -110,12 +110,12 @@ $( document ).ready(function() {
<div class="container-fluid">
<div class="row">
<?php
if (isset($savemsg)) {
if (isset($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">
......@@ -136,15 +136,15 @@ $( document ).ready(function() {
</tr>
<?php $i = 0;
$userkeys = array();
foreach ($config['system']['user'] as $id => $user) {
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 ($userkeys as $secretent) :
?>
<tr>
<tr>
<td>
<?=$secretent['ident'] == 'allusers' ? gettext("ANY USER") : htmlspecialchars($secretent['ident']) ;?>
</td>
......@@ -152,16 +152,17 @@ $( document ).ready(function() {
<?=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>
<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>
<?php $i++;
endforeach; ?>
endforeach; ?>
<?php
$i = 0;
foreach ($config['ipsec']['mobilekey'] as $secretent) :
foreach ($config['ipsec']['mobilekey'] as $secretent) :
?>
<tr>
<tr>
<td>
<?=htmlspecialchars($secretent['ident']);?>
</td>
......@@ -169,12 +170,14 @@ $( document ).ready(function() {
<?=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>
<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>
<?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">
......
......@@ -61,9 +61,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['pool_netbits'] = 24;
// copy / initialize $pconfig attributes
foreach (explode(",",$form_fields) as $fieldname) {
foreach (explode(",", $form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if(isset($config['ipsec']['client'][$fieldname])) {
if (isset($config['ipsec']['client'][$fieldname])) {
$pconfig[$fieldname] = $config['ipsec']['client'][$fieldname];
} elseif (!isset($pconfig[$fieldname])) {
// initialize element
......@@ -153,9 +153,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$copy_fields = "user_source,group_source,pool_address,pool_netbits,dns_domain,dns_server1
,dns_server2,dns_server3,dns_server4,wins_server1,wins_server2
,dns_split,pfs_group,login_banner";
foreach (explode(",",$copy_fields) as $fieldname) {
foreach (explode(",", $copy_fields) as $fieldname) {
$fieldname = trim($fieldname);
if(!empty($pconfig[$fieldname])) {
if (!empty($pconfig[$fieldname])) {
$client[$fieldname] = $pconfig[$fieldname];
}
}
......@@ -182,7 +182,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
// initialize missing post attributes
foreach (explode(",",$form_fields) as $fieldname) {
foreach (explode(",", $form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if (!isset($pconfig[$fieldname])) {
$pconfig[$fieldname] = null;
......@@ -319,24 +319,24 @@ function login_banner_change() {
<div class="container-fluid">
<div class="row">
<?php
if (isset($savemsg)) {
if (isset($savemsg)) {
print_info_box($savemsg);
}
if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec')) {
}
if (isset($config['ipsec']['enable']) && 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."));
}
}
$ph1found = false;
foreach ($config['ipsec']['phase1'] as $ph1ent) {
foreach ($config['ipsec']['phase1'] as $ph1ent) {
if (isset($ph1ent['mobile'])) {
$ph1found = true;
}
}
if (!empty($pconfig['enable']) && !$ph1found) {
}
if (!empty($pconfig['enable']) && !$ph1found) {
print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br />" . gettext("Please click Create to define one."), gettext("create"), gettext("Create Phase1"));
}
if (isset($input_errors) && count($input_errors) > 0) {
}
if (isset($input_errors) && count($input_errors) > 0) {
print_input_errors($input_errors);
}
}
?>
<section class="col-xs-12">
......@@ -375,7 +375,7 @@ function login_banner_change() {
<?php
$authmodes = explode(",", $pconfig['user_source']);
$auth_servers = auth_get_authserver_list();
foreach ($auth_servers as $auth_server) :
foreach ($auth_servers as $auth_server) :
?>
<option value="<?=htmlspecialchars($auth_server['name'])?>" <?=in_array($auth_server['name'], $authmodes) ? "selected=\"selected\"" : ""?> ><?=$auth_server['name']?></option>
<?php endforeach;
......@@ -388,7 +388,8 @@ function login_banner_change() {
<td>
<select name="group_source" class="form-control" id="group_source">
<option value="none"><?=gettext("none"); ?></option>
<option value="system" <?= $pconfig['group_source'] == "system" ? "selected=\"selected\"" : "";?>><?=gettext("system"); ?></option>
<option value="system" <?= $pconfig['group_source'] == "system" ? "selected=\"selected\"" : "";
?>><?=gettext("system"); ?></option>
</select>
</td>
</tr>
......@@ -406,11 +407,12 @@ function login_banner_change() {
<select name="pool_netbits" class="form-control" id="pool_netbits">
<?php for ($i = 32; $i >= 0; $i--) :
?>
<option value="<?=$i;?>" <?= ($i == $pconfig['pool_netbits']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$i;
?>" <?= ($i == $pconfig['pool_netbits']) ? "selected=\"selected\"" : "";?>>
<?=$i;?>
</option>
<?php
endfor; ?>
endfor; ?>
</select>
</td>
</tr>
......@@ -496,11 +498,12 @@ function login_banner_change() {
<select name="pfs_group" class="form-control" id="pfs_group">
<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname) :
?>
<option value="<?=$keygroup;?>" <?= $pconfig['pfs_group'] == $keygroup ? "selected=\"selected\"" : "" ; ?>>
<option value="<?=$keygroup;
?>" <?= $pconfig['pfs_group'] == $keygroup ? "selected=\"selected\"" : "" ; ?>>
<?=$keygroupname;?>
</option>
<?php
endforeach;
endforeach;
?>
</select>
<div class="hidden" for="help_for_pfs_group_enable">
......
This diff is collapsed.
......@@ -142,12 +142,12 @@ function maxmss_checked(obj) {
<div class="row">
<?php
if (isset($savemsg)) {
if (isset($savemsg)) {
print_info_box($savemsg);
}
if (isset($input_errors) && count($input_errors) > 0) {
}
if (isset($input_errors) && count($input_errors) > 0) {
print_input_errors($input_errors);
}
}
?>
<section class="col-xs-12">
<? $active_tab = "/vpn_ipsec_settings.php";
......@@ -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?>
</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."); ?>
......@@ -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.
......@@ -61,9 +61,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if ($act=="edit" && isset($id) && isset($a_csc[$id])) {
// 1 on 1 copy of config attributes
foreach (explode(",",$all_form_fields) as $fieldname) {
foreach (explode(",", $all_form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if(isset($a_csc[$id][$fieldname])) {
if (isset($a_csc[$id][$fieldname])) {
$pconfig[$fieldname] = $a_csc[$id][$fieldname];
} elseif (!isset($pconfig[$fieldname])) {
// initialize element
......@@ -72,7 +72,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
} else {
// init all form attributes
foreach (explode(",",$all_form_fields) as $fieldname) {
foreach (explode(",", $all_form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if (!isset($pconfig[$fieldname])) {
$pconfig[$fieldname] = null;
......@@ -165,9 +165,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (count($input_errors) == 0) {
$csc = array();
// 1 on 1 copy of config attributes
foreach (explode(",",$all_form_fields) as $fieldname) {
foreach (explode(",", $all_form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if(!empty($pconfig[$fieldname])) {
if (!empty($pconfig[$fieldname])) {
$csc[$fieldname] = $pconfig[$fieldname];
}
}
......@@ -549,7 +549,7 @@ if ($act!="new" && $act!="edit") {
<option value="<?=$type;
?>" <?=$selected;
?>><?=$name;?></option>
<?php
<?php
endforeach; ?>
</select>
......@@ -644,7 +644,8 @@ else :
</td>
<td valign="middle" class="list nowrap">
<a href="vpn_openvpn_csc.php?act=edit&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a id="del_<?=$i;?>" title="<?=gettext("delete csc"); ?>" class="act_delete btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
<a id="del_<?=$i;
?>" title="<?=gettext("delete csc"); ?>" class="act_delete btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
<?php
......
......@@ -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>
......@@ -658,7 +659,8 @@ if (isset($savemsg)) {
?>
<?php foreach ($config['dyndnses']['dyndns'] as $ddns) :
?>
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");
?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<?php
endforeach; ?>
<?php
......@@ -667,7 +669,8 @@ endif; ?>
?>
<?php foreach ($config['dnsupdates']['dnsupdate'] as $ddns) :
?>
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<option value="<?php echo $ddns["host"] ?>"><?=gettext("DynDNS");
?>: <?= htmlspecialchars($ddns["host"]); ?></option>
<?php
endforeach; ?>
<?php
......
......@@ -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;
......@@ -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>
......@@ -335,7 +336,9 @@ if (isset($savemsg)) {
?>
<?php foreach ($config['dyndnses']['dyndns'] as $ddns) :
?>
<option value="<?= htmlspecialchars($ddns["host"]); ?>"><?=gettext("DynDNS:");?> <?= htmlspecialchars($ddns["host"]);?></option>
<option value="<?= htmlspecialchars($ddns["host"]);
?>"><?=gettext("DynDNS:");
?> <?= htmlspecialchars($ddns["host"]);?></option>
<?php
endforeach; ?>
<?php
......
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