Commit 32bb6035 authored by Franco Fichtner's avatar Franco Fichtner

logs: pretty up captive portal logs

parent 4dbdf8e3
<?php <?php
/* /*
Copyright (C) 2014 Deciso B.V. Copyright (C) 2014 Deciso B.V.
Copyright (C) 2004-2009 Scott Ullrich Copyright (C) 2004-2009 Scott Ullrich
...@@ -29,23 +30,28 @@ ...@@ -29,23 +30,28 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
$system_logfile = "{$g['varlog_path']}/system.log"; $system_logfile = '/var/log/system.log';
$nentries = $config['syslog']['nentries']; $nentries = $config['syslog']['nentries'];
if (!$nentries) if (!$nentries) {
$nentries = 50; $nentries = 50;
}
if ($_POST['clear']) if ($_POST['clear']) {
clear_log_file($system_logfile); clear_log_file($system_logfile);
}
if ($_GET['filtertext']) if ($_GET['filtertext']) {
$filtertext = htmlspecialchars($_GET['filtertext']); $filtertext = htmlspecialchars($_GET['filtertext']);
}
if ($_POST['filtertext']) if ($_POST['filtertext']) {
$filtertext = htmlspecialchars($_POST['filtertext']); $filtertext = htmlspecialchars($_POST['filtertext']);
}
if ($filtertext) if ($filtertext) {
$filtertextmeta="?filtertext=$filtertext"; $filtertextmeta = "?filtertext={$filtertext}";
}
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General")); $pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General"));
include("head.inc"); include("head.inc");
...@@ -76,10 +82,11 @@ include("head.inc"); ...@@ -76,10 +82,11 @@ include("head.inc");
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<?php <?php
if($filtertext) if ($filtertext) {
dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("ppp")); dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("ppp"));
else } else {
dump_clog($system_logfile, $nentries, true, array(), array("ppp")); dump_clog($system_logfile, $nentries, true, array(), array("ppp"));
}
?> ?>
</table> </table>
</div> </div>
......
<?php <?php
/* /*
Copyright (C) 2014 Deciso B.V. Copyright (C) 2014 Deciso B.V.
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
...@@ -28,14 +29,16 @@ ...@@ -28,14 +29,16 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
$portal_logfile = "{$g['varlog_path']}/portalauth.log"; $portal_logfile = '/var/log/portalauth.log';
$nentries = $config['syslog']['nentries']; $nentries = $config['syslog']['nentries'];
if (!$nentries) if (!$nentries) {
$nentries = 50; $nentries = 50;
}
if ($_POST['clear']) if ($_POST['clear']) {
clear_log_file($portal_logfile); clear_log_file($portal_logfile);
}
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Portal Auth")); $pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Portal Auth"));
$shortcut_section = "captiveportal"; $shortcut_section = "captiveportal";
...@@ -61,10 +64,15 @@ include("head.inc"); ...@@ -61,10 +64,15 @@ include("head.inc");
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<div class="container-fluid"> <div class="container-fluid">
<?php printf(gettext('Last %s Portal Auth log entries'), $nentries); ?>
</div>
<div class="table-responsive">
<table class="table table-striped table-sort">
<?php dump_clog($portal_logfile, $nentries, true); ?>
</table>
</div>
<p> <?php printf(gettext("Last %s Portal Auth log entries"),$nentries);?></p> <div class="container-fluid">
<pre> <?php dump_clog($portal_logfile, $nentries, true); ?></pre>
<form action="diag_logs_auth.php" method="post"> <form action="diag_logs_auth.php" method="post">
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" /> <input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
</form> </form>
......
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