diff options
author | Christian Hofmaier | 2017-12-07 18:20:06 +0100 |
---|---|---|
committer | Christian Hofmaier | 2017-12-07 18:20:06 +0100 |
commit | 0ba49ba63e81bf2f4b68f83c035bf0bef37bb3be (patch) | |
tree | fccf8e5b4db5c6a07286f936f23249966bedee84 /modules-available/dozmod/page.inc.php | |
parent | [sysconfig] Overview: Make mouseover highlighting work in the other direction... (diff) | |
download | slx-admin-0ba49ba63e81bf2f4b68f83c035bf0bef37bb3be.tar.gz slx-admin-0ba49ba63e81bf2f4b68f83c035bf0bef37bb3be.tar.xz slx-admin-0ba49ba63e81bf2f4b68f83c035bf0bef37bb3be.zip |
[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).
Diffstat (limited to 'modules-available/dozmod/page.inc.php')
-rw-r--r-- | modules-available/dozmod/page.inc.php | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/modules-available/dozmod/page.inc.php b/modules-available/dozmod/page.inc.php index ffb38663..7a5ddf23 100644 --- a/modules-available/dozmod/page.inc.php +++ b/modules-available/dozmod/page.inc.php @@ -52,16 +52,10 @@ class Page_DozMod extends Page if ($action === 'mail') { if (User::hasPermission("mail.save")) { $this->mailHandler(); - } else { - Message::addError('main.no-permission'); - Util::redirect('?do=dozmod§ion=mailconfig'); } } elseif ($action === 'runtime') { if (User::hasPermission("runtimeconfig.save")) { $this->runtimeHandler(); - } else { - Message::addError('main.no-permission'); - Util::redirect('?do=dozmod§ion=runtimeconfig'); } } elseif ($action === 'delimages') { if (User::hasPermission("images.delete")) { @@ -70,9 +64,6 @@ class Page_DozMod extends Page Message::addInfo('delete-images', $result); } Util::redirect('?do=DozMod'); - } else { - Message::addError('main.no-permission'); - Util::redirect('?do=dozmod'); } } elseif ($action !== false) { Util::traceError('Invalid action: ' . $action); @@ -102,7 +93,7 @@ class Page_DozMod extends Page if (empty($expiredImages)) { Message::addSuccess('no-expired-images'); } else { - Render::addTemplate('images-delete', array('images' => $expiredImages)); + Render::addTemplate('images-delete', array('images' => $expiredImages, 'allowedDelete' => User::hasPermission("images.delete"))); } } if ($section === 'mailconfig') { @@ -114,6 +105,8 @@ class Page_DozMod extends Page $mailConf['set_' . $mailConf['ssl']] = 'selected="selected"'; } } + $mailConf['allowedSave'] = User::hasPermission('mail.save'); + $mailConf['allowedTest'] = User::hasPermission('mail.testmail'); Render::addTemplate('mailconfig', $mailConf); } if ($section === 'runtimeconfig') { @@ -146,6 +139,7 @@ class Page_DozMod extends Page $runtimeConf['allowLoginByDefault'] = 'checked'; } } + $runtimeConf['allowedSave'] = User::hasPermission("runtimeconfig.save"); Render::addTemplate('runtimeconfig', $runtimeConf); } if ($section === 'blockstats') { @@ -231,14 +225,10 @@ class Page_DozMod extends Page if ($action === 'mail') { if (User::hasPermission("mail.testmail")) { $this->handleTestMail(); - } else { - die('No permission'); } } elseif ($action === 'delimages') { if (User::hasPermission("images.delete")) { die($this->handleDeleteImages()); - } else { - die('No permission'); } } elseif ($action === 'getblockinfo') { $this->ajaxGetBlockInfo(); |