Advertisement
Guest User

Untitled

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