diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-30 21:47:31 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-30 21:47:31 -0400 |
commit | 4987e245bb629e3171425bf16db341c5c3a7c3c7 (patch) | |
tree | 36a94eedcc7e50d71b9363cb410f8b7738f5dab8 /app | |
parent | 679a22c718e8cb2d3ae6d981e1745bad948e1b92 (diff) |
Do not sync user role if LDAP groups are not configured
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 |