public function checkLdapErrorCode(UserInterface $user, $code, $ldapType)
    {
        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountLocked) {
            $ex = new LockedException('User account is locked.');
            $ex->setUser($user);
            throw $ex;
        }

        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountPasswordMustChange) {
            $ex = new CredentialsExpiredException('User credentials have expired.');
            $ex->setUser($user);
            throw $ex;
        }

        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountDisabled) {
            $ex = new DisabledException('User account is disabled.');
            $ex->setUser($user);
            throw $ex;
        }
    }
public function checkLdapErrorCode(UserInterface $user, $code, $ldapType)
    {
        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountLocked) {
            $ex = new LockedException('User account is locked.');
            $ex->setUser($user);
            throw $ex;
        }

        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountPasswordMustChange) {
            $ex = new CredentialsExpiredException('User credentials have expired.');
            $ex->setUser($user);
            throw $ex;
        }

        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountDisabled) {
            $ex = new DisabledException('User account is disabled.');
            $ex->setUser($user);
            throw $ex;
        }
    }
public function checkLdapErrorCode ( UserInterface $ user , $ code , $ ldapType ) { if ( $ ldapType == LdapConnection :: TYPE_AD && $ code == ResponseCode :: AccountLocked ) { $ ex = new LockedException ( 'User account is locked.' ) ; $ ex -> setUser ( $ user ) ; throw $ ex ; } if ( $ ldapType == LdapConnection :: TYPE_AD && $ code == ResponseCode :: AccountPasswordMustChange ) { $ ex = new CredentialsExpiredException ( 'User credentials have expired.' ) ; $ ex -> setUser ( $ user ) ; throw $ ex ; } if ( $ ldapType == LdapConnection :: TYPE_AD && $ code == ResponseCode :: AccountDisabled ) { $ ex = new DisabledException ( 'User account is disabled.' ) ; $ ex -> setUser ( $ user ) ; throw $ ex ; } }
Based on the LDAP error code and the LDAP type, throw any specific exceptions detected.

@param UserInterface $user The user object.
@param int $code The extended LDAP error code.
@param string $ldapType The LDAP type used for authentication.
Based on the LDAP error code and the LDAP type throw any specific exceptions detected .