Guest User

Untitled

a guest
May 2nd, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  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