diff --git a/src/ldap.class.php b/src/ldap.class.php index d303e4b8aef0ed7bf362c7e34ae12929c5a380ad..93bf9f8275cb2d1bf647c158487fa203720328fd 100755 --- a/src/ldap.class.php +++ b/src/ldap.class.php @@ -6,6 +6,7 @@ * - ldap auth * - CRUD actions on ldap leafs * + * last change: 2022-02-17 * @author axel.hahn@iml.unibe.ch */ class imlldap { @@ -726,15 +727,12 @@ class imlldap { * @param string $sPW password * @return boolean */ - public function verifyPassword($sUser, $sPW) { - $sDn = $this->getUserDn($sUser); - if ($sDn) { - if (!$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser'])){ - return false; - } + public function verifyPassword($sUser, $sPW){ + $sDn=$this->getUserDn($sUser); + if ($sDn){ + return $this->bind($sDn, $sPW); } $this->_w(__FUNCTION__ . ' dn not found (user does not exist in ldap) ' . $sUser); return false; } - }