summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules-available/syslog/page.inc.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php
index 71a07e14..cd1c9d4d 100644
--- a/modules-available/syslog/page.inc.php
+++ b/modules-available/syslog/page.inc.php
@@ -26,20 +26,18 @@ class Page_SysLog extends Page
Util::redirect('?do=syslog');
}
if (Request::isPost()) {
- $search = Request::any('search', false, 'string');
- $filter = Request::any('filter', false, 'string');
- $not = Request::any('not', false, 'bool');
- $machineuuid = Request::any('machineuuid');
- if (empty($search)) {
- $search = false;
- }
- if (empty($filter)) {
- $filter = false;
+ $pairs = [];
+ foreach (['search', 'filter', 'not', 'machineuuid'] as $key) {
+ $val = Request::any($key, false, 'string');
+ if (!empty($val)) {
+ if ($key === 'not') {
+ $val = (bool)$val;
+ }
+ $pairs[$key] = $val;
+ }
+ Session::set('log_' . $key, $pairs[$key] ?? false, false);
}
- Session::set('log_search', $search, false);
- Session::set('log_filter', $filter, false);
- Session::set('log_not', $not, false);
- Util::redirect('?do=syslog&' . http_build_query(compact('search', 'filter', 'not', 'machineuuid')));
+ Util::redirect('?do=syslog&' . http_build_query($pairs));
}
User::assertPermission('*');
}