From 0ba49ba63e81bf2f4b68f83c035bf0bef37bb3be Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Thu, 7 Dec 2017 18:20:06 +0100 Subject: [dozmod] reworked permission system from "click and you get error" to "button is disabled due to lack of permission" + in log as there is no button, the links to the user/target are disabled (not clickable). --- modules-available/dozmod/inc/pagedozmodlog.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules-available/dozmod/inc/pagedozmodlog.inc.php') diff --git a/modules-available/dozmod/inc/pagedozmodlog.inc.php b/modules-available/dozmod/inc/pagedozmodlog.inc.php index f31edf5b..957abd2f 100644 --- a/modules-available/dozmod/inc/pagedozmodlog.inc.php +++ b/modules-available/dozmod/inc/pagedozmodlog.inc.php @@ -29,9 +29,13 @@ class Page_dozmod_log extends Page . " LEFT JOIN sat.lecture l ON (l.lectureid = targetid)" . " ORDER BY al.dateline DESC LIMIT 500", array(), true, true); } elseif ($this->action === 'showuser') { - $this->listUser(); + if (User::hasPermission("log.showuser")) { + $this->listUser(); + } } else { - $this->listTarget(); + if (User::hasPermission("log.showtarget")) { + $this->listTarget(); + } } } @@ -150,6 +154,9 @@ class Page_dozmod_log extends Page if ($showTarget) { $data['showTarget'] = true; } + + $data['allowedShowUser'] = User::hasPermission("log.showuser"); + $data['allowedShowTarget'] = User::hasPermission("log.showtarget"); Render::addTemplate('actionlog-log', $data); } -- cgit v1.2.3-55-g7522