public function welcome(PwUserBo $userBo, $ip) { Wind::import('SRV:user.srv.PwBanBp'); $banBp = new PwBanBp($userBo->uid); if ($banBp->checkIfBan()) { if (Pw::getstatus($userBo->info['status'], PwUser::STATUS_BAN_AVATAR) && false === $banBp->checkIfBanAvatar()) { $banBp->recoveryBanAvatarError(); } else { $banBp->endDateTimeBanAvatar(); } if (Pw::getstatus($userBo->info['status'], PwUser::STATUS_BAN_SIGN) && false === $banBp->checkIfBanSign()) { $banBp->recoveryBanSignError(); } else { $banBp->endDateTimeBanSign(); } if ($userBo->gid == 6 && false == $banBp->checkIfBanSpeak()) { $banBp->recoveryBanSpeaKError(); } else { $banBp->endDateTimeBanSpeak(); } $userBo->info = array_merge($userBo->info, Wekit::load('user.PwUser')->getUserByUid($userBo->uid)); $userBo->gid = $userBo->info['groupid'] == 0 ? $userBo->info['memberid'] : $userBo->info['groupid']; if ($userBo->info['groups']) { $userBo->groups = explode(',', $userBo->info['groups']); } $userBo->groups[] = $this->gid; } return $userBo; }
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); }