public function run() { $resource = Wind::getComponent('i18n'); list($_pwdMsg, $_pwdArgs) = PwUserValidator::buildPwdShowMsg(); $this->setOutput($resource->getMessage($_pwdMsg, $_pwdArgs), 'pwdReg'); $this->setCurrentLeft('password'); $this->appendBread('修改密码', WindUrlHelper::createUrl('profile/password/run')); $this->setTemplate('profile_password'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $lang = Wind::getComponent('i18n'); PwSeoBo::setCustomSeo($lang->getMessage('SEO:profile.password.run.title'), '', ''); }
/** * 验证邮件展示重置密码页面 */ public function resetpwdAction() { list($userinfo, $value, $type, $statu) = $this->checkState(); $code = $this->getInput('code', 'get'); $findPasswordBp = new PwFindPassword($userinfo['username']); if ($type == PwFindPassword::WAY_EMAIL) { if ($findPasswordBp->isOverByMail()) { $this->showError('USER:findpwd.over.limit.email'); } if (($result = $findPasswordBp->checkResetEmail($value, $code)) instanceof PwError) { $this->showError($result->getError()); } } if ($type == PwFindPassword::WAY_MOBILE) { if ($findPasswordBp->isOverByMobile()) { $this->showError('USER:findpwd.over.limit.mobile'); } list($mobile, $mobileCode) = $this->getInput(array('mobile', 'mobileCode'), 'get'); if (($mobileCheck = Wekit::load('mobile.srv.PwMobileService')->checkVerify($mobile, $mobileCode)) instanceof PwError) { $this->showError($mobileCheck->getError()); } } $resource = Wind::getComponent('i18n'); list($_pwdMsg, $_pwdArgs) = PwUserValidator::buildPwdShowMsg(); $this->setOutput($resource->getMessage($_pwdMsg, $_pwdArgs), 'pwdReg'); $this->setOutput($userinfo['username'], 'username'); $this->setOutput($statu, 'statu'); $this->setTemplate('findpwd_resetpwd'); }
/** * 密码校验,ajax action */ public function checkpwdAction() { $returnData = array("success" => true, "data" => "更新成功"); $pwd = $this->getInput('pwd', 'post'); $result = PwUserValidator::isPwdValid($pwd, $this->loginUser->username); if ($result instanceof PwError) { $resource = Wind::getComponent('i18n'); list($_pwdMsg, $_pwdArgs) = PwUserValidator::buildPwdShowMsg(); $message = $resource->getMessage($_pwdMsg, $_pwdArgs); $returnData['success'] = false; $returnData['data'] = $message; print_r(json_encode($returnData)); die; } $userDm = new PwUserInfoDm($this->loginUser->uid); $userDm->setUsername($this->loginUser->username); $userDm->setPassword($pwd); /* @var $userDs PwUser */ $userDs = Wekit::load('user.PwUser'); if (($result = $userDs->editUser($userDm, PwUser::FETCH_MAIN)) instanceof PwError) { $message = $result->getError(); $returnData['success'] = false; $returnData['data'] = $message; print_r(json_encode($returnData)); die; } $this->loginUser->reset(); print_r(json_encode($returnData)); die; }
/** * 初始化 */ 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'); }