Exemple #1
0
 public function recover()
 {
     $this->_newPassword = HText::getRandomString(8);
     $this->_userModel->user_password = $this->_newPassword;
     //$this->_userModel->hashPassword($this->_newPassword);
     $this->_userModel->save();
     if ($this->hasEvent('onRecover')) {
         $this->onRecover(new CEvent($this));
     }
 }
Exemple #2
0
 protected function beforeValidate()
 {
     // генерим другой алиас если текущий дублируется
     $existAlias = $this->find('alias = :ALIAS', array(':ALIAS' => $this->alias));
     if ($existAlias) {
         $this->alias .= '_' . HText::getRandomString(1);
     }
     return true;
 }