Index: trunk/extensions/NewUserMessage/NewUserMessage.php |
— | — | @@ -14,14 +14,16 @@ |
15 | 15 | |
16 | 16 | define('NEWUSERMESSAGE_VERSION','2.0, 2008-06-04'); |
17 | 17 | |
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? |
20 | 21 | |
21 | 22 | $dir = dirname(__FILE__) . '/'; |
22 | 23 | $wgExtensionMessagesFiles['NewUserMessage'] = $dir . 'NewUserMessage.i18n.php'; |
23 | 24 | $wgAutoloadClasses['NewUserMessage'] = $dir . 'NewUserMessage.class.php'; |
24 | 25 | |
25 | 26 | $wgHooks['AddNewAccount'][] = 'NewUserMessage::createNewUserMessage'; |
| 27 | +$wgHooks['AuthPluginAutoCreate'][] = 'NewUserMessage::createNewUserMessageAutoCreated'; |
26 | 28 | $wgHooks['UserGetReservedNames'][] = 'NewUserMessage::onUserGetReservedNames'; |
27 | 29 | |
28 | 30 | $wgExtensionCredits['other'][] = array( |
Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php |
— | — | @@ -73,6 +73,16 @@ |
74 | 74 | return true; |
75 | 75 | } |
76 | 76 | |
| 77 | + static function createNewUserMessageAutoCreated( $user ) { |
| 78 | + global $wgNewUserMessageOnAutoCreate; |
| 79 | + |
| 80 | + if( $wgNewUserMessageOnAutoCreate ) { |
| 81 | + NewUserMessage::createNewUserMessage( $user ); |
| 82 | + } |
| 83 | + |
| 84 | + return true; |
| 85 | + } |
| 86 | + |
77 | 87 | static function onUserGetReservedNames( &$names ) { |
78 | 88 | wfLoadExtensionMessages( 'NewUserMessage' ); |
79 | 89 | $names[] = 'msg:newusermessage-editor'; |