From 44742851b22f225294a693f54161ad8e43a7dfda Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 28 Jun 2021 15:04:35 +0200 Subject: [eventlog] Check permissions; add synamic suggestions for keys --- modules-available/eventlog/page.inc.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'modules-available/eventlog/page.inc.php') 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']; + } + } + } + } -- cgit v1.2.3-55-g7522