final protected function _canChangePassword() {
         //validate that required indices exist
        if (!isset($this->_userProfile['username'])
            || !isset($this->_userProfile['password'])
            || !isset($this->_userProfile['fullname'])
            || !isset($this->_userProfile['passhist'])
        ) {
            throw new UserCredentialException('The username and password are not set', 1016);
        }
  
        //Verify if the password was changed today or server has been futuredated
        $currDateTimeObj = new \DateTime();
        
        //Password was changed today or in the future
        if ($currDateTimeObj <= $this->_userProfile['policyinfo']['password_last_changed_datetime']) {
            return false;
        } else {
            return true;
        }
    }
final protected function _canChangePassword() {
         //validate that required indices exist
        if (!isset($this->_userProfile['username'])
            || !isset($this->_userProfile['password'])
            || !isset($this->_userProfile['fullname'])
            || !isset($this->_userProfile['passhist'])
        ) {
            throw new UserCredentialException('The username and password are not set', 1016);
        }
  
        //Verify if the password was changed today or server has been futuredated
        $currDateTimeObj = new \DateTime();
        
        //Password was changed today or in the future
        if ($currDateTimeObj <= $this->_userProfile['policyinfo']['password_last_changed_datetime']) {
            return false;
        } else {
            return true;
        }
    }
final protected function _canChangePassword ( ) { //validate that required indices exist
 if ( ! isset ( $ this -> _userProfile [ 'username' ] ) || ! isset ( $ this -> _userProfile [ 'password' ] ) || ! isset ( $ this -> _userProfile [ 'fullname' ] ) || ! isset ( $ this -> _userProfile [ 'passhist' ] ) ) { throw new UserCredentialException ( 'The username and password are not set' , 1016 ) ; } //Verify if the password was changed today or server has been futuredated
 $ currDateTimeObj = new \ DateTime ( ) ; //Password was changed today or in the future
 if ( $ currDateTimeObj <= $ this -> _userProfile [ 'policyinfo' ] [ 'password_last_changed_datetime' ] ) { return false ; } else { return true ; } }
Check that a user can change password in case you want to implement limits on changing passwords
only once in 24 hours

Cyril Ogana <cogana@gmail.com>
2015-07-18

@return bool

@access protected
@final
Check that a user can change password in case you want to implement limits on changing passwords only once in 24 hours