本文整理汇总了PHP中Pw::getstatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Pw::getstatus方法的具体用法?PHP Pw::getstatus怎么用?PHP Pw::getstatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pw
的用法示例。
在下文中一共展示了Pw::getstatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
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'), '', '');
}
示例2: welcome
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;
}
示例3: bulidThread
public function bulidThread($thread)
{
if ($thread['issort'] && $thread['topped']) {
$thread['icon'] = 'headtopic_' . $thread['topped'];
} elseif ($thread['digest']) {
$thread['icon'] = 'digest';
} elseif (Pw::getstatus($thread['tpcstatus'], PwThread::STATUS_LOCKED)) {
$thread['icon'] = 'lock';
} elseif ($thread['special'] && isset($this->specialIcon[$thread['special']])) {
$thread['icon'] = $this->specialIcon[$thread['special']];
} elseif ($thread['replies'] > $this->_iconHot) {
$thread['icon'] = 'topichot';
} elseif (Pw::getTime() - $thread['created_time'] < $this->_iconNew) {
$thread['icon'] = 'topicnew';
} else {
$thread['icon'] = 'topic';
}
if ($thread['overtime'] && $thread['overtime'] < Pw::getTime()) {
$overtimeService = Wekit::load("SRV:forum.srv.PwOvertimeService");
$overtimeService->updateOvertime($thread['tid']);
}
if ($thread['highlight']) {
$highlight = Wekit::load("Lib:utility.PwHighlight");
$thread['highlight_style'] = $highlight->getStyle($thread['highlight']);
}
if ($thread['inspect']) {
$thread['inspect'] = explode("\t", $thread['inspect']);
}
if ($thread['ifshield']) {
$thread['highlight_style'] = 'text-decoration: line-through';
$thread['subject'] = '此帖已被屏蔽';
}
return $this->runWithFilters('bulidThread', $thread);
}
示例4: updateUserStatus
public function updateUserStatus($uid, $status)
{
$userDs = $this->loadUser();
$user = $userDs->getUserByUid($uid, PwUser::FETCH_MAIN);
if ($user && !Pw::getstatus($user['status'], PwUser::STATUS_ALLOW_LOGIN_ADMIN)) {
Wind::import('SRV:user.dm.PwUserInfoDm');
$dm = new PwUserInfoDm($uid);
$dm->setAllowLoginAdmin($status);
$userDs->editUser($dm, PwUser::FETCH_MAIN);
}
return true;
}
示例5: synLogin
public function synLogin($uid)
{
Wind::import('SRC:service.user.bo.PwUserBo');
Wind::import('SRC:service.user.srv.PwLoginService');
$userBo = new PwUserBo($uid);
if ($userBo->isExists() && !Pw::getstatus($userBo->info['status'], PwUser::STATUS_UNACTIVE)) {
$srv = new PwLoginService();
$ip = Wind::getApp()->getRequest()->getClientIp();
$srv->setLoginCookie($userBo, $ip, 1);
}
exit;
//return true;
}
示例6: createHtml
public function createHtml($left, $tab)
{
$verify = $this->_getDs()->getVerify($this->user->uid);
$types = $this->_getService()->getOpenVerifyType();
$typeNames = $this->_getService()->getVerifyTypeName();
$haveVerify = $noVerify = array();
foreach ($types as $k => $v) {
if (Pw::getstatus($verify['type'], $k)) {
$haveVerify[$typeNames[$k]] = $v;
} else {
$noVerify[$typeNames[$k]] = $v;
}
}
$conf = Wekit::C('app_verify');
$rightType = $this->_getService()->getRightType();
PwHook::template('displayAppProfileVerify', 'EXT:verify.template.index_run', true, $rightType, $types, $haveVerify, $noVerify, $conf);
}
示例7: deleteBan
public function deleteBan($uid)
{
/* @var $userDs PwUser */
$userDs = Wekit::load('SRV:user.PwUser');
$info = $userDs->getUserByUid($uid, PwUser::FETCH_MAIN);
if (!Pw::getstatus($info['status'], PwUser::STATUS_BAN_SIGN)) {
return $info['status'];
}
//已经解禁不需要再次更改
$userDm = new PwUserInfoDm($uid);
$userDm->setBanSign(false);
// ->setBbsSign('')
/* @var $userDs PwUser */
$userDs = Wekit::load('SRV:user.PwUser');
$userDs->editUser($userDm, PwUser::FETCH_MAIN | PwUser::FETCH_INFO);
$s = 1 << PwUser::STATUS_BAN_SIGN - 1;
return intval($info['status'] - $s);
}
示例8: run
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);
}
示例9: deleteBan
public function deleteBan($uid)
{
/* @var $userDs PwUser */
$userDs = Wekit::load('SRV:user.PwUser');
$info = $userDs->getUserByUid($uid, PwUser::FETCH_MAIN);
if (!Pw::getstatus($info['status'], PwUser::STATUS_BAN_AVATAR)) {
return $info['status'];
}
//已经解禁不需要再次更改
$userDm = new PwUserInfoDm($uid);
$userDm->setBanAvatar(false);
/* @var $userDs PwUser */
$userDs = Wekit::load('SRV:user.PwUser');
$userDs->editUser($userDm, PwUser::FETCH_MAIN);
/* @var $userSrv PwUserService */
$userSrv = Wekit::load('SRV:user.srv.PwUserService');
$userSrv->restoreDefualtAvatar($uid);
$p = 1 << PwUser::STATUS_BAN_AVATAR - 1;
return intval($info['status'] - $p);
}
示例10: doactiveAction
/**
* 批量激活用户
*
*/
public function doactiveAction()
{
$uids = $this->getInput('uid', 'post');
if (!$uids) {
$this->showError('operate.select');
}
/* @var $userDs PwUser */
$userDs = Wekit::load('user.PwUser');
$infos = $userDs->fetchUserByUid($uids, PwUser::FETCH_MAIN);
/* @var $groupService PwUserGroupsService */
$groupService = Wekit::load('usergroup.srv.PwUserGroupsService');
$strategy = Wekit::C('site', 'upgradestrategy');
$clearUid = array();
foreach ($infos as $_temp) {
$clearUid[] = $_temp['uid'];
if (Pw::getstatus($_temp['status'], PwUser::STATUS_UNACTIVE)) {
$userDm = new PwUserInfoDm($_temp['uid']);
$userDm->setUnactive(false);
if (!Pw::getstatus($_temp['status'], PwUser::STATUS_UNCHECK)) {
$userDm->setGroupid(0);
$_credit = $userDs->getUserByUid($_temp['uid'], PwUser::FETCH_DATA);
$credit = $groupService->calculateCredit($strategy, $_credit);
$memberid = $groupService->calculateLevel($credit, 'member');
$userDm->setMemberid($memberid);
}
$userDs->editUser($userDm, PwUser::FETCH_MAIN);
}
}
$this->_getDs()->batchActiveUser($clearUid);
$this->showMessage('operate.success');
}
示例11: _getLockManage
protected function _getLockManage($manage)
{
Wind::import('SRV:forum.srv.manage.PwThreadManageDoLock');
$do = new PwThreadManageDoLock($manage);
if (!$this->doAction) {
if ($this->singleData) {
$defaultLocked = Pw::getstatus($this->singleData['tpcstatus'], PwThread::STATUS_CLOSED) ? 2 : 1;
} else {
$defaultLocked = 1;
}
$this->setOutput($defaultLocked, 'defaultLocked');
} else {
$locked = $this->getInput('locked', 'post');
$do->setLocked($locked)->setReason($this->getInput('reason', 'post'));
!$locked && ($this->doCancel[] = 'dolock');
}
return $do;
}
示例12: showAction
/**
* 提示信息
*/
public function showAction()
{
if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_UNCHECK)) {
$this->showError('USER:login.active.check');
}
$this->forwardRedirect($this->_filterUrl());
}
示例13: guideAction
/**
* 用户引导页面
*
*/
public function guideAction()
{
if (!$this->loginUser->isExists()) {
$this->forwardRedirect(Wekit::url()->base);
}
$key = $this->getInput('key');
/* @var $guideService PwUserRegisterGuideService */
$guideService = Wekit::load('APPS:u.service.PwUserRegisterGuideService');
$next = $guideService->getNextGuide($key);
if (!$next) {
if (Wekit::C('register', 'active.check')) {
$this->setOutput(1, 'check');
if (!Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_UNCHECK)) {
$this->forwardRedirect(Wekit::url()->base);
}
}
$synLogin = $this->_getWindid()->synLogin($this->loginUser->uid);
$this->setOutput($this->loginUser->info['username'], 'username');
$this->setOutput('success', 'type');
$this->setOutput($synLogin, 'synLogin');
$this->setTemplate('register_about');
} else {
$this->forwardRedirect(WindUrlHelper::createUrl($next['guide']));
}
}
示例14: run
/**
* 帖子阅读页
*/
public function run()
{
$tid = intval($this->getInput('tid'));
list($page, $uid, $desc) = $this->getInput(array('page', 'uid', 'desc'), 'get');
$threadDisplay = new PwThreadDisplay($tid, $this->loginUser);
$this->runHook('c_read_run', $threadDisplay);
if (($result = $threadDisplay->check()) !== true) {
$this->showError($result->getError());
}
$_cache = Wekit::cache()->fetch(array('level', 'group_right'));
$pwforum = $threadDisplay->getForum();
if ($pwforum->foruminfo['password']) {
if (!$this->loginUser->isExists()) {
$this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('bbs/cate/run', array('fid' => ${$pwforum}->fid))));
} elseif (Pw::getPwdCode($pwforum->foruminfo['password']) != Pw::getCookie('fp_' . $pwforum->fid)) {
$this->forwardAction('bbs/forum/password', array('fid' => $pwforum->fid));
}
}
if ($uid) {
Wind::import('SRV:forum.srv.threadDisplay.PwUserRead');
$dataSource = new PwUserRead($threadDisplay->thread, $uid);
} else {
Wind::import('SRV:forum.srv.threadDisplay.PwCommonRead');
$dataSource = new PwCommonRead($threadDisplay->thread);
}
$dataSource->setPage($page)->setPerpage($pwforum->forumset['readperpage'] ? $pwforum->forumset['readperpage'] : Wekit::C('bbs', 'read.perpage'))->setDesc($desc);
$threadDisplay->setImgLazy(Wekit::C('bbs', 'read.image_lazy'));
$threadDisplay->execute($dataSource);
$operateReply = $operateThread = array();
$isBM = $pwforum->isBM($this->loginUser->username);
if ($threadPermission = $this->loginUser->getPermission('operate_thread', $isBM, array())) {
$operateReply = Pw::subArray($threadPermission, array('toppedreply', 'remind', 'shield', 'delete', 'ban', 'inspect', 'read'));
$operateThread = Pw::subArray($threadPermission, array('digest', 'topped', 'up', 'highlight', 'copy', 'type', 'move', 'lock', 'down', 'delete', 'ban'));
}
$threadInfo = $threadDisplay->getThreadInfo();
$this->setOutput($threadDisplay, 'threadDisplay');
$this->setOutput($tid, 'tid');
$this->setOutput($threadDisplay->fid, 'fid');
$this->setOutput($threadInfo, 'threadInfo');
$this->setOutput($threadDisplay->getList(), 'readdb');
$this->setOutput($threadDisplay->getUsers(), 'users');
$this->setOutput($pwforum, 'pwforum');
$this->setOutput(PwCreditBo::getInstance(), 'creditBo');
$this->setOutput($threadDisplay->getHeadguide(), 'headguide');
$this->setOutput(Wekit::C('bbs', 'read.display_member_info'), 'displayMemberInfo');
$this->setOutput(Wekit::C('bbs', 'read.display_info'), 'displayInfo');
$this->setOutput(Wekit::C('bbs', 'thread.hotthread_replies'), 'hotIcon');
$this->setOutput($threadPermission, 'threadPermission');
$this->setOutput($operateThread, 'operateThread');
$this->setOutput($operateReply, 'operateReply');
$this->setOutput(!$this->loginUser->uid && !$this->allowPost($pwforum) ? ' J_qlogin_trigger' : '', 'postNeedLogin');
$this->setOutput(!$this->loginUser->uid && !$this->allowReply($pwforum) ? ' J_qlogin_trigger' : '', 'replyNeedLogin');
$this->setOutput($_cache['level']['ltitle'], 'ltitle');
$this->setOutput($_cache['level']['lpic'], 'lpic');
$this->setOutput($_cache['level']['lneed'], 'lneed');
$this->setOutput($_cache['group_right'], 'groupRight');
$this->setOutput($threadDisplay->page, 'page');
$this->setOutput($threadDisplay->perpage, 'perpage');
$this->setOutput($threadDisplay->total, 'count');
$this->setOutput($threadDisplay->maxpage, 'totalpage');
$this->setOutput($threadDisplay->getUrlArgs(), 'urlargs');
$this->setOutput($threadDisplay->getUrlArgs('desc'), 'urlDescArgs');
$this->setOutput($this->loginUser->getPermission('look_thread_log', $isBM, array()), 'canLook');
$this->setOutput($this->_getFpage($threadDisplay->fid), 'fpage');
//版块风格
if ($pwforum->foruminfo['style']) {
$this->setTheme('forum', $pwforum->foruminfo['style']);
//$this->addCompileDir($pwforum->foruminfo['style']);
}
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$seoBo = PwSeoBo::getInstance();
$lang = Wind::getComponent('i18n');
$threadDisplay->page <= 1 && $seoBo->setDefaultSeo($lang->getMessage('SEO:bbs.read.run.title'), '', $lang->getMessage('SEO:bbs.read.run.description'));
$seoBo->init('bbs', 'read');
$seoBo->set(array('{forumname}' => $threadDisplay->forum->foruminfo['name'], '{title}' => $threadDisplay->thread->info['subject'], '{description}' => Pw::substrs($threadDisplay->thread->info['content'], 100, 0, false), '{classfication}' => $threadDisplay->thread->info['topic_type'], '{tags}' => $threadInfo['tags'], '{page}' => $threadDisplay->page));
Wekit::setV('seo', $seoBo);
//是否显示回复
$showReply = true;
//锁定时间
if ($pwforum->forumset['locktime'] && $threadInfo['created_time'] + $pwforum->forumset['locktime'] * 86400 < Pw::getTime()) {
$showReply = false;
} elseif (Pw::getstatus($threadInfo['tpcstatus'], PwThread::STATUS_LOCKED) && !$this->loginUser->getPermission('reply_locked_threads')) {
$showReply = false;
}
$this->setOutput($showReply, 'showReply');
$this->runReadDesign($threadDisplay->fid);
$this->updateReadOnline($threadDisplay->fid, $tid);
}
示例15: activeEmail
/**
* 激活email
*
* @param int $uid 用户ID
* @param string $email 用户Email
* @param string $code 激活码
* @return boolean
*/
public function activeEmail($uid, $email, $code)
{
/* @var $activeCodeDs PwUserActiveCode */
$activeCodeDs = Wekit::load('user.PwUserActiveCode');
$info = $activeCodeDs->getInfoByUid($uid);
if (!$info || $info['email'] != $email || $info['code'] != $code) {
return new PwError("USER:illegal.request");
}
if ($info['active_time'] > 0) {
return new PwError('USER:active.email.dumplicate');
}
$validTime = $this->activeCodeValidTime * 3600;
if ($info['send_time'] + $validTime < Pw::getTime()) {
return new PwError('USER:active.email.overtime');
}
$activeCodeDs->activeCode($uid, Pw::getTime());
$info = $this->_getUserDs()->getUserByUid($uid, PwUser::FETCH_MAIN);
if (Pw::getstatus($info['status'], PwUser::STATUS_UNACTIVE)) {
$userDm = new PwUserInfoDm($info['uid']);
$userDm->setUnactive(false);
!Pw::getstatus($info['status'], PwUser::STATUS_UNCHECK) && $userDm->setGroupid(0);
$this->_getUserDs()->editUser($userDm, PwUser::FETCH_MAIN);
}
/* @var $registerCheckDs PwUserRegisterCheck */
$registerCheckDs = Wekit::load('user.PwUserRegisterCheck');
$registerCheckDs->activeUser($uid);
return true;
}