r48402 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48401‎ | r48402 | r48403 >
Date:10:02, 14 March 2009
Author:aaron
Status:ok
Tags:
Comment:
* Log unsuppressed names in the suppress log as normal
* Fixed reblock action display
* Add hiddenname flag and msg
Modified paths:
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1871,6 +1871,7 @@
18721872 'block-log-flags-noemail',
18731873 'block-log-flags-nousertalk',
18741874 'block-log-flags-angry-autoblock',
 1875+ 'block-log-flags-hiddenname',
18751876 'range_block_disabled',
18761877 'ipb_expiry_invalid',
18771878 'ipb_expiry_temp',
Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -407,6 +407,8 @@
408408 $this->BlockEmail, isset( $this->BlockAllowUsertalk ) ? $this->BlockAllowUsertalk : $wgBlockAllowsUTEdit
409409 );
410410
 411+ # Should this be privately logged?
 412+ $suppressLog = (bool)$this->BlockHideName;
411413 if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) {
412414
413415 if ( !$block->insert() ) {
@@ -419,6 +421,7 @@
420422 if( $block->equals( $currentBlock ) ) {
421423 return array( 'ipb_already_blocked' );
422424 }
 425+ $suppressLog = $suppressLog || (bool)$currentBlock->mHideName;
423426 $currentBlock->delete();
424427 $block->insert();
425428 $log_action = 'reblock';
@@ -444,7 +447,7 @@
445448 $logParams[] = $this->blockLogFlags();
446449
447450 # Make log entry, if the name is hidden, put it in the oversight log
448 - $log_type = ($this->BlockHideName) ? 'suppress' : 'block';
 451+ $log_type = $suppressLog ? 'suppress' : 'block';
449452 $log = new LogPage( $log_type );
450453 $log->addEntry( $log_action, Title::makeTitle( NS_USER, $this->BlockAddress ),
451454 $reasonstr, $logParams );
@@ -517,6 +520,8 @@
518521 $flags[] = 'noemail';
519522 if ( !$this->BlockAllowUsertalk && $wgBlockAllowsUTEdit )
520523 $flags[] = 'nousertalk';
 524+ if ( $this->BlockHideName )
 525+ $flags[] = 'hiddenname';
521526 return implode( ',', $flags );
522527 }
523528
Index: trunk/phase3/includes/LogPage.php
@@ -201,7 +201,7 @@
202202 } else {
203203 $details = '';
204204 array_unshift( $params, $titleLink );
205 - if ( $key == 'block/block' || $key == 'suppress/block' || $key == 'block/reblock' ) {
 205+ if ( preg_match( '/^(block|suppress)\/(block|reblock)$/', $key ) ) {
206206 if ( $skin ) {
207207 $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' .
208208 $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2687,6 +2687,7 @@
26882688 'block-log-flags-noemail' => 'e-mail blocked',
26892689 'block-log-flags-nousertalk' => 'cannot edit own talk page',
26902690 'block-log-flags-angry-autoblock' => 'enhanced autoblock enabled',
 2691+'block-log-flags-hiddenname' => 'username hidden',
26912692 'range_block_disabled' => 'The administrator ability to create range blocks is disabled.',
26922693 'ipb_expiry_invalid' => 'Expiry time invalid.',
26932694 'ipb_expiry_temp' => 'Hidden username blocks must be permanent.',

Status & tagging log