nick4fake

Untitled

Sep 30th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Implement change password in Symfony2
  2. $builder->add('password', 'repeated', array(
  3.     'first_name' => 'New password',
  4.     'second_name' => 'Confirm new password',
  5.     'type' => 'password'
  6. ));
  7.    
  8. // in action:
  9. $oldpassword = $user->getPassword();
  10.  
  11. if ($request->getMethod() == 'POST')
  12.         {
  13.             $form->bindRequest($request);
  14.  
  15.             if ($form->isValid())
  16.             {
  17.                 // check password here (by hashing new one)
Advertisement
Add Comment
Please, Sign In to add comment