diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 2d94ef828ab022e74d474e3cd54c6e174838836c..1154efc17b194e0810109fd22502e79c56e13295 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 ) {