Exemplo n.º 1
0
 /** 
  * 用户注册信息错误
  * 
  * @return void
  */
 public function regErrorAction()
 {
     if (in_array('register', Wekit::C('verify', 'showverify'))) {
         $this->setOutput('verify');
     }
     $config = Wekit::C('register');
     $this->setOutput($config, 'config');
     $this->setOutput(PwUserHelper::getRegFieldsMap(), 'needFields');
     $this->setOutput(array('location', 'hometown'), 'selectFields');
     $this->setOutput($this->error, 'message');
     $userForm = $this->getInput('pwUserRegisterForm');
     $this->setOutput($userForm->getData(), 'data');
     $this->setOutput($this->state, 'state');
     $this->setTemplatePath('TPL:u');
     $this->setTemplateExt('htm');
     $this->setTemplate('register');
 }
Exemplo n.º 2
0
 public function run()
 {
     $userInfo = Wekit::load('user.PwUser')->getUserByUid($this->loginUser->uid, PwUser::FETCH_INFO);
     $userInfo = array_merge($this->loginUser->info, $userInfo);
     list($year, $month, $day) = PwUserHelper::getBirthDay();
     $this->setOutput($this->_buildArea($userInfo['location']), 'location');
     $this->setOutput($this->_buildArea($userInfo['hometown']), 'hometown');
     $isAllowSign = false;
     if ($this->loginUser->getPermission('allow_sign')) {
         $isAllowSign = true;
         $isSignBan = false;
         if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_BAN_SIGN)) {
             Wind::import('SRV:user.srv.PwBanBp');
             $banBp = new PwBanBp($this->loginUser->uid);
             if (false === $banBp->checkIfBanSign()) {
                 $banBp->recoveryBanSignError();
             } elseif ($banBp->endDateTimeBanSign()) {
                 $s = 1 << PwUser::STATUS_BAN_SIGN - 1;
                 $this->loginUser->info['status'] = $this->loginUser->info['status'] - $s;
             } else {
                 $isSignBan = true;
             }
         }
     }
     $extendsSrv = new PwUserProfileExtends($this->loginUser);
     list($_left, $_tab) = $this->getMenuService()->getCurrentTab($this->getInput('_left'), $this->getInput('_tab'));
     $extendsSrv->setCurrent($_left, $_tab);
     $this->runHook('c_profile_foot_run', $extendsSrv);
     $this->setOutput($extendsSrv, 'hookSrc');
     $this->setOutput($isAllowSign, 'isAllowSign');
     $this->setOutput($isSignBan, 'isSignBan');
     $this->setOutput($this->loginUser->getPermission('sign_max_length'), 'signMaxLength');
     $this->setOutput($year, 'years');
     $this->setOutput($month, 'months');
     $this->setOutput($day, 'days');
     $this->setOutput($userInfo, 'userinfo');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:profile.index.run.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
Exemplo n.º 3
0
 /**
  * 获得安全问题列表
  *
  * @return array
  */
 private function _getQuestions()
 {
     $questions = PwUserHelper::getSafeQuestion();
     $questions[-4] = '自定义安全问题';
     return $questions;
 }
Exemplo n.º 4
0
 public function checkPwdStrongAction()
 {
     $returnData = array("success" => true, "data" => "符合要求");
     $pwd = $this->getInput('pwd', 'post');
     $rank = PwUserHelper::checkPwdStrong($pwd);
     $message = "";
     switch ($rank) {
         case 1:
             $message = "非常弱";
             break;
         case 2:
             $message = "弱";
             break;
         case 3:
             $message = "中";
             break;
         case 4:
             $message = "强";
             break;
     }
     $result = "<span class='pwd_strength_" . $rank . "'" . ">" . $message . "</span>" . $message;
     $returnData['data'] = $result;
     print_r(json_encode($returnData));
     die;
 }
Exemplo n.º 5
0
 /**
  * 初始化
  */
 private function init()
 {
     $registerService = new PwRegisterService();
     $result = $registerService->checkIp($this->getRequest()->getClientIp());
     if ($result instanceof PwError) {
         $this->showMessage($result->getError());
     }
     $resource = Wind::getComponent('i18n');
     list($_pwdMsg, $_pwdArgs) = PwUserValidator::buildPwdShowMsg();
     list($_nameMsg, $_nameArgs) = PwUserValidator::buildNameShowMsg();
     $this->setOutput($resource->getMessage($_pwdMsg, $_pwdArgs), 'pwdReg');
     $this->setOutput($resource->getMessage($_nameMsg, $_nameArgs), 'nameReg');
     $this->setOutput($this->_showVerify(), 'verify');
     $this->setOutput($this->_getRegistConfig(), 'config');
     $this->setOutput(PwUserHelper::getRegFieldsMap(), 'needFields');
     $this->setOutput(array('location', 'hometown'), 'areaFields');
 }
Exemplo n.º 6
0
 /**
  * 密码校验
  */
 public function checkpwdAction()
 {
     $pwd = $this->getInput('pwd', 'post');
     $result = PwUserValidator::isPwdValid($pwd, $this->loginUser->username);
     if ($result instanceof PwError) {
         $this->showError($result->getError());
     }
     $this->addMessage(PwUserHelper::checkPwdStrong($pwd), 'rank');
     $this->showMessage();
 }