X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FLdapCommon%2FLdapCommon.php;h=ef0343be435a356f5e700d8dbfd76c0147f4ca39;hb=5db1479a9526fbb264d1d51647e925355ed6f062;hp=7dea1f0ed420e1c282f8d433a42666071200b304;hpb=78ed0348b0eaaebf7a51d55adc7e746cc5b43bbf;p=quix0rs-gnu-social.git diff --git a/plugins/LdapCommon/LdapCommon.php b/plugins/LdapCommon/LdapCommon.php index 7dea1f0ed4..ef0343be43 100644 --- a/plugins/LdapCommon/LdapCommon.php +++ b/plugins/LdapCommon/LdapCommon.php @@ -140,10 +140,16 @@ class LdapCommon function checkPassword($username, $password) { - $entry = $this->get_user($username); + $entry = $this->get_user($username,array('dn' => 'dn')); if(!$entry){ return false; }else{ + if(empty($password)) { + //NET_LDAP2 will do an anonymous bind if bindpw is not set / empty string + //which causes all login attempts that involve a blank password to appear + //to succeed. Which is obviously not good. + return false; + } $config = $this->get_ldap_config(); $config['binddn']=$entry->dn(); $config['bindpw']=$password; @@ -162,7 +168,7 @@ class LdapCommon //throw new Exception(_('Sorry, changing LDAP passwords is not supported at this time')); return false; } - $entry = $this->get_user($username); + $entry = $this->get_user($username,array('dn' => 'dn')); if(!$entry){ return false; }else{