> When you do not have overwritten the sfGuardFormSignin then your logic
> fails due to the post validator of this form.
> Look in "sfGuardValidatorUser" and it should open your eyes. This
> validator fetches an existing user from the database and returns the
> cleaned data, when no user could be found, then nothing is returned
> and your form is not valid.

Well you're right but still without work. I make a "modification" to the code 
into sfGuardValidatorUser.class.php in this method:

protected function doClean($values) {
    $username = isset($values[$this->getOption('username_field')]) ? 
$values[$this->getOption('username_field')] : '';
    $password = isset($values[$this->getOption('password_field')]) ? 
$values[$this->getOption('password_field')] : '';
    $remember = isset($values[$this->getOption('rememeber_checkbox')]) ? 
$values[$this->getOption('rememeber_checkbox')] : '';

    if (sfConfig::get('login') != 'ldap') {
    // user exists?
      if ($user = sfGuardUserPeer::retrieveByUsername($username)) {
      // password is ok?
        if ($user->checkPassword($password)) {
          return array_merge($values, array('user' => $user));
        }
      }
    }

    if ($this->getOption('throw_global_error')) {
      throw new sfValidatorError($this, 'invalid');
    }
    throw new sfValidatorErrorSchema($this, 
array($this->getOption('username_field') => new sfValidatorError($this, 
'invalid')));
}

But the form is invalid again, why?
Cheers
Ing. Reynier PĂ©rez Mira

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to