]> source.dussan.org Git - nextcloud-server.git/commitdiff
Exclude LDAP backend from global user searches
authorLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>
Thu, 6 Dec 2012 17:11:14 +0000 (18:11 +0100)
committerLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>
Fri, 7 Dec 2012 16:19:30 +0000 (17:19 +0100)
triggered by itself.

apps/user_ldap/lib/access.php

index 53d4edbe69cce5cd7829279143d857de6fe85cb6..f71f4035928967c6ff6ef58ba5ea5f1c72de0626 100644 (file)
@@ -281,8 +281,8 @@ abstract class Access {
                }
                $ldapname = $this->sanitizeUsername($ldapname);
 
-               //a new user/group! Then let's try to add it. We're shooting into the blue with the user/group name, assuming that in most cases there will not be a conflict. Otherwise an error will occur and we will continue with our second shot.
-               if(($isUser && !\OCP\User::userExists($ldapname)) || (!$isUser && !\OC_Group::groupExists($ldapname))) {
+               //a new user/group! Add it only if it doesn't conflict with other backend's users or existing groups
+               if(($isUser && !\OCP\User::userExists($ldapname, 'OCA\\user_ldap\\USER_LDAP')) || (!$isUser && !\OC_Group::groupExists($ldapname))) {
                        if($this->mapComponent($dn, $ldapname, $isUser)) {
                                return $ldapname;
                        }
@@ -874,4 +874,4 @@ abstract class Access {
                return $pagedSearchOK;
        }
 
-}
\ No newline at end of file
+}