diff options
author | Simon Rettberg | 2018-02-09 12:12:31 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-02-09 12:12:31 +0100 |
commit | d57ee1cfdd99fb4e44f5ce6d92d6712c30ff0aa4 (patch) | |
tree | c1030efbdb837f53651272e015a3ab5562f145c8 /modules-available/syslog/page.inc.php | |
parent | [systemstatus] lang-descriptions for permissions (diff) | |
parent | [inc/User] Add locationid 0 to allowed locations in fallback mode (diff) | |
download | slx-admin-d57ee1cfdd99fb4e44f5ce6d92d6712c30ff0aa4.tar.gz slx-admin-d57ee1cfdd99fb4e44f5ce6d92d6712c30ff0aa4.tar.xz slx-admin-d57ee1cfdd99fb4e44f5ce6d92d6712c30ff0aa4.zip |
Merge branch 'master' into permission-manager
Diffstat (limited to 'modules-available/syslog/page.inc.php')
-rw-r--r-- | modules-available/syslog/page.inc.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php index a34ceb53..a26ed9be 100644 --- a/modules-available/syslog/page.inc.php +++ b/modules-available/syslog/page.inc.php @@ -3,6 +3,9 @@ class Page_SysLog extends Page { + const PROP_ANON_DAYS = 'syslog.anon-days'; // Copy in cronjob + + protected function doPreprocess() { User::load(); @@ -11,6 +14,15 @@ class Page_SysLog extends Page Message::addError('main.no-permission'); Util::redirect('?do=Main'); } + if (($days = Request::post('anondays', false, 'int')) !== false) { + if ($days < 0 || $days > 180) { + Message::addError('anon-days-out-of-range', $days); + } else { + Property::set(self::PROP_ANON_DAYS, $days); + Message::addSuccess('anon-days-saved'); + } + Util::redirect('?do=syslog'); + } } protected function doRender() @@ -68,7 +80,7 @@ class Page_SysLog extends Page $allowedLocations = User::getAllowedLocations("view"); $joinClause = ""; if (!in_array(0, $allowedLocations)) { - $joinClause = "INNER JOIN machine ON machine.machineuuid = clientlog.machineuuid"; + $joinClause = "INNER JOIN machine USING (machineuuid)"; if (empty($whereClause)) $whereClause .= ' WHERE '; else @@ -78,7 +90,7 @@ class Page_SysLog extends Page } $lines = array(); - $paginate = new Paginate("SELECT logid, dateline, logtypeid, clientlog.clientip as clientip, description, extra FROM clientlog $joinClause $whereClause ORDER BY logid DESC", 50); + $paginate = new Paginate("SELECT logid, dateline, logtypeid, clientlog.clientip, clientlog.machineuuid, description, extra FROM clientlog $joinClause $whereClause ORDER BY logid DESC", 50); $res = $paginate->exec(array("allowedLocations" => $allowedLocations)); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $row['date'] = Util::prettyTime($row['dateline']); @@ -92,6 +104,7 @@ class Page_SysLog extends Page 'list' => $lines, 'types' => json_encode(array_values($types)), 'machineuuid' => Request::get('machineuuid'), + 'anondays' => Property::get(self::PROP_ANON_DAYS, 0), )); } |