diff options
author | Simon Rettberg | 2018-08-07 16:54:01 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-08-07 16:54:01 +0200 |
commit | cd092274b88599449902f480f35291768be6e99e (patch) | |
tree | ea9735de4ff7dcd1a5cdaf52a45fb19bf84a39d3 /inc/user.inc.php | |
parent | [syslog] Add user export feature (diff) | |
download | slx-admin-cd092274b88599449902f480f35291768be6e99e.tar.gz slx-admin-cd092274b88599449902f480f35291768be6e99e.tar.xz slx-admin-cd092274b88599449902f480f35291768be6e99e.zip |
[inc/User] Fix access to Page if class is not loaded
Diffstat (limited to 'inc/user.inc.php')
-rw-r--r-- | inc/user.inc.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/inc/user.inc.php b/inc/user.inc.php index 2571c61c..20e8cd3d 100644 --- a/inc/user.inc.php +++ b/inc/user.inc.php @@ -34,8 +34,15 @@ class User if ($permission{0} === '.') { $permission = substr($permission, 1); } else { - $module = Page::getModule(); - $permission = $module ? $module->getIdentifier() . "." . $permission : $permission; + if (class_exists('Page')) { + $module = Page::getModule(); + if ($module !== false) { + $module = $module->getIdentifier(); + } + } else { + $module = strtolower(Request::any('do')); + } + $permission = $module ? $module . "." . $permission : $permission; } return PermissionUtil::userHasPermission(self::$user['userid'], $permission, $locationid); } |