Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. protected function beforeSave()
  3. {
  4. if($this->isNewRecord)
  5. {
  6. $this->salt = md5(rand(10,10000) . $this->email);
  7. $this->password = md5($this->salt."#".$this->password);
  8. }
  9. else
  10. $this->password = $model->password; // this will never work, where are you defining model
  11.  
  12. return parent::beforeSave();
  13.  
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement