Commit 8dc4cc88ae63cdb25c39e22b0adf333e83e5dbb4

Authored by kevin_fourie
1 parent 5d48768c

Merged in from STABLE trunk.

KTS-3752
"CLONE -Authentication problem: (many) users can login without a correct password (SUP-1086)"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: megan watson


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3a-Release-Branch@9419 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
... ... @@ -741,6 +741,10 @@ class KTLDAPBaseAuthenticator extends Authenticator {
741 741 */
742 742 function checkPassword($oUser, $sPassword) {
743 743 $dn = $oUser->getAuthenticationDetails();
  744 + if (is_null($dn))
  745 + {
  746 + return new PEAR_Error(_kt('Please consult your system administrator. The authentication parameters are corrupt. (authentication_detail_s1 is null)'));
  747 + }
744 748 $config = array(
745 749 'host' => $this->sLdapServer,
746 750 'base' => $this->sBaseDN,
... ... @@ -796,11 +800,15 @@ class KTLDAPBaseAuthenticator extends Authenticator {
796 800 return $aResults;
797 801 }
798 802 foreach($aResults as $aEntry){
799   - if($aEntry['sAMAccountName'] == $sName){
  803 + if (strcasecmp($aEntry['sAMAccountName'], $sName) == 0) {
800 804 $newDn = $aEntry['dn'];
801 805 break;
802 806 }
803 807 }
  808 + if (empty($newDn))
  809 + {
  810 + return false;
  811 + }
804 812  
805 813 $res = $this->oLdap->reBind($newDn, $sPassword);
806 814  
... ...