diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Core/Ldap/User.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Core/Ldap/User.php b/app/Core/Ldap/User.php index c54aa1ac..91b48530 100644 --- a/app/Core/Ldap/User.php +++ b/app/Core/Ldap/User.php @@ -108,12 +108,18 @@ class User /** * Get role from LDAP groups * + * Note: Do not touch the current role if groups are not configured + * * @access protected * @param string[] $groupIds * @return string */ protected function getRole(array $groupIds) { + if ($this->hasGroupsNotConfigured()) { + return null; + } + foreach ($groupIds as $groupId) { $groupId = strtolower($groupId); @@ -272,6 +278,17 @@ class User } /** + * Return true if LDAP Group mapping is not configured + * + * @access public + * @return boolean + */ + public function hasGroupsNotConfigured() + { + return !$this->getGroupAdminDn() && !$this->getGroupManagerDn(); + } + + /** * Get LDAP admin group DN * * @access public |