Ejemplo n.º 1
0
 /**
  * 执行用户注册
  */
 public function dorunAction()
 {
     $this->setOutput('注册', 'title');
     $registerService = new PwRegisterService();
     $registerService->setUserDm($this->_getUserDm());
     /*[u_regsiter]:插件扩展*/
     $this->runHook('c_register', $registerService);
     if (($info = $registerService->register()) instanceof PwError) {
         $this->showError($info->getError());
     } else {
         $identity = PwRegisterService::createRegistIdentify($info['uid'], $info['password']);
         if (1 == Wekit::C('register', 'active.mail')) {
             $this->forwardAction('u/register/sendActiveEmail', array('_statu' => $identity), true);
         } else {
             $this->forwardAction('u/register/welcome', array('_statu' => $identity), true);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * 登录成功
  */
 public function welcomeAction()
 {
     $identify = $this->checkUserInfo();
     if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_UNACTIVE)) {
         Wind::import('SRV:user.srv.PwRegisterService');
         $identify = PwRegisterService::createRegistIdentify($this->loginUser->uid, $this->loginUser->info['password']);
         $this->forwardAction('u/register/sendActiveEmail', array('_statu' => $identify, 'from' => 'login'), true);
     }
     list(, $refUrl, $rememberme) = explode('|', base64_decode($identify));
     $login = new PwLoginService();
     $login->setLoginCookie($this->loginUser, $this->getRequest()->getClientIp(), $rememberme);
     if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_UNCHECK)) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/show', array('backurl' => $refUrl)));
     }
     if (!$refUrl) {
         $refUrl = Wekit::url()->base;
     }
     if ($synLogin = $this->_getWindid()->synLogin($this->loginUser->uid)) {
         $this->setOutput($this->loginUser->username, 'username');
         $this->setOutput($refUrl, 'refUrl');
         $this->setOutput($synLogin, 'synLogin');
     } else {
         $this->forwardRedirect($refUrl);
     }
 }
Ejemplo n.º 3
0
 /**
  * 执行用户注册
  */
 public function dorunAction()
 {
     //new add
     //验证
     $sign = $this->getInput('sign', 'get');
     $sessionId = Pw::getCookie($this->_getLoginSessionService()->getCookieName());
     $sessionInfo = App_Account_LoginSessionBo::getInstance($sessionId)->getSession();
     $sessionData = $sessionInfo['sessiondata'];
     $app_uid = $sessionData['data']['user_id'];
     $type = $sessionData['type'];
     if (!$sessionId || !$this->_getAccountTypeService()->checkType($type) || $sessionData['data']['sign'] != $sign || !$app_uid) {
         $this->showError("非法访问");
     }
     $this->setOutput('注册', 'title');
     $registerService = new PwRegisterService();
     $registerService->setUserDm($this->_getUserDm());
     /*[u_regsiter]:插件扩展*/
     $this->runHook('c_register', $registerService);
     if (($info = $registerService->register()) instanceof PwError) {
         $this->showError($info->getError());
     } else {
         $identity = PwRegisterService::createRegistIdentify($info['uid'], $info['password']);
         //绑定 new add
         Wekit::load('EXT:account.service.srv.App_Account_BindService')->bind($info['uid'], $app_uid, $type);
         if (1 == Wekit::C('register', 'active.mail')) {
             $this->forwardAction('u/register/sendActiveEmail', array('_statu' => $identity), true);
         } else {
             $this->forwardAction('u/register/welcome', array('_statu' => $identity), true);
         }
     }
 }