summaryrefslogtreecommitdiffstats
path: root/modules-available/syslog
diff options
context:
space:
mode:
authorJannik Schönartz2017-11-20 14:30:31 +0100
committerJannik Schönartz2017-11-20 14:30:31 +0100
commit0746d3c815fa5dffe8ed766043cb996e5e2ce581 (patch)
tree151ef909c3d51f4e0db81eb315601c12c0aed36e /modules-available/syslog
parent[dozmod] Add missing labels for check boxes (diff)
downloadslx-admin-0746d3c815fa5dffe8ed766043cb996e5e2ce581.tar.gz
slx-admin-0746d3c815fa5dffe8ed766043cb996e5e2ce581.tar.xz
slx-admin-0746d3c815fa5dffe8ed766043cb996e5e2ce581.zip
[statistics&syslog] Changed ip to machine-uuid for filtering. Fixed a bug where the client-log was losing the specific client when a filter was added.
Diffstat (limited to 'modules-available/syslog')
-rw-r--r--modules-available/syslog/page.inc.php21
-rw-r--r--modules-available/syslog/templates/page-syslog.html2
2 files changed, 12 insertions, 11 deletions
diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php
index f2bc4854..46b62d5d 100644
--- a/modules-available/syslog/page.inc.php
+++ b/modules-available/syslog/page.inc.php
@@ -21,12 +21,13 @@ class Page_SysLog extends Page
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
$types[$row['logtypeid']] = $row;
}
- if (isset($_GET['filter'])) {
- $filter = $_GET['filter'];
- $not = isset($_GET['not']) ? 'NOT' : '';
- } elseif (isset($_POST['filter'])) {
- $filter = $_POST['filter'];
- $not = isset($_POST['not']) ? 'NOT' : '';
+ if (Request::get('filter') !== false) {
+ $filter = Request::get('filter');
+ $not = Request::get('not') ? 'NOT' : '';
+ } elseif (Request::post('filter') !== false) {
+ $filter = Request::post('filter');
+ $not = Request::post('not') ? 'NOT' : '';
+
Session::set('log_filter', $filter);
Session::set('log_not', $not);
Session::save();
@@ -48,14 +49,13 @@ class Page_SysLog extends Page
if (!empty($whereClause)) $whereClause = ' WHERE logtypeid ' . $not . ' IN (' . implode(', ', $whereClause) . ')';
}
if (!isset($whereClause) || empty($whereClause)) $whereClause = '';
- if (Request::get('ip')) {
+ if (Request::get('machineuuid')) {
if (empty($whereClause))
$whereClause .= ' WHERE ';
else
$whereClause .= ' AND ';
- $whereClause .= "clientip LIKE '" . preg_replace('/[^0-9\.\:]/', '', Request::get('ip')) . "%'";
+ $whereClause .= "machineuuid='" . Request::get('machineuuid') . "'";
}
-
$today = date('d.m.Y');
$yesterday = date('d.m.Y', time() - 86400);
$lines = array();
@@ -78,9 +78,10 @@ class Page_SysLog extends Page
'not' => $not,
'list' => $lines,
'types' => json_encode(array_values($types)),
+ 'machineuuid' => Request::get('machineuuid'),
));
}
-
+
private function eventToIconName($event)
{
switch ($event) {
diff --git a/modules-available/syslog/templates/page-syslog.html b/modules-available/syslog/templates/page-syslog.html
index cb20a93a..28ab739a 100644
--- a/modules-available/syslog/templates/page-syslog.html
+++ b/modules-available/syslog/templates/page-syslog.html
@@ -4,7 +4,7 @@
max-width: 500px;
}
</style>
-<form method="post" action="?do=SysLog">
+<form method="post" action="?do=SysLog{{#machineuuid}}&machineuuid={{machineuuid}}{{/machineuuid}}">
<input type="hidden" name="token" value="{{token}}">
<div class="pull-left">
<label for="filterstring">{{lang_filter}}</label>