Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function beforeSave()
- {
- if(parent::beforeSave())
- {
- if($this->isNewRecord)
- {
- $this->salt = md5(rand(10,10000) . $this->email);
- $this->password = md5($this->salt."#".$this->password);
- }
- else
- $this->password = $model->password;
- return true;
- }
- else
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement