Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. security:
  2. encoders:
  3. AppBundleEntityUser:
  4. algorithm: bcrypt
  5.  
  6. $encoder = $this->container->get('security.password_encoder');
  7. $encoded = $encoder->encodePassword($user, $password);
  8.  
  9. $form->handleRequest ( $request );
  10.  
  11. $form->add ( 'oldpassword', 'password', array('label'=>'old password', 'required'=>true, 'error_bubbling'=>true, 'mapped' => false) );
  12.  
  13. $form->get('oldpassword')->getData()
  14.  
  15. $form->handleRequest ( $request );
  16. if ($form->isSubmitted ()) {
  17.  
  18. if ( !$functions->passwordVerify($user, $form->get('oldpassword')->getData()) ) {
  19. $form->get ( 'oldpassword' ) ->addError ( new FormError ( "Your current password is invalid" ) );
  20. }
  21.  
  22. public function passwordVerify($user=null, $oldpassword=null) {
  23. $encoder = $this->container->get('security.password_encoder');
  24. $valid = $encoder->isPasswordValid($user, $oldpassword);
  25. return $valid;
  26. }
  27.  
  28. $valid = $encoder->isPasswordValid($user, $oldpassword);
  29.  
  30. public function getSalt() {
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement