当前位置: 首页>>代码示例>>PHP>>正文


PHP Block::getBlocker方法代码示例

本文整理汇总了PHP中Block::getBlocker方法的典型用法代码示例。如果您正苦于以下问题:PHP Block::getBlocker方法的具体用法?PHP Block::getBlocker怎么用?PHP Block::getBlocker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Block的用法示例。


在下文中一共展示了Block::getBlocker方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: userBlockedMessage

 /**
  * Output a message that informs the user that they cannot create an account because
  * there is a block on them or their IP which prevents account creation.  Note that
  * User::isBlockedFromCreateAccount(), which gets this block, ignores the 'hardblock'
  * setting on blocks (bug 13611).
  * @param $block Block the block causing this error
  */
 function userBlockedMessage(Block $block)
 {
     global $wgOut;
     # Let's be nice about this, it's likely that this feature will be used
     # for blocking large numbers of innocent people, e.g. range blocks on
     # schools. Don't blame it on the user. There's a small chance that it
     # really is the user's fault, i.e. the username is blocked and they
     # haven't bothered to log out before trying to create an account to
     # evade it, but we'll leave that to their guilty conscience to figure
     # out.
     $wgOut->setPageTitle(wfMsg('cantcreateaccounttitle'));
     $block_reason = $block->mReason;
     if (strval($block_reason) === '') {
         $block_reason = wfMsg('blockednoreason');
     }
     $wgOut->addWikiMsg('cantcreateaccount-text', $block->getTarget(), $block_reason, $block->getBlocker()->getName());
     $wgOut->returnToMain(false);
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:25,代码来源:SpecialUserlogin.php

示例2: __construct

 public function __construct(Block $block)
 {
     global $wgLang, $wgRequest;
     $blocker = $block->getBlocker();
     if ($blocker instanceof User) {
         // local user
         $blockerUserpage = $block->getBlocker()->getUserPage();
         $link = "[[{$blockerUserpage->getPrefixedText()}|{$blockerUserpage->getText()}]]";
     } else {
         // foreign user
         $link = $blocker;
     }
     $reason = $block->mReason;
     if ($reason == '') {
         $reason = wfMsg('blockednoreason');
     }
     /* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
      * This could be a username, an IP range, or a single IP. */
     $intended = $block->getTarget();
     parent::__construct('blockedtitle', $block->mAuto ? 'autoblockedtext' : 'blockedtext', array($link, $reason, $wgRequest->getIP(), $block->getByName(), $block->getId(), $wgLang->formatExpiry($block->mExpiry), $intended, $wgLang->timeanddate(wfTimestamp(TS_MW, $block->mTimestamp), true)));
 }
开发者ID:yusufchang,项目名称:app,代码行数:21,代码来源:Exception.php

示例3: eventlogBlockIp

 /**
  * @static
  * @param Block $block instance of Block class includes/Block.php
  * @param User $user instance of User class includes/User.php
  * @return bool true 'cause it's a hook
  */
 public static function eventlogBlockIp($block, $user)
 {
     self::log("block", "block", $user->getID(), $user->getName(), $block->getBlocker(), $block->getTarget(), $block->mReason);
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:11,代码来源:StaffLog.events.php


注:本文中的Block::getBlocker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。