diff options
author | Simon Rettberg | 2018-02-08 12:16:55 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-02-08 12:16:55 +0100 |
commit | 798ff78db897fa44fa5d22847f6fec51069871ad (patch) | |
tree | e05da4a6f47886e4ecd200763d2c2217eac8e22f /modules-available/syslog/page.inc.php | |
parent | [runmode] Fix error message if generic editor is not allowed, allow dnbd3 editor (diff) | |
download | slx-admin-798ff78db897fa44fa5d22847f6fec51069871ad.tar.gz slx-admin-798ff78db897fa44fa5d22847f6fec51069871ad.tar.xz slx-admin-798ff78db897fa44fa5d22847f6fec51069871ad.zip |
[syslog] Add option to anonymize log entries after X days
Closes #3301
Diffstat (limited to 'modules-available/syslog/page.inc.php')
-rw-r--r-- | modules-available/syslog/page.inc.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php index 153b591f..e63ada85 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() @@ -72,6 +84,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), )); } |