Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. $this->User->recursive = 0;
  4. $row = $this->User->find('first', array('conditions'=>array('username' => $this->data['User']['username'], 'email' => $this->data['User']['email'])));
  5.  
  6. $pass = $this->PasswordHelper->generatePassword();
  7. $passhash = $this->Auth->password($pass);
  8.  
  9. $this->data['User']['id'] = $row['User']['id'];
  10. $this->data['User']['password'] = $passhash;
  11.  
  12. $this->User->set($this->data);
  13. if($this->User->save($this->data)){
  14.  
  15. } else{
  16. die(pr("Cannot save record"));
  17. }
  18.  
  19. ?>
Add Comment
Please, Sign In to add comment