Index: trunk/extensions/UserMerge/UserMerge_body.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | |
7 | 7 | ///Special page class for the User Merge and Delete extension |
8 | 8 | /** |
9 | | - * Special page that allows sysops to merge referances from one |
| 9 | + * Special page that allows sysops to merge references from one |
10 | 10 | * user to another user - also supports deleting users following |
11 | 11 | * merge. |
12 | 12 | * |
— | — | @@ -155,9 +155,9 @@ |
156 | 156 | $wgOut->addHTML( "<span style=\"color: red;\">" . wfMsg( 'usermerge-badtoken' ) . "</span><br />\n" ); |
157 | 157 | } else { |
158 | 158 | //good editToken |
159 | | - $this->mergeUser( $newuser_text, $newuserID, $olduser_text, $olduserID ); |
| 159 | + $this->mergeUser( $objNewUser, $newuser_text, $newuserID, $objOldUser, $olduser_text, $olduserID ); |
160 | 160 | if ( $wgRequest->getText( 'deleteuser' ) ) { |
161 | | - $this->deleteUser($olduserID, $olduser_text); |
| 161 | + $this->deleteUser( $objOldUser, $olduserID, $olduser_text); |
162 | 162 | } |
163 | 163 | } |
164 | 164 | } |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | * |
174 | 174 | * @return Always returns true - throws exceptions on failure. |
175 | 175 | */ |
176 | | - private function deleteUser( $olduserID, $olduser_text ) { |
| 176 | + private function deleteUser( $objOldUser, $olduserID, $olduser_text ) { |
177 | 177 | global $wgOut,$wgUser; |
178 | 178 | |
179 | 179 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -181,8 +181,10 @@ |
182 | 182 | $wgOut->addHTML( wfMsg( 'usermerge-userdeleted', $olduser_text, $olduserID ) ); |
183 | 183 | |
184 | 184 | $log = new LogPage( 'usermerge' ); |
185 | | - $log->addEntry( 'deleteuser', $wgUser->getUserPage(),'',array($olduser_text,$olduserID) ); |
| 185 | + $log->addEntry( 'deleteuser', $wgUser->getUserPage(), '', array( $olduser_text,$olduserID ) ); |
186 | 186 | |
| 187 | + wfRunHooks( 'DeleteAccount', array( $objOldUser ) ); |
| 188 | + |
187 | 189 | $users = $dbw->selectField( 'user', 'COUNT(*)', array() ); |
188 | 190 | $admins = $dbw->selectField( 'user_groups', 'COUNT(*)', array( 'ug_group' => 'sysop' ) ); |
189 | 191 | $dbw->update( 'site_stats', |
— | — | @@ -191,19 +193,19 @@ |
192 | 194 | return true; |
193 | 195 | } |
194 | 196 | |
195 | | - ///Function to merge database referances from one user to another user |
| 197 | + ///Function to merge database references from one user to another user |
196 | 198 | /** |
197 | 199 | * Merges database references from one user ID or username to another user ID or username |
198 | 200 | * to preserve referential integrity. |
199 | 201 | * |
200 | | - * @param $newuser_text string Username to merge referances TO |
201 | | - * @param $newuserID int ID of user to merge referances TO |
202 | | - * @param $olduser_text string Username of user to remove referances FROM |
203 | | - * @param $olduserID int ID of user to remove referances FROM |
| 202 | + * @param $newuser_text string Username to merge references TO |
| 203 | + * @param $newuserID int ID of user to merge references TO |
| 204 | + * @param $olduser_text string Username of user to remove references FROM |
| 205 | + * @param $olduserID int ID of user to remove references FROM |
204 | 206 | * |
205 | 207 | * @return Always returns true - throws exceptions on failure. |
206 | 208 | */ |
207 | | - private function mergeUser( $newuser_text, $newuserID, $olduser_text, $olduserID ) { |
| 209 | + private function mergeUser( $objNewUser, $newuser_text, $newuserID, $objOldUser, $olduser_text, $olduserID ) { |
208 | 210 | global $wgOut, $wgUser; |
209 | 211 | |
210 | 212 | $textUpdateFields = array( |
— | — | @@ -248,6 +250,8 @@ |
249 | 251 | $log = new LogPage( 'usermerge' ); |
250 | 252 | $log->addEntry( 'mergeuser', $wgUser->getUserPage(),'',array($olduser_text,$olduserID,$newuser_text,$newuserID) ); |
251 | 253 | |
| 254 | + wfRunHooks( 'MergeAccountFromTo', array( $objOldUser, $objNewUser ) ); |
| 255 | + |
252 | 256 | return true; |
253 | 257 | } |
254 | 258 | } |
Index: trunk/extensions/UserMerge/UserMerge.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | 'url' => 'http://www.mediawiki.org/wiki/Extension:User_Merge_and_Delete', |
17 | 17 | 'author' => 'Tim Laqua', |
18 | 18 | 'descriptionmsg' => 'usermerge-desc', |
19 | | - 'version' => '1.6.1' |
| 19 | + 'version' => '1.6.2' |
20 | 20 | ); |
21 | 21 | |
22 | 22 | $wgAvailableRights[] = 'usermerge'; |