diff options
author | Udo Walter | 2017-04-25 15:19:45 +0200 |
---|---|---|
committer | Udo Walter | 2017-04-25 15:19:45 +0200 |
commit | df2ff1b28b2ff8a8fcd49a19666ea95a04d6d0c7 (patch) | |
tree | 99cef16fb695543ca151ef302fd2a10ad55927b6 /modules-available/permissionmanager/inc/permissionutil.inc.php | |
parent | [permissionmanager] added possibility to get a list of allowed locations for ... (diff) | |
download | slx-admin-df2ff1b28b2ff8a8fcd49a19666ea95a04d6d0c7.tar.gz slx-admin-df2ff1b28b2ff8a8fcd49a19666ea95a04d6d0c7.tar.xz slx-admin-df2ff1b28b2ff8a8fcd49a19666ea95a04d6d0c7.zip |
[permissionmanager] bugfix
Diffstat (limited to 'modules-available/permissionmanager/inc/permissionutil.inc.php')
-rw-r--r-- | modules-available/permissionmanager/inc/permissionutil.inc.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index fe16f7ab..bacec58e 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -3,9 +3,12 @@ class PermissionUtil { public static function userHasPermission($userid, $permissionid, $locationid) { - $locations = Location::getLocationRootChain($locationid); - if (count($locations) == 0) return false; - else $locations[] = 0; + $locations = array(); + if (!is_null($locationid)) { + $locations = Location::getLocationRootChain($locationid); + if (count($locations) == 0) return false; + else $locations[] = 0; + } $res = Database::simpleQuery("SELECT role_x_permission.permissionid as 'permissionid', role_x_location.locid as 'locationid' |