From 3874c53260f3c8dcc9c834b784b874a63ea0990e Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Thu, 17 Feb 2022 16:32:12 +0100 Subject: [PATCH] update verifyPassword --- src/ldap.class.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ldap.class.php b/src/ldap.class.php index d303e4b..93bf9f8 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; } - } -- GitLab