FriendsOfSymfony / FOSFacebookBundle

NOT MAINTAINED - see https://github.com/hwi/HWIOAuthBundle
322 stars 140 forks source link

Password changing for FOSFacebookBundle-User [Simple help needed] #252

Open Bubelbub opened 11 years ago

Bubelbub commented 11 years ago

hey guys,

the users could log in my project. Then they could change their username and their password. So that they can log in manually by facebook id or by username/password.

my extended form is the following.

public function buildForm(FormBuilderInterface $builder, array $options)
{
    parent::buildForm($builder, $options);

    $builder
        ->add('plainPassword', 'repeated', array(
            'type' => 'password',
            'options' => array('translation_domain' => 'FOSUserBundle'),
            'first_options' => array('label' => 'form.password'),
            'second_options' => array('label' => 'form.password_confirmation'),
            'invalid_message' => 'fos_user.password.mismatch',
            'required' => false
        ));
    $builder->get('current_password')->setRequired(false);
}

Now the html5 "required" tag is removed, but the Constraint is there... There are functions to remove all things like the required parameter... But "setOptions" etc. is missing.

How could i remove the "currentPassword" check for Facebook User WITHOUT reconstruct the 'current_password' Field...

Thank you in Advance!

=> Great bundle! Nice, easy integration!! Thank you! <=

micronax commented 10 years ago

+1