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

logs: pretty up captive portal logs

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