Skip to content

Instantly share code, notes, and snippets.

@jesalg
Last active December 12, 2015 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesalg/4689966 to your computer and use it in GitHub Desktop.
Save jesalg/4689966 to your computer and use it in GitHub Desktop.
class User extends AppModel {
public function beforeSave($options = array()) {
if (isset($this->data['User']['password'])) {
$this->data['User']['password'] = AuthComponent::password($this->data['User']['password'], $this->data['User']['email']);
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment