]> 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)
committerLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>
Mon, 5 Nov 2012 16:35:09 +0000 (17:35 +0100)
apps/user_ldap/lib/access.php
apps/user_ldap/user_ldap.php

index 822e0b441c0d02ae8d510372905b439a797eabe8..9cbb21ead0e6c39dbfd7b7651f22f3fa5547a83f 100644 (file)
@@ -41,7 +41,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
         */
@@ -64,7 +65,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);
                if(!is_resource($er)) {
index 4c0893a5103138c31e007d375492eb1479fe321c..6591d1d5fee1442b0152a279f9f83b9d4b130828 100644 (file)
@@ -150,7 +150,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;
                }