Index: trunk/extensions/Renameuser/SpecialRenameuser.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | define( 'RENAMEUSER_CONTRIBLIMIT', 5000 ); |
26 | 26 | |
27 | 27 | function wfSpecialRenameuser() { |
28 | | - global $IP, $wgMessageCache; |
| 28 | + global $IP, $wgMessageCache, $wgHooks; |
29 | 29 | |
30 | 30 | $wgMessageCache->addMessages( |
31 | 31 | array( |
— | — | @@ -37,10 +37,17 @@ |
38 | 38 | 'renameusererrortoomany' => 'The user "<nowiki>$1</nowiki>" has $2 contributions, renaming a user with more ' . |
39 | 39 | 'than $3 contributions could adversely affect site performance', |
40 | 40 | 'renameusersuccess' => 'The user "<nowiki>$1</nowiki>" has been renamed to "<nowiki>$2</nowiki>"', |
| 41 | + |
| 42 | + 'renameuserlogpage' => 'User rename log', |
| 43 | + 'renameuserlogpagetext' => 'This is a log of changes to user names', |
41 | 44 | 'renameuserlog' => 'Renamed the user "[[User:$1|$1]]" to "[[User:$2|$2]]"', |
42 | 45 | ) |
43 | 46 | ); |
44 | 47 | |
| 48 | + $wgHooks['LogPageValidTypes'][] = 'wfSpecialRenameuserAddLogType'; |
| 49 | + $wgHooks['LogPageLogName'][] = 'wfSpecialRenameuserAddLogName'; |
| 50 | + $wgHooks['LogPageLogHeader'][] = 'wfSpecialRenameuserAddLogHeader'; |
| 51 | + |
45 | 52 | require_once( "$IP/includes/SpecialPage.php" ); |
46 | 53 | class Renameuser extends SpecialPage { |
47 | 54 | function Renameuser() { |
— | — | @@ -139,11 +146,11 @@ |
140 | 147 | return; |
141 | 148 | } |
142 | 149 | |
143 | | - $rename = new RenameuserSQL($oldusername, $newusername, $uid ); |
| 150 | + $rename = new RenameuserSQL( $oldusername, $newusername, $uid ); |
144 | 151 | $rename->rename(); |
145 | 152 | |
146 | | - $log = new LogPage( '' ); |
147 | | - $log->addEntry( '', $wgTitle, wfMsg( 'renameuserlog', $oldusername, $newusername ) ); |
| 153 | + $log = new LogPage( 'renameuser' ); |
| 154 | + $log->addEntry( 'renameuser', $wgTitle, wfMsg( 'renameuserlog', $oldusername, $newusername ) ); |
148 | 155 | |
149 | 156 | $wgOut->addWikiText( wfMsg( 'renameusersuccess', $oldusername, $newusername ) ); |
150 | 157 | } |
— | — | @@ -239,3 +246,16 @@ |
240 | 247 | } |
241 | 248 | SpecialPage::addPage( new Renameuser ); |
242 | 249 | } |
| 250 | + |
| 251 | +function wfSpecialRenameuserAddLogType( &$types ) { |
| 252 | + if ( !in_array( 'renameuser', $types ) ) |
| 253 | + $types[] = 'renameuser'; |
| 254 | +} |
| 255 | + |
| 256 | +function wfSpecialRenameuserAddLogName( &$names ) { |
| 257 | + $names['renameuser'] = 'renameuserlogpage'; |
| 258 | +} |
| 259 | + |
| 260 | +function wfSpecialRenameuserAddLogHeader( &$headers ) { |
| 261 | + $headers['renameuser'] = 'renameuserlogpagetext'; |
| 262 | +} |