* (bug 7292) Fix site statistics when moving pages in/out of content namespaces
* (bug 6937) Introduce "statistics-footer" message, appended to Special:Statistics
* (bug 8531) Correct local name of Lingála (patch by Raymond)
+* (bug 6638) List block flags in block log entries
== Languages updated ==
} else {
array_unshift( $params, $titleLink );
if ( $translate && $key == 'block/block' ) {
- $params[1] = $wgLang->translateBlockExpiry($params[1]);
+ $params[1] = $wgLang->translateBlockExpiry( $params[1] );
+ $params[2] = isset( $params[2] )
+ ? self::formatBlockFlags( $params[2] )
+ : '';
}
$rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin );
}
return explode( "\n", $blob );
}
}
+
+ /**
+ * Convert a comma-delimited list of block log flags
+ * into a more readable (and translated) form
+ *
+ * @param $flags Flags to format
+ * @return string
+ */
+ public static function formatBlockFlags( $flags ) {
+ static $messages = false;
+ $flags = explode( ',', trim( $flags ) );
+ if( count( $flags ) > 0 ) {
+ for( $i = 0; $i < count( $flags ); $i++ )
+ $flags[$i] = self::formatBlockFlag( $flags[$i] );
+ return '(' . implode( ', ', $flags ) . ')';
+ } else {
+ return '';
+ }
+ }
+
+ /**
+ * Translate a block log flag if possible
+ *
+ * @param $flag Flag to translate
+ * @return string
+ */
+ public static function formatBlockFlag( $flag ) {
+ static $messages = array();
+ if( !isset( $messages[$flag] ) ) {
+ $k = 'block-log-flags-' . $flag;
+ $msg = wfMsg( $k );
+ $messages[$flag] = htmlspecialchars( wfEmptyMsg( $k, $msg ) ? $flag : $msg );
+ }
+ return $messages[$flag];
+ }
+
}
?>
wfRunHooks('BlockIpComplete', array($block, $wgUser));
+ # Prepare log parameters
+ $logParams = array();
+ $logParams[] = $expirestr;
+ $logParams[] = $this->blockLogFlags();
+
# Make log entry
$log = new LogPage( 'block' );
$log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ),
- $this->BlockReason, $expirestr );
+ $this->BlockReason, $logParams );
# Report to the user
$titleObj = SpecialPage::getTitleFor( 'Blockip' );
$viewer = new LogViewer( new LogReader( $request ) );
$viewer->showList( $out );
}
+
+ /**
+ * Return a comma-delimited list of "flags" to be passed to the log
+ * reader for this block, to provide more information in the logs
+ *
+ * @return array
+ */
+ private function blockLogFlags() {
+ $flags = array();
+ if( $this->BlockAnonOnly )
+ $flags[] = 'anononly';
+ if( $this->BlockCreateAccount )
+ $flags[] = 'nocreate';
+ if( $this->BlockEnableAutoblock )
+ $flags[] = 'autoblock';
+ return implode( ',', $flags );
+ }
}
'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',
+'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.',
'unblocklogentry' => 'unblocked $1',
+'block-log-flags-anononly' => 'anonymous users only',
+'block-log-flags-nocreate' => 'account creation disabled',
+'block-log-flags-autoblock' => 'autoblocker enabled',
'range_block_disabled' => 'The sysop ability to create range blocks is disabled.',
'ipb_expiry_invalid' => 'Expiry time invalid.',
'ipb_already_blocked' => '"$1" is already blocked',