/** * Enter description here ... * * @param unknown_type $uid * @return Ambigous <multitype:unknown , multitype:unknown NULL > */ public function isUserBanned($uid) { $user = new PwUserBo($uid); if (!$user->isExists()) { return $this->buildResponse(PERMISSIONS_USER_NOT_EXISTS); } // $result = $this->getUserBanService ()->getBanInfoByUid ( $uid, 1 ); Wind::import('SRV:user.srv.PwBanBp'); $banBp = new PwBanBp($uid); $result = $banBp->checkIfBanSpeak(); if ($result instanceof PwError) { return $this->buildResponse(-1, $result->getError()); } return $this->buildResponse($result ? 500 : 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); }
public function run() { $this->setCurrentLeft('avatar'); $isAvatarBan = false; if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_BAN_AVATAR)) { Wind::import('SRV:user.srv.PwBanBp'); $banBp = new PwBanBp($this->loginUser->uid); if (false === $banBp->checkIfBanAvatar()) { $banBp->recoveryBanAvatarError(); } elseif ($banBp->endDateTimeBanAvatar()) { $this->loginUser->info['status'] = $banBp->callEndDateTimeBanAvatar(); } else { $isAvatarBan = true; $info = $banBp->getBanAvatarInfo(); if ($info['created_userid'] == 0) { $info['operator'] = 'system'; } else { $operatorInfo = Wekit::load('user.PwUser')->getUserByUid($info['created_userid']); $info['operator'] = $operatorInfo['username']; } $this->setOutput($info, 'banInfo'); } } $windidApi = $this->_getWindid(); $this->setOutput($windidApi->showFlash($this->loginUser->uid), 'avatarFlash'); $this->setOutput($windidApi->showFlash($this->loginUser->uid, 0), 'avatarArr'); $this->setOutput($isAvatarBan, 'isAvatarBan'); $this->setOutput($this->getInput('type'), 'type'); $this->setLayout(''); $this->setTemplate('profile_avatar'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $lang = Wind::getComponent('i18n'); PwSeoBo::setCustomSeo($lang->getMessage('SEO:profile.avatar.run.title'), '', ''); }
/** * 检测用户是否被禁言 * * @return bool */ public function isBan() { if ($this->user->gid == 6) { Wind::import('SRV:user.srv.PwBanBp'); $banBp = new PwBanBp($this->user->uid); $memberid = 0; if (false === $banBp->checkIfBanSpeak()) { $memberid = $banBp->recoveryBanSpeaKError(); } elseif ($banBp->endDateTimeBanSpeak()) { $memberid = $banBp->callEndDateTimeBanSpeak(); } if ($memberid) { $this->user->info['groups'] = ''; $this->user->info['groupid'] = 0; $this->user->info['memberid'] = $memberid; $this->user->groups = array($memberid); $this->user->resetGid($memberid); return false; } return true; } return false; }
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; }