Advertisement
Guest User

Untitled

a guest
Jan 4th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public function changep()
  2. {
  3.  
  4. if ($this->request->is('post')) {
  5.  
  6. $id_user = $this->Auth->user('id');
  7. $user_change = $this->Users->get($id_user);
  8. $new_password = $this->request->data['new_password'];
  9.  
  10. $user_change->password = $new_password;
  11.  
  12. if($this->Users->save($user_update)){
  13. $this->Flash->success('La clave a sido cambiada con exito.');
  14. }
  15. else{
  16. $this->Flash->success('La clave no ha podido ser cambiada.');
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement