diff options
author | Simon Rettberg | 2021-06-28 15:04:35 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-06-28 15:04:35 +0200 |
commit | 44742851b22f225294a693f54161ad8e43a7dfda (patch) | |
tree | 41121b084e77f53601df1e831cff3a298dda104d /modules-available/eventlog/page.inc.php | |
parent | [inc/User] Make sure user has a token (diff) | |
download | slx-admin-44742851b22f225294a693f54161ad8e43a7dfda.tar.gz slx-admin-44742851b22f225294a693f54161ad8e43a7dfda.tar.xz slx-admin-44742851b22f225294a693f54161ad8e43a7dfda.zip |
[eventlog] Check permissions; add synamic suggestions for keys
Diffstat (limited to 'modules-available/eventlog/page.inc.php')
-rw-r--r-- | modules-available/eventlog/page.inc.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules-available/eventlog/page.inc.php b/modules-available/eventlog/page.inc.php index 9006c3c5..b24b9447 100644 --- a/modules-available/eventlog/page.inc.php +++ b/modules-available/eventlog/page.inc.php @@ -43,4 +43,21 @@ class Page_EventLog extends Page } } + protected function doAjax() + { + // XXX Should go into rules.inc.php + User::assertPermission('filter.rules.edit'); + if (Request::any('show') === 'rules') { + $type = Request::any('type', Request::REQUIRED, 'string'); + $res = Database::queryFirst('SELECT data FROM notification_sample WHERE type = :type LIMIT 1', + ['type' => $type]); + Header('Content-Type: application/json'); + if ($res === false) { + echo '{}'; + } else { + echo $res['data']; + } + } + } + } |