Skip to content

Commit

Permalink
vpn: moar style for almost all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Sep 11, 2015
1 parent a4736cb commit 2720f74
Show file tree
Hide file tree
Showing 11 changed files with 1,544 additions and 1,453 deletions.
725 changes: 370 additions & 355 deletions src/www/vpn_ipsec.php

Large diffs are not rendered by default.

85 changes: 44 additions & 41 deletions src/www/vpn_ipsec_keys.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
}
} else {
// nothing to post, redirect
header("Location: vpn_ipsec_keys.php");
exit;
header("Location: vpn_ipsec_keys.php");
exit;
}
}

Expand Down Expand Up @@ -110,12 +110,12 @@
<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">
Expand All @@ -136,45 +136,48 @@
</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>
Expand Down
6 changes: 3 additions & 3 deletions src/www/vpn_ipsec_keys_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

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'];
Expand All @@ -58,7 +58,7 @@
$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;
Expand Down Expand Up @@ -133,7 +133,7 @@
<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">
Expand Down
Loading

0 comments on commit 2720f74

Please sign in to comment.