/** * 登陆或是注册表单数据 * @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(); }
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'; }
/** * 生成用户激活码并加密返回 * @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)); } }