final protected function _validateTenancy() {
        $userProfile = $this->_userProfile;
        
        //Verify if the password was changed today or server has been futuredated
        $currDateTimeObj = new \DateTime();
        
        //if account has tenancy expiry, deny login if user account tenancy is past
        if (array_key_exists('tenancy_expiry', $userProfile['policyinfo'])) {
            $tenancyExpiry = $userProfile['policyinfo']['tenancy_expiry'];
            
            if ($currDateTimeObj > $tenancyExpiry) {
                throw new UserCredentialException('Tenancy problem with your account. Please contact your Administrator');                
            }
        }
        
        return true;
    }
final protected function _validateTenancy() {
        $userProfile = $this->_userProfile;
        
        //Verify if the password was changed today or server has been futuredated
        $currDateTimeObj = new \DateTime();
        
        //if account has tenancy expiry, deny login if user account tenancy is past
        if (array_key_exists('tenancy_expiry', $userProfile['policyinfo'])) {
            $tenancyExpiry = $userProfile['policyinfo']['tenancy_expiry'];
            
            if ($currDateTimeObj > $tenancyExpiry) {
                throw new UserCredentialException('Tenancy problem with your account. Please contact your Administrator');                
            }
        }
        
        return true;
    }
final protected function _validateTenancy ( ) { $ userProfile = $ this -> _userProfile ; //Verify if the password was changed today or server has been futuredated
 $ currDateTimeObj = new \ DateTime ( ) ; //if account has tenancy expiry, deny login if user account tenancy is past
 if ( array_key_exists ( 'tenancy_expiry' , $ userProfile [ 'policyinfo' ] ) ) { $ tenancyExpiry = $ userProfile [ 'policyinfo' ] [ 'tenancy_expiry' ] ; if ( $ currDateTimeObj > $ tenancyExpiry ) { throw new UserCredentialException ( 'Tenancy problem with your account. Please contact your Administrator' ) ; } } return true ; }
validate the tenancy of an account. This can be preset by the system admin so that accounts that
are past tenancy date are automatically not allowed to authenticate. Tenancy should be validated
after other policies to avoid farming of accounts by testing which ones are still in tenancy

Cyril Ogana <cogana@gmail.com>
2018-04-25

@return bool

@access protected
@final
validate the tenancy of an account . This can be preset by the system admin so that accounts that are past tenancy date are automatically not allowed to authenticate . Tenancy should be validated after other policies to avoid farming of accounts by testing which ones are still in tenancy