* (bug 10765) img_auth.php will now refuse logged-out requests where
$wgWhitelistRead is undefined, instead of (incorrectly) honouring them
* Fixed img_auth.php file name extraction for whitelist checking
+* (bug 10655) Show standard tool links for blocked users in block log messages
+* Show standard tool links for blocked users in Special:Ipblocklist
== API changes since 1.10 ==
* @addtogroup Skins
*/
class Linker {
+
+ /**
+ * Flags for userToolLinks()
+ */
+ const TOOL_LINKS_NOBLOCK = 1;
+
function __construct() {}
/**
}
/**
- * @param $userId Integer: user id in database.
- * @param $userText String: user name in database.
- * @param $redContribsWhenNoEdits Bool: return a red contribs link when the user had no edits and this is true.
- * @return string HTML fragment with talk and/or block links
+ * Generate standard user tool links (talk, contributions, block link, etc.)
+ *
+ * @param int $userId User identifier
+ * @param string $userText User name or IP address
+ * @param bool $redContribsWhenNoEdits Should the contributions link be red if the user has no edits?
+ * @param int $flags Customisation flags (e.g. self::TOOL_LINKS_NOBLOCK)
+ * @return string
*/
- public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false ) {
+ public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0 ) {
global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans;
$talkable = !( $wgDisableAnonTalk && 0 == $userId );
- $blockable = ( $wgSysopUserBans || 0 == $userId );
+ $blockable = ( $wgSysopUserBans || 0 == $userId ) && !$flags & self::TOOL_LINKS_NOBLOCK;
$items = array();
if( $talkable ) {
if( substr( $title->getText(), 0, 1 ) == '#' ) {
$titleLink = $title->getText();
} else {
- $titleLink = $skin->makeLinkObj( $title, $title->getText() );
- $titleLink .= ' (' . $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() ), wfMsg( 'contribslink' ) ) . ')';
+ // TODO: Store the user identifier in the parameters
+ // to make this faster for future log entries
+ $id = User::idFromName( $title->getText() );
+ $titleLink = $skin->userLink( $id, $title->getText() )
+ . $skin->userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK );
}
break;
case 'rights':
if( $block->mAuto ) {
$target = $block->getRedactedName(); # Hide the IP addresses of auto-blocks; privacy
} else {
- $target = $sk->makeLinkObj( Title::makeTitle( NS_USER, $block->mAddress ), $block->mAddress );
- $target .= ' (' . $sk->makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $block->mAddress ), $msg['contribslink'] ) . ')';
+ $target = $sk->userLink( $block->mUser, $block->mAddress )
+ . $sk->userToolLinks( $block->mUser, $block->mAddress, false, Linker::TOOL_LINKS_NOBLOCK );
}
$formattedTime = $wgLang->timeanddate( $block->mTimestamp, true );
'contribslink' => 'contribs',
'autoblocker' => 'Autoblocked because your IP address has been recently used by "[[User:$1|$1]]". The reason given for $1\'s block is: "$2"',
'blocklogpage' => 'Block log',
-'blocklogentry' => 'blocked "[[$1]]" with an expiry time of $2 $3',
+'blocklogentry' => 'blocked [[$1]] with an expiry time of $2 $3',
'blocklogtext' => 'This is a log of user blocking and unblocking actions. Automatically
blocked IP addresses are not listed. See the [[Special:Ipblocklist|IP block list]] for
the list of currently operational bans and blocks.',