diff options
author | Udo Walter | 2017-04-25 15:52:23 +0200 |
---|---|---|
committer | Udo Walter | 2017-04-25 15:52:23 +0200 |
commit | 36c9bceae686f4ef2e0b4d0f169dbc7768ee980d (patch) | |
tree | c1b602a45405637b5edb9b610b60ac9e61dc4710 /modules-available/permissionmanager/inc/permissionutil.inc.php | |
parent | [permissionmanager] bugfix (diff) | |
download | slx-admin-36c9bceae686f4ef2e0b4d0f169dbc7768ee980d.tar.gz slx-admin-36c9bceae686f4ef2e0b4d0f169dbc7768ee980d.tar.xz slx-admin-36c9bceae686f4ef2e0b4d0f169dbc7768ee980d.zip |
[permissionmanager] another small bugfix
Diffstat (limited to 'modules-available/permissionmanager/inc/permissionutil.inc.php')
-rw-r--r-- | modules-available/permissionmanager/inc/permissionutil.inc.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index bacec58e..df877520 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -39,13 +39,14 @@ class PermissionUtil $allowedLocations = array(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $userPermission = trim($row["permissionid"], "*"); - if (substr($permissionid, 0, strlen($userPermission)) === $userPermission) { - $allowedLocations[] = $row["locationid"]; + if (!is_null($row["locationid"]) && substr($permissionid, 0, strlen($userPermission)) === $userPermission) { + $allowedLocations[$row["locationid"]] = 1; } } + $allowedLocations = array_keys($allowedLocations); $locations = Location::getTree(); if (count($allowedLocations) == 1 && $allowedLocations[0] == "0") { - $allowedLocations = Location::extractIds($locations); + $allowedLocations = array_map("intval", Location::extractIds($locations)); } else { $allowedLocations = self::getSublocations($locations, $allowedLocations); } |