Пример #1
0
 public function synLogin($uid)
 {
     Wind::import('SRC:service.user.bo.PwUserBo');
     Wind::import('SRC:service.user.srv.PwLoginService');
     $userBo = new PwUserBo($uid);
     if ($userBo->isExists() && !Pw::getstatus($userBo->info['status'], PwUser::STATUS_UNACTIVE)) {
         $srv = new PwLoginService();
         $ip = Wind::getApp()->getRequest()->getClientIp();
         $srv->setLoginCookie($userBo, $ip, 1);
     }
     exit;
     //return true;
 }
Пример #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);
     }
 }
Пример #3
0
 /**
  * 完成注册,显示欢迎信息
  */
 public function welcomeAction()
 {
     if (!$this->getInput('_statu')) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/register/run'));
     }
     $statu = $this->checkRegisterUser();
     if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_UNACTIVE)) {
         $this->forwardAction('u/register/sendActiveEmail', array('_statu' => $statu), true);
     }
     Wind::import('SRV:user.srv.PwLoginService');
     $login = new PwLoginService();
     $login->setLoginCookie($this->loginUser, $this->getRequest()->getClientIp());
     $this->forwardRedirect(WindUrlHelper::createUrl('u/register/guide'));
 }