summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>2012-11-05 17:35:09 +0100
committerLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>2012-11-05 17:35:09 +0100
commitca24f4767b996bcded139dd9189592e57eade2a6 (patch)
treeb5f3e41dbabedd6b6fbf547a58763e355d41ecc6 /apps
parent510191db6885153a98350d1a3530834491e0b552 (diff)
downloadnextcloud-server-ca24f4767b996bcded139dd9189592e57eade2a6.tar.gz
nextcloud-server-ca24f4767b996bcded139dd9189592e57eade2a6.zip
Return an empty array on succesful existence check
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/access.php5
-rw-r--r--apps/user_ldap/user_ldap.php2
2 files changed, 4 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 822e0b441c0..9cbb21ead0e 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -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)) {
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 4c0893a5103..6591d1d5fee 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -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;
}