From 578d1de55da6226ac65022d1ba6e032ee066d449 Mon Sep 17 00:00:00 2001
From: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Date: Mon, 29 Aug 2011 15:08:26 -0300
Subject: [PATCH] Fix OC_USER_LDAP::checkPassword() to return the username

REVIEW: 102487
---
 apps/user_ldap/user_ldap.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 2d94ef828a..1154efc17b 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -105,7 +105,9 @@ class OC_USER_LDAP extends OC_User_Backend {
 		if( !$dn )
 			return false;
 
-		return @ldap_bind( $this->getDs(), $dn, $password );
+		if (!@ldap_bind( $this->getDs(), $dn, $password ))
+			return false;
+		return $uid;
 	}
 
 	public function userExists( $uid ) {
-- 
GitLab