Beispiel #1
0
 public function synLogout($uid)
 {
     Wind::import('SRC:service.user.srv.PwUserService');
     $srv = new PwUserService();
     $srv->logout();
     return true;
 }
Beispiel #2
0
 /** 
  * 密码验证
  */
 public function doeditemailAction()
 {
     list($passwd, $email) = $this->getInput(array('passwd', 'email'), 'post');
     if (!$passwd || !$email) {
         $this->showError('USER:empty.error');
     }
     Wind::import('SRV:user.srv.PwTryPwdBp');
     $tryPwdBp = new PwTryPwdBp();
     if (($result = $tryPwdBp->checkPassword($this->loginUser->uid, $passwd, $this->getRequest()->getClientIp())) instanceof PwError) {
         list($error, ) = $result->getError();
         if ($error == 'USER:login.error.pwd') {
             $this->showError($result->getError());
         } else {
             Wind::import('SRC:service.user.srv.PwUserService');
             $srv = new PwUserService();
             $srv->logout();
             $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('profile/index/run')));
         }
     }
     $userDm = new PwUserInfoDm($this->loginUser->uid);
     $r = PwUserValidator::isEmailValid($email, $this->loginUser->username);
     if ($r instanceof PwError) {
         $this->showError($r->getError());
     }
     $userDm->setEmail($email);
     $result = $this->_editUser($userDm, PwUser::FETCH_MAIN);
     if ($result instanceof PwError) {
         $this->showError($result->getError());
     } else {
         $this->loginUser->info = array_merge($this->loginUser->info, $userDm->getData());
         $this->showMessage('USER:user.edit.contact.success', 'profile/index/contact?_tab=contact');
     }
 }