當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。