/** * Called after fields are validated. * @param object $obj This parameter is ignored. * @access private */ protected function _post_validate($obj) { parent::_post_validate($obj); if (!$this->num_errors('name') && $this->value_for('name')) { $user_query = $this->app->user_query(); $user_query->include_permissions(true); $this->_user = $user_query->object_at_name($this->value_for('name')); if (!$this->_user) { $this->record_error('password', 'Please provide a valid login.'); } else { if (!$this->num_errors('password')) { if (!$this->_user->password_matches($this->value_for('password'))) { $this->record_error('password', 'Please provide a valid login.'); } } } } }
/** * Called after fields are validated. * @param USER $obj This parameter is ignored. * @access private */ protected function _post_validate($obj) { parent::_post_validate($obj); if (!$this->num_errors('password1') && !$this->num_errors('password2')) { $password1 = $this->value_for('password1'); $password2 = $this->value_for('password2'); if (strcasecmp($password1, $password2)) { $this->record_error('password2', "Please make sure the passwords are the same."); } } }