diff options
author | Simon Rettberg | 2018-03-29 18:41:37 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-03-29 18:41:37 +0200 |
commit | 18f378c9bd232822577258fe68afe78df3f7e7f4 (patch) | |
tree | 685d51e38326a997374d4be6a1e5caa0cd4e0295 /inc/user.inc.php | |
parent | [serversetup-bwlp] Update pxelinux menu parser (diff) | |
download | slx-admin-18f378c9bd232822577258fe68afe78df3f7e7f4.tar.gz slx-admin-18f378c9bd232822577258fe68afe78df3f7e7f4.tar.xz slx-admin-18f378c9bd232822577258fe68afe78df3f7e7f4.zip |
[permissionmanager] Introduce dedicated "permission denied" page
Closes #3350
Diffstat (limited to 'inc/user.inc.php')
-rw-r--r-- | inc/user.inc.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/inc/user.inc.php b/inc/user.inc.php index 27a907c3..f12cc39f 100644 --- a/inc/user.inc.php +++ b/inc/user.inc.php @@ -55,15 +55,24 @@ class User { if (User::hasPermission($permission, $locationid)) return; - Message::addError('main.no-permission'); if (AJAX) { Message::renderList(); exit; } - if (is_null($redirect)) { - Util::redirect('?do=main'); - } else { + if (!is_null($redirect)) { + Message::addError('main.no-permission'); Util::redirect($redirect); + } elseif (Module::isAvailable('permissionmanager')) { + if ($permission{0} !== '.') { + $module = Page::getModule(); + if ($module !== false) { + $permission = '.' . $module->getIdentifier() . '.' . $permission; + } + } + Util::redirect('?do=permissionmanager&show=denied&permission=' . urlencode($permission)); + } else { + Message::addError('main.no-permission'); + Util::redirect('?do=main'); } } |