From d21d73254591805868acbfbec5853fa3f861fa5e Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Thu, 5 Jul 2018 12:54:58 +0000 Subject: [PATCH] Do not check if the organizations are allowed if there is no user logged in (use case: automatic synchro of users at connection time) SVN:trunk[5930] --- addons/userrights/userrightsprofile.class.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php index ea2ac63a8..cf943fb5d 100644 --- a/addons/userrights/userrightsprofile.class.inc.php +++ b/addons/userrights/userrightsprofile.class.inc.php @@ -402,9 +402,9 @@ class URP_UserOrg extends UserRightsBaseClassGUI */ protected function CheckIfOrgIsAllowed() { - if (UserRights::IsAdministrator()) { return; } + if (!UserRights::IsLoggedIn() || UserRights::IsAdministrator()) { return; } - $oUser = UserRights::GetUserObject(); + $oUser = UserRights::GetUserObject(); $oAddon = UserRights::GetModuleInstance(); $aOrgs = $oAddon->GetUserOrgs($oUser, ''); if (count($aOrgs) > 0)