Hi every:
Because I have a big problems while trying to integrate sfGuard and LDAP I will 
extend the Signin() method and add my own logic. What I'm want to do is this:

1. Add a sfWidgetFormSelect to make a choice between LDAP and Local. Something 
like that:

class sfGuardFormSignin extends sfForm {
    protected static $opciones = array("ldap"=>"LDAP", "local"=>"Local");
    public function configure() {
        $this->setWidgets(array(
            'username' => new sfWidgetFormInput(),
            'password' => new sfWidgetFormInput(array('type' => 'password')),
            'type' => new sfWidgetFormSelect(array('choices'=>self::$opciones)),
            'remember' => new sfWidgetFormInputCheckbox(),
        ));
        $this->setValidators(array(
            'username' => new sfValidatorString(),
            'password' => new sfValidatorString(),
            'remember' => new sfValidatorBoolean(),
        ));

        $this->validatorSchema->setPostValidator(new sfGuardValidatorUser());
        $this->widgetSchema->setNameFormat('signin[%s]');
    }
}

2. If the user pick LDAP, then the function could be authenticate the user over 
LDAP server and if the user exists and the credentials are correct add this 
user to the sf_guard_user table in the DB
3. Otherwise if the user pick Local the function need to authenticate over the 
DB only and not LDAP.

Now for do this I have a lot of questions:
1. As you can see in the code above I implemented the 'type' field in the 
plugin code, I mean in the core, then if I want to update the plugin I need to 
rewrite over and over the same code every time I do this ¿how I can avoid this? 
¿what yours suggest me?
2. Can any guide me in how to build the function for Signin()? I mean any 
example of this logic.

Cheers and thanks in advance
PS: If any make LDAP and sfGuard plugin get working and can use sfGuard groups 
and permissions facilities I'll be grateful for every help.
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