Skip to content

Instantly share code, notes, and snippets.

@benmanns
Created June 28, 2010 22:03
Show Gist options
  • Save benmanns/456430 to your computer and use it in GitHub Desktop.
Save benmanns/456430 to your computer and use it in GitHub Desktop.
function add() {
if (!empty($this->data)) {
$user = $this->User->find('first', array('conditions' => array('User.activation_token' => $this->data['User']['activation_token'])));
if($user) {
$this->data['User']['activated'] = '-!NOW()';
$this->data['User']['activation_token'] = '-!NULL';
$this->User->id = $user['User']['id'];
}
$this->User->save($this->data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment