Fix for Trac #559: ldap user can login with blank password

SVN:trunk[2110]
This commit is contained in:
Denis Flaven
2012-06-14 16:31:16 +00:00
parent 0ffe040546
commit 5a16c08bc9

View File

@@ -120,7 +120,7 @@ class UserLDAP extends UserInternal
$aEntry = ldap_get_entries($hDS, $hSearchResult);
$sUserDN = $aEntry[0]['dn'];
$bUserBind = @ldap_bind($hDS, $sUserDN, $sPassword);
if ($bUserBind !== false)
if (($bUserBind !== false) && !empty($sPassword))
{
ldap_unbind($hDS);
return true; // Password Ok