net: log file style consolidation

This commit is contained in:
Franco Fichtner 2016-06-13 08:56:35 +02:00
parent 80056bfc16
commit 22a3f00bf8
9 changed files with 67 additions and 76 deletions

View file

@ -1,6 +1,6 @@
PLUGIN_NAME= l2tp
PLUGIN_PRIVATE= yes
PLUGIN_VERSION= 0.4
PLUGIN_VERSION= 0.5
PLUGIN_DEPENDS= clog mpd5
PLUGIN_COMMENT= LT2P server based on MPD5
PLUGIN_MAINTAINER= franco@opnsense.org

View file

@ -88,31 +88,27 @@ include("head.inc");
<div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
<td colspan="4">
<ul class="nav nav-pills" role="tablist">
<?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>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php if ($mode != "raw"): ?>
<tr>
<td class="listhdrr"><?=gettext("Time");?></td>
<td class="listhdrr"><?=gettext("Action");?></td>
<td class="listhdrr"><?=gettext("User");?></td>
<td class="listhdrr"><?=gettext("IP address");?></td>
</tr>
<tr>
<td colspan="4">
<ul class="nav nav-pills" role="tablist">
<?php foreach ($logpills as $pill): ?>
<li role="presentation" <?php if (str_replace('amp;','', $pill[2]) == $_SERVER['REQUEST_URI']):?>class="active"<?php endif; ?>><a href="<?=$pill[2];?>"><?=$pill[0];?></a></li>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php dump_clog_vpn($logfile, $nentries, $logtype); ?>
<?php else:
dump_clog($logfile, $nentries);
endif; ?>
<tr>
<td colspan="4">
<form method="post">
<input type="hidden" name="mode" id="mode" value="<?=$mode;?>" />
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
<input type="hidden" name="mode" id="mode" value="<?= html_safe($mode) ?>"/>
<input name="clear" type="submit" class="btn btn-primary" value="<?= html_safe(gettext('Clear log')) ?>"/>
</form>
</td>
</tr>

View file

@ -8,18 +8,19 @@ if (htmlspecialchars($_POST['mode'])) {
$mode = 'login';
}
if ($mode != 'raw') {
$logfile = '/var/log/vpn.log';
} else {
$logfile = '/var/log/l2tps.log';
}
$logtype = 'l2tp';
$logclog = true;
$tab_array = array();
$tab_array[] = array(gettext('L2TP Logins'), $mode != 'raw', '/vpn_l2tp_log.php');
$tab_array[] = array(gettext('L2TP Raw'), $mode == 'raw', '/vpn_l2tp_log.php?mode=raw');
$logpills = array();
$logpills[] = array(gettext('L2TP Logins'), $mode != 'raw', '/vpn_l2tp_log.php');
$logpills[] = array(gettext('L2TP Raw'), $mode == 'raw', '/vpn_l2tp_log.php?mode=raw');
$service_hook = 'l2tpd';
require_once 'vpn_l2tp_log.inc';
if ($mode != 'raw') {
$logfile = '/var/log/vpn.log';
require_once 'vpn_l2tp_log.inc';
} else {
$logfile = '/var/log/l2tps.log';
require_once 'diag_logs_template.inc';
}

View file

@ -1,6 +1,6 @@
PLUGIN_NAME= pppoe
PLUGIN_PRIVATE= yes
PLUGIN_VERSION= 0.4
PLUGIN_VERSION= 0.5
PLUGIN_DEPENDS= clog mpd5
PLUGIN_COMMENT= PPPoE server based on MPD5
PLUGIN_MAINTAINER= franco@opnsense.org

View file

@ -88,31 +88,27 @@ include("head.inc");
<div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
<td colspan="4">
<ul class="nav nav-pills" role="tablist">
<?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>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php if ($mode != "raw"): ?>
<tr>
<td class="listhdrr"><?=gettext("Time");?></td>
<td class="listhdrr"><?=gettext("Action");?></td>
<td class="listhdrr"><?=gettext("User");?></td>
<td class="listhdrr"><?=gettext("IP address");?></td>
</tr>
<tr>
<td colspan="4">
<ul class="nav nav-pills" role="tablist">
<?php foreach ($logpills as $pill): ?>
<li role="presentation" <?php if (str_replace('amp;','', $pill[2]) == $_SERVER['REQUEST_URI']):?>class="active"<?php endif; ?>><a href="<?=$pill[2];?>"><?=$pill[0];?></a></li>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php dump_clog_vpn($logfile, $nentries, $logtype); ?>
<?php else:
dump_clog($logfile, $nentries);
endif; ?>
<tr>
<td colspan="4">
<form method="post">
<input type="hidden" name="mode" id="mode" value="<?=$mode;?>" />
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
<input type="hidden" name="mode" id="mode" value="<?= html_safe($mode) ?>"/>
<input name="clear" type="submit" class="btn btn-primary" value="<?= html_safe(gettext('Clear log')) ?>"/>
</form>
</td>
</tr>

View file

@ -8,16 +8,17 @@ if (htmlspecialchars($_POST['mode'])) {
$mode = 'login';
}
$logtype = 'poes';
$logclog = true;
$logpills = array();
$logpills[] = array(gettext('PPPoE Logins'), $mode != 'raw', '/vpn_pppoe_log.php');
$logpills[] = array(gettext('PPPoE Raw'), $mode == 'raw', '/vpn_pppoe_log.php?mode=raw');
if ($mode != 'raw') {
$logfile = '/var/log/vpn.log';
require_once 'vpn_pppoe_log.inc';
} else {
$logfile = '/var/log/poes.log';
require_once 'diag_logs_template.inc';
}
$logtype = 'poes';
$tab_array = array();
$tab_array[] = array(gettext('PPPoE Logins'), $mode != 'raw', '/vpn_pppoe_log.php');
$tab_array[] = array(gettext('PPPoE Raw'), $mode == 'raw', '/vpn_pppoe_log.php?mode=raw');
require_once 'vpn_pppoe_log.inc';

View file

@ -1,6 +1,6 @@
PLUGIN_NAME= pptp
PLUGIN_PRIVATE= yes
PLUGIN_VERSION= 0.4
PLUGIN_VERSION= 0.5
PLUGIN_DEPENDS= clog mpd5
PLUGIN_COMMENT= PPTP server based on MPD5
PLUGIN_MAINTAINER= franco@opnsense.org

View file

@ -88,31 +88,27 @@ include("head.inc");
<div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
<td colspan="4">
<ul class="nav nav-pills" role="tablist">
<?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>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php if ($mode != "raw"): ?>
<tr>
<td class="listhdrr"><?=gettext("Time");?></td>
<td class="listhdrr"><?=gettext("Action");?></td>
<td class="listhdrr"><?=gettext("User");?></td>
<td class="listhdrr"><?=gettext("IP address");?></td>
</tr>
<tr>
<td colspan="4">
<ul class="nav nav-pills" role="tablist">
<?php foreach ($logpills as $pill): ?>
<li role="presentation" <?php if (str_replace('amp;','', $pill[2]) == $_SERVER['REQUEST_URI']):?>class="active"<?php endif; ?>><a href="<?=$pill[2];?>"><?=$pill[0];?></a></li>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php dump_clog_vpn($logfile, $nentries, $logtype); ?>
<?php else:
dump_clog($logfile, $nentries);
endif; ?>
<tr>
<td colspan="4">
<form method="post">
<input type="hidden" name="mode" id="mode" value="<?=$mode;?>" />
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
<input type="hidden" name="mode" id="mode" value="<?= html_safe($mode) ?>"/>
<input name="clear" type="submit" class="btn btn-primary" value="<?= html_safe(gettext('Clear log')) ?>"/>
</form>
</td>
</tr>

View file

@ -8,18 +8,19 @@ if (htmlspecialchars($_POST['mode'])) {
$mode = 'login';
}
if ($mode != 'raw') {
$logfile = '/var/log/vpn.log';
} else {
$logfile = '/var/log/pptps.log';
}
$logtype = 'pptp';
$logclog = true;
$tab_array = array();
$tab_array[] = array(gettext('PPTP Logins'), $mode != 'raw', '/vpn_pptp_log.php');
$tab_array[] = array(gettext('PPTP Raw'), $mode == 'raw', '/vpn_pptp_log.php?mode=raw');
$logpills = array();
$logpills[] = array(gettext('PPTP Logins'), $mode != 'raw', '/vpn_pptp_log.php');
$logpills[] = array(gettext('PPTP Raw'), $mode == 'raw', '/vpn_pptp_log.php?mode=raw');
$service_hook = 'pptpd';
require_once 'vpn_pptp_log.inc';
if ($mode != 'raw') {
$logfile = '/var/log/vpn.log';
require_once 'vpn_pptp_log.inc';
} else {
$logfile = '/var/log/pptps.log';
require_once 'diag_logs_template.inc';
}