r45527 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45526‎ | r45527 | r45528 >
Date:21:58, 7 January 2009
Author:siebrand
Status:resolved (Comments)
Tags:
Comment:
Add user's real name as second template parameter. Based on suggestion by anonymous on http://www.mediawiki.org/wiki/Extension:NewUserMessage
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
@@ -12,9 +12,9 @@
1313 if (!defined('MEDIAWIKI'))
1414 die('Not an entry point.');
1515
16 -define('NEWUSERMESSAGE_VERSION','2.0, 2008-06-04');
 16+define('NEWUSERMESSAGE_VERSION','2.1, 2009-01-07');
1717
18 -$wgNewUserSuppressRC = false; // Specify whether or not the new user message creation should show up in recent changes
 18+$wgNewUserSuppressRC = false; // Specify whether or not the new user message creation should show up in recent changes
1919 $wgNewUserMinorEdit = true; // Should the new user message creation be a minor edit?
2020 $wgNewUserMessageOnAutoCreate = false; // Should auto creation (CentralAuth) trigger a new user message?
2121
Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php
@@ -17,17 +17,18 @@
1818 * Add the template message if the users talk page doesn't already exist
1919 */
2020 static function createNewUserMessage($user) {
21 - $name = $user->getName();
22 - $talk = $user->getTalkPage();
23 -
2421 if (!$talk->exists()) {
2522 global $wgUser, $wgNewUserMinorEdit, $wgNewUserSuppressRC;
2623
 24+ $name = $user->getName();
 25+ $realName = $user->getRealName();
 26+ $talk = $user->getTalkPage();
 27+
2728 wfLoadExtensionMessages( 'NewUserMessage' );
2829
2930 $article = new Article($talk);
3031
31 - // Create a user object for the editing user and add it to the database
 32+ // Create a user object for the editing user and add it to the database
3233 // if it's not there already
3334 $editor = User::newFromName( wfMsgForContent( 'newusermessage-editor' ) );
3435 if ( !$editor->isLoggedIn() ) {
@@ -51,7 +52,7 @@
5253 $dbw->begin();
5354 $good = true;
5455
55 - $text = "{{{$templateTitleText}|$name}}";
 56+ $text = "{{{$templateTitleText}|$name|$realName}}";
5657 $signatures = wfMsgForContent( 'newusermessage-signatures' );
5758 if ( !wfEmptyMsg( 'newusermessage-signatures', $signatures ) ) {
5859 $pattern = '/^\* ?(.*?)$/m';

Follow-up revisions

RevisionCommit summaryAuthorDate
r45561Fix for r45527: put $talk def back at top since it's already used in the next...ialex11:37, 8 January 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   13:42, 8 January 2009

Fix in r45561

Status & tagging log