Exemplo n.º 1
0
 /**
  * 登陆或是注册表单数据
  * @return boolean
  */
 protected function data()
 {
     $this->email = htmlspecialchars(trim(Env::getParam('email')));
     $this->password = htmlspecialchars(trim(Env::getParam('password')));
     $this->repassword = htmlspecialchars(trim(Env::getParam('repassword')));
     return $this->dataCheck();
 }
Exemplo n.º 2
0
 public function run()
 {
     $enEmail = Env::getParam('email');
     $this->email = $this->decryptEmail($enEmail);
     $enCode = Env::getParam('code');
     $this->code = $this->decryptCode($enCode);
     if ($this->active()) {
         echo 'active success';
         die;
     }
     echo 'active failed';
 }
Exemplo n.º 3
0
 /**
  * 生成用户激活码并加密返回
  * @return string
  */
 protected function code()
 {
     $code = Env::randStr(self::ACTIVE_CODE_LENGTH);
     $model = new UserActive();
     $model->code = $code;
     $model->uid = $this->uid;
     if ($model->save()) {
         return base64_encode(Yii::app()->securityManager->encrypt($code));
     }
 }