diff options
author | Jannik Schönartz | 2017-11-20 14:30:31 +0100 |
---|---|---|
committer | Jannik Schönartz | 2017-11-20 14:30:31 +0100 |
commit | 0746d3c815fa5dffe8ed766043cb996e5e2ce581 (patch) | |
tree | 151ef909c3d51f4e0db81eb315601c12c0aed36e | |
parent | [dozmod] Add missing labels for check boxes (diff) | |
download | slx-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.
-rw-r--r-- | modules-available/statistics/page.inc.php | 2 | ||||
-rw-r--r-- | modules-available/statistics/templates/syslog.html | 2 | ||||
-rw-r--r-- | modules-available/syslog/page.inc.php | 21 | ||||
-rw-r--r-- | modules-available/syslog/templates/page-syslog.html | 2 |
4 files changed, 14 insertions, 13 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index 479f3089..f8b40405 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -920,7 +920,7 @@ class Page_Statistics extends Page } } Render::addTemplate('syslog', array( - 'clientip' => $client['clientip'], + 'machineuuid' => $client['machineuuid'], 'list' => $log, )); } diff --git a/modules-available/statistics/templates/syslog.html b/modules-available/statistics/templates/syslog.html index c82cb8ac..968d32ab 100644 --- a/modules-available/statistics/templates/syslog.html +++ b/modules-available/statistics/templates/syslog.html @@ -20,7 +20,7 @@ {{/list}} </tbody> </table> -<div class="pull-right"><a class="btn btn-default btn-sm" href="?do=SysLog&ip={{clientip}}">{{lang_more}} »</a></div> +<div class="pull-right"><a class="btn btn-default btn-sm" href="?do=SysLog&machineuuid={{machineuuid}}">{{lang_more}} »</a></div> <div class="clearfix"></div> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 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> |