[Pkg-owncloud-commits] [owncloud] 43/394: Return an empty array on succesful existence check
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:11:23 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.
commit d62f138153a01437709675f44a46027c28aa0281
Author: Lorenzo M. Catucci <lorenzo at sancho.ccd.uniroma2.it>
Date: Mon Nov 5 17:35:09 2012 +0100
Return an empty array on succesful existence check
---
apps/user_ldap/lib/access.php | 5 +++--
apps/user_ldap/user_ldap.php | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index b09b6e7..dd195f2 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -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
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 5e5af44..d4f2593 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -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;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list