]> source.dussan.org Git - nextcloud-server.git/commitdiff
Return an empty array on succesful existence check
authorLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>
Mon, 5 Nov 2012 16:35:09 +0000 (17:35 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Tue, 6 Nov 2012 15:43:53 +0000 (16:43 +0100)
apps/user_ldap/lib/access.php
apps/user_ldap/user_ldap.php

index b09b6e7d71927dee2d81b6a71172512a39626aa6..dd195f289783461a2409171f30a8e5eecee453c1 100644 (file)
@@ -39,7 +39,8 @@ abstract class Access {
         * @param $dn the record in question
         * @param $attr the attribute that shall be retrieved
         *        if empty, just check the record's existence
-        * @returns true or the values in an array on success, false otherwise
+        * @returns an array of values on success or an empty
+        *          array if $attr is empty, false otherwise
         *
         * Reads an attribute from an LDAP entry or check if entry exists
         */
@@ -62,7 +63,7 @@ abstract class Access {
                }
                if (empty($attr)) {
                        \OCP\Util::writeLog('user_ldap', 'readAttribute: '.$dn.' found', \OCP\Util::DEBUG);
-                       return true;
+                       return array();
                }
                $er = ldap_first_entry($cr, $rr);
                //LDAP attributes are not case sensitive
index 5e5af44d55e5b384f86352f76b9be6b485e4015f..d4f259320668ba7a406b03f1eaa68501b7cc6819 100644 (file)
@@ -142,7 +142,7 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
                }
 
                //check if user really still exists by reading its entry
-               if(!$this->readAttribute($dn, '') ) {
+               if(!is_array($this->readAttribute($dn, ''))) {
                        $this->connection->writeToCache('userExists'.$uid, false);
                        return false;
                }