Пример #1
0
 public function run()
 {
     $schoolId = $this->getCurrentSchoolId();
     $userid = $this->loginUser->uid;
     $myMenus = $this->_getMyOrderDS()->getMyMenus($schoolId, $userid);
     $this->setOutput($myMenus, 'myMenus');
     //check email
     $code = $this->getInput('code');
     $PwUserRegisterBp = new PwRegisterService();
     $result = $PwUserRegisterBp->activeEmail($this->loginUser->uid, $this->loginUser->info['email'], $code);
     if ($result instanceof PwError) {
         $code = $result->getError();
         $errorMessage = "验证失败,请联系管理员";
         if ($code == "USER:active.email.dumplicate") {
             $errorMessage = "此邮箱已被验证";
         } else {
             if ($code == "USER:illegal.request") {
                 $errorMessage = "无效的验证请求,请联系管理员";
             } else {
                 if ($code == "USER:active.email.overtime") {
                     $errorMessage = "验证码超时, 请再次请求";
                 }
             }
         }
         print_r($result->getError());
         die;
         $this->showError($result->getError());
         $this->setOutput(false, "validated");
     } else {
         $this->setOutput(true, "validated");
     }
 }
Пример #2
0
 /**
  * 激活邮箱链接
  */
 public function activeEmailAction()
 {
     $_statu = $this->checkRegisterUser();
     if (!Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_UNACTIVE)) {
         //			$this->showMessage('USER:active.email.success', 'u/register/welcome?_statu=' . $_statu);
         $this->setOutput('activeEmail', 'type');
         $this->setTemplate('register_about');
         return;
     }
     $code = $this->getInput('code');
     $PwUserRegisterBp = new PwRegisterService();
     $result = $PwUserRegisterBp->activeEmail($this->loginUser->uid, $this->loginUser->info['email'], $code);
     if ($result instanceof PwError) {
         $this->showError($result->getError());
     }
     //激活成功登录
     Wind::import('SRV:user.srv.PwLoginService');
     $login = new PwLoginService();
     $login->setLoginCookie($this->loginUser, $this->getRequest()->getClientIp());
     /* @var $guideService PwUserRegisterGuideService */
     $guideService = Wekit::load('APPS:u.service.PwUserRegisterGuideService');
     $this->setOutput($guideService->hasGuide(), 'goGuide');
     $this->setOutput('activeEmailSuccess', 'type');
     $this->setTemplate('register_about');
     //		$this->showMessage('USER:active.email.success', 'u/register/welcome?_statu=' . $_statu);
 }