Commit c5215538 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

small changes related to https://github.com/opnsense/core/pull/788

(cherry picked from commit 8594ccea)
parent a670d1be
...@@ -157,6 +157,7 @@ function restore_config_section_xmlrpc($new_config) ...@@ -157,6 +157,7 @@ function restore_config_section_xmlrpc($new_config)
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("filter.inc"); require_once("filter.inc");
require_once("ipsec.inc");
// save old config // save old config
$old_config = $config; $old_config = $config;
......
<?php <?php
/* /*
Copyright (C) 2014 Deciso B.V. Copyright (C) 2014-2016 Deciso B.V.
Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net> Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>
All rights reserved. All rights reserved.
...@@ -63,10 +63,11 @@ function dump_clog_vpn($logfile, $tail, $logtype) ...@@ -63,10 +63,11 @@ function dump_clog_vpn($logfile, $tail, $logtype)
echo "<tr>\n"; echo "<tr>\n";
echo "<td class=\"listlr nowrap\">" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "</td>\n"; echo "<td class=\"listlr nowrap\">" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "</td>\n";
if ($llent[0] == "login") if ($llent[0] == "login") {
echo "<td class=\"listr\"><span class=\"glyphicon glyphicon-arrow-right\" aria-hidden=\"true\" alt=\"in\"></span></td>\n"; echo "<td class=\"listr\"><span class=\"glyphicon glyphicon-arrow-right\" aria-hidden=\"true\" alt=\"in\"></span></td>\n";
else } else {
echo "<td class=\"listr\"><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\" alt=\"out\"></span></td>\n"; echo "<td class=\"listr\"><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\" alt=\"out\"></span></td>\n";
}
echo "<td class=\"listr\">" . htmlspecialchars($llent[3]) . "</td>\n"; echo "<td class=\"listr\">" . htmlspecialchars($llent[3]) . "</td>\n";
echo "<td class=\"listr\">" . htmlspecialchars($llent[2]) . "&nbsp;</td>\n"; echo "<td class=\"listr\">" . htmlspecialchars($llent[2]) . "&nbsp;</td>\n";
...@@ -75,34 +76,27 @@ function dump_clog_vpn($logfile, $tail, $logtype) ...@@ -75,34 +76,27 @@ function dump_clog_vpn($logfile, $tail, $logtype)
} }
include("head.inc"); include("head.inc");
?> ?>
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr><td colspan="4"> <tr>
<td colspan="4">
<ul class="nav nav-pills" role="tablist"> <ul class="nav nav-pills" role="tablist">
<?php foreach ($tab_array as $tab): ?> <?php foreach ($tab_array as $tab): ?>
<li role="presentation" <?php if (str_replace('amp;','', $tab[2]) == $_SERVER['REQUEST_URI']):?>class="active"<?php endif; ?>><a href="<?=$tab[2];?>"><?=$tab[0];?></a></li> <li role="presentation" <?php if (str_replace('amp;','', $tab[2]) == $_SERVER['REQUEST_URI']):?>class="active"<?php endif; ?>><a href="<?=$tab[2];?>"><?=$tab[0];?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</td></tr> </td>
</tr>
<?php if ($mode != "raw"): ?> <?php if ($mode != "raw"): ?>
<tr> <tr>
<td class="listhdrr"><?=gettext("Time");?></td> <td class="listhdrr"><?=gettext("Time");?></td>
...@@ -114,20 +108,19 @@ include("head.inc"); ...@@ -114,20 +108,19 @@ include("head.inc");
<?php else: <?php else:
dump_clog($logfile, $nentries); dump_clog($logfile, $nentries);
endif; ?> endif; ?>
<tr><td colspan="4"> <tr>
<form action="<? $_SERVER['REQUEST_URI'] ?>" method="post"> <td colspan="4">
<form method="post">
<input type="hidden" name="mode" id="mode" value="<?=$mode;?>" /> <input type="hidden" name="mode" id="mode" value="<?=$mode;?>" />
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" /> <input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
</form> </form>
</td></tr> </td>
</tr>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
...@@ -78,15 +78,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -78,15 +78,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$a_phase1 = &$config['ipsec']['phase1']; $a_phase1 = &$config['ipsec']['phase1'];
$a_phase2 = &$config['ipsec']['phase2']; $a_phase2 = &$config['ipsec']['phase2'];
if (isset($_POST['apply'])) { if (isset($_POST['apply'])) {
$retval = ipsec_configure(); ipsec_configure();
/* reload the filter in the background */ /* reload the filter in the background */
filter_configure(); filter_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
if ($retval >= 0) {
if (is_subsystem_dirty('ipsec')) {
clear_subsystem_dirty('ipsec'); clear_subsystem_dirty('ipsec');
}
}
} elseif (isset($_POST['save'])) { } elseif (isset($_POST['save'])) {
$config['ipsec']['enable'] = !empty($_POST['enable']) ? true : false; $config['ipsec']['enable'] = !empty($_POST['enable']) ? true : false;
write_config(); write_config();
......
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2016 Deciso B.V.
Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com) Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
All rights reserved. All rights reserved.
...@@ -60,21 +60,16 @@ if ($_GET['act'] == "del") { ...@@ -60,21 +60,16 @@ if ($_GET['act'] == "del") {
$service_hook = 'l2tpd'; $service_hook = 'l2tpd';
include("head.inc"); include("head.inc");
$main_buttons = array( $main_buttons = array(
array('label'=>gettext("add user"), 'href'=>'vpn_l2tp_users_edit.php'), array('label'=>gettext("add user"), 'href'=>'vpn_l2tp_users_edit.php'),
); );
?> ?>
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($savemsg)) { <?php if (isset($savemsg)) {
print_info_box($savemsg); print_info_box($savemsg);
} ?> } ?>
...@@ -86,16 +81,9 @@ $main_buttons = array( ...@@ -86,16 +81,9 @@ $main_buttons = array(
<?php print_info_box_apply(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 print_info_box_apply(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 <?php
endif; ?> endif; ?>
<div id="inputerrors"></div>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form method="post" name="iform" id="iform">
<form action="vpn_l2tp_users.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
...@@ -117,20 +105,17 @@ endif; ?> ...@@ -117,20 +105,17 @@ endif; ?>
</td> </td>
<td class="list nowrap" width="150"> <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_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"
<a href="vpn_l2tp_users.php?act=del&amp;id=<?=$i; onclick="return confirm('<?=gettext("Do you really want to delete this user?");?>')"
?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this user?"); title="<?=gettext("delete user"); ?>"><span class="fa fa-trash text-muted"></span>
?>')"title="<?=gettext("delete user"); ?>"><span class="fa fa-trash text-muted"></span></a> </a>
</td> </td>
</tr> </tr>
<?php $i++; <?php
$i++;
endforeach; ?> endforeach; ?>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
......
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2016 Deciso B.V.
Copyright (C) 2006 Scott Ullrich (sullrich@gmail.com) Copyright (C) 2006 Scott Ullrich (sullrich@gmail.com)
All rights reserved. All rights reserved.
...@@ -50,7 +50,7 @@ require_once("plugins.inc.d/vpn.inc"); ...@@ -50,7 +50,7 @@ require_once("plugins.inc.d/vpn.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/vpn_l2tp_users.php'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/vpn_l2tp_users.php');
if (!is_array($config['l2tp']['user'])) { if (empty($config['l2tp']['user']) || !is_array($config['l2tp']['user'])) {
$config['l2tp']['user'] = array(); $config['l2tp']['user'] = array();
} }
$a_secret = &$config['l2tp']['user']; $a_secret = &$config['l2tp']['user'];
...@@ -150,15 +150,9 @@ include("head.inc"); ...@@ -150,15 +150,9 @@ include("head.inc");
print_input_errors($input_errors); print_input_errors($input_errors);
} ?> } ?>
<div id="inputerrors"></div>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form method="post" name="iform" id="iform">
<form action="vpn_l2tp_users_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
...@@ -172,11 +166,10 @@ include("head.inc"); ...@@ -172,11 +166,10 @@ include("head.inc");
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="passwordfld" type="password" class="form-control pwd" id="passwordfld" size="20" /> <input name="passwordfld" type="password" class="form-control pwd" id="passwordfld" size="20" />
<br /><input name="password2" type="password" class="form-control pwd" id="password2" size="20" /> <br /><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
&nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) : &nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) :?><br />
?><br />
<p class="text-muted"><em><small><?=gettext("If you want to change the users password, enter it here twice.");?></small></em></p> <p class="text-muted"><em><small><?=gettext("If you want to change the users password, enter it here twice.");?></small></em></p>
<?php <?php endif; ?>
endif; ?></td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("IP address");?></td> <td width="22%" valign="top" class="vncell"><?=gettext("IP address");?></td>
...@@ -188,23 +181,18 @@ endif; ?></td> ...@@ -188,23 +181,18 @@ endif; ?></td>
<td width="22%" valign="top">&nbsp;</td> <td width="22%" valign="top">&nbsp;</td>
<td width="78%"> <td width="78%">
<input id="submit" name="Submit" type="submit" class="btn btn-primary" value="<?=gettext('Save');?>" /> <input id="submit" name="Submit" type="submit" class="btn btn-primary" value="<?=gettext('Save');?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel"); <input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
?>" onclick="window.location.href='<?=$referer;?>'" /> <?php if (isset($id) && $a_secret[$id]) :?>
<?php if (isset($id) && $a_secret[$id]) :
?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php <?php endif; ?>
endif; ?>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); <?php include("foot.inc");
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