r41633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41632‎ | r41633 | r41634 >
Date:01:56, 4 October 2008
Author:nicdumz
Status:old (Comments)
Tags:
Comment:
Using a $wg conf var instead of a constant
Modified paths:
  • /trunk/extensions/Renameuser/SpecialRenameuser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser.php
@@ -39,9 +39,9 @@
4040 define( 'RENAMEUSER_CONTRIBLIMIT', 2000000 );
4141 define( 'RENAMEUSER_CONTRIBJOB', 10000 );
4242 /**
43 - * If you do not want to disallow the move of root userpages, set this to true
 43+ * If you do not want to disallow the move of root userpages, set this to false in your LocalSettings.php
4444 */
45 -define( 'RENAMEUSER_ROOTUSERPAGEMOVE', false );
 45+$wgRenameUserCheckRootUserpageMoves = true;
4646
4747 # Add a new log type
4848 global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions;
@@ -68,9 +68,14 @@
6969 $wgAutoloadClasses['RenameuserHooks'] = dirname( __FILE__ ) . '/SpecialRenameuser_body.php';
7070 $wgAutoloadClasses['RenameUserJob'] = dirname(__FILE__) . '/RenameUserJob.php';
7171
72 -if ( !RENAMEUSER_ROOTUSERPAGEMOVE )
73 - $wgHooks['AbortMove'][] = 'RenameuserHooks::isValidMove';
 72+function wfRenameuserSetup () {
 73+ global $wgRenameUserCheckRootUserpageMoves, $wgHooks;
 74+ if ( $wgRenameUserCheckRootUserpageMoves )
 75+ $wgHooks['AbortMove'][] = 'RenameuserHooks::isValidMove';
 76+}
7477
 78+$wgExtensionFunctions[] = 'wfRenameuserSetup';
 79+
7580 $wgSpecialPages['Renameuser'] = 'SpecialRenameuser';
7681 $wgSpecialPageGroups['Renameuser'] = 'users';
7782 $wgJobClasses['renameUser'] = 'RenameUserJob';

Comments

#Comment by Voice of All (talk | contribs)   16:40, 8 October 2008

Could this var have a better name?

#Comment by Voice of All (talk | contribs)   15:04, 13 October 2008

reverted; Tim moved right to core

Status & tagging log