]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP: make oc_user_ldap::userExists make use of central OC_LDAP
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 3 May 2012 21:44:12 +0000 (23:44 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Fri, 4 May 2012 11:26:07 +0000 (13:26 +0200)
apps/user_ldap/user_ldap.php

index d24af5e2f82a5ace4097208a18292c0c5eae28fb..0fa621194c82c4a7ad2b091a165b64f66bf57c42 100755 (executable)
@@ -185,14 +185,6 @@ class OC_USER_LDAP extends OC_User_Backend {
 
        }
 
-       public function userExists( $uid ) {
-               if(!$this->configured){
-                       return false;
-               }
-               $dn = $this->getDc($uid);
-               return !empty($dn);
-       }
-
        /**
         * @brief Get a list of all users
         * @returns array with all uids
@@ -205,6 +197,15 @@ class OC_USER_LDAP extends OC_User_Backend {
                return $users;
        }
 
+       /**
+        * @brief check if a user exists
+        * @param string $uid the username
+        * @return boolean
+        */
+       public static function userExists($uid){
+               return in_array($uid, self::getUsers());
+       }
+
 
 }