Created
September 25, 2015 20:15
-
-
Save waspinator/362a74c53d95950cbf4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function password($id = null) | |
{ | |
$user = $this->Users->get($id); | |
if ($this->request->is(['patch', 'post', 'put'])) { | |
$user = $this->Users->patchEntity($user, $this->request->data); | |
if ($this->request->is(['ajax'])) { | |
if ($this->Users->save($user)) { | |
} else { | |
} | |
} else { | |
if ($this->Users->save($user)) { | |
$this->Flash->success('The user has been saved.'); | |
} else { | |
debug($user); die; | |
$this->Flash->error('The user could not be saved. Please, try again.'); | |
} | |
} | |
} | |
$this->set(compact('user')); | |
$this->set('_serialize', ['user']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment