r38769 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38768‎ | r38769 | r38770 >
Date:11:46, 7 August 2008
Author:siebrand
Status:old
Tags:
Comment:
Add option to also process auto created users with $wgNewUserMessageOnAutoCreate. Disabled by default.
Modified paths:
  • /trunk/extensions/NewUserMessage/NewUserMessage.class.php (modified) (history)
  • /trunk/extensions/NewUserMessage/NewUserMessage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NewUserMessage/NewUserMessage.php
@@ -14,14 +14,16 @@
1515
1616 define('NEWUSERMESSAGE_VERSION','2.0, 2008-06-04');
1717
18 -$wgNewUserSupressRC = false; // Specify whether or not the new user message creation should show up in recent changes
19 -$wgNewUserMinorEdit = true; // Should the new user message creation be a minor edit?
 18+$wgNewUserSupressRC = false; // Specify whether or not the new user message creation should show up in recent changes
 19+$wgNewUserMinorEdit = true; // Should the new user message creation be a minor edit?
 20+$wgNewUserMessageOnAutoCreate = false; // Should auto creation (CentralAuth) trigger a new user message?
2021
2122 $dir = dirname(__FILE__) . '/';
2223 $wgExtensionMessagesFiles['NewUserMessage'] = $dir . 'NewUserMessage.i18n.php';
2324 $wgAutoloadClasses['NewUserMessage'] = $dir . 'NewUserMessage.class.php';
2425
2526 $wgHooks['AddNewAccount'][] = 'NewUserMessage::createNewUserMessage';
 27+$wgHooks['AuthPluginAutoCreate'][] = 'NewUserMessage::createNewUserMessageAutoCreated';
2628 $wgHooks['UserGetReservedNames'][] = 'NewUserMessage::onUserGetReservedNames';
2729
2830 $wgExtensionCredits['other'][] = array(
Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php
@@ -73,6 +73,16 @@
7474 return true;
7575 }
7676
 77+ static function createNewUserMessageAutoCreated( $user ) {
 78+ global $wgNewUserMessageOnAutoCreate;
 79+
 80+ if( $wgNewUserMessageOnAutoCreate ) {
 81+ NewUserMessage::createNewUserMessage( $user );
 82+ }
 83+
 84+ return true;
 85+ }
 86+
7787 static function onUserGetReservedNames( &$names ) {
7888 wfLoadExtensionMessages( 'NewUserMessage' );
7989 $names[] = 'msg:newusermessage-editor';

Status & tagging log