Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php |
— | — | @@ -321,11 +321,17 @@ |
322 | 322 | $updater->addExtensionUpdate( array( 'addPgField', 'abuse_filter_log', 'afl_deleted', 'SMALLINT' ) ); |
323 | 323 | $updater->addExtensionUpdate( array( 'changeField', 'abuse_filter_log', 'afl_filter', 'TEXT' ) ); |
324 | 324 | $updater->addExtensionUpdate( array( 'addPgExtIndex', 'abuse_filter_log', 'abuse_filter_log_ip', "(afl_ip)" ) ); |
325 | | - } else { |
326 | | - throw new MWException("No known Schema updates."); |
327 | 325 | } |
328 | 326 | |
329 | | - // Create the Abuse Filter user. |
| 327 | + $updater->addExtensionUpdate( array( array( __CLASS__, 'createAbuseFilterUser' ) ) ); |
| 328 | + |
| 329 | + return true; |
| 330 | + } |
| 331 | + |
| 332 | + /** |
| 333 | + * Updater callback to create the AbuseFilter user after the user tables have been updated. |
| 334 | + */ |
| 335 | + public static function createAbuseFilterUser( $updater ) { |
330 | 336 | $user = User::newFromName( wfMsgForContent( 'abusefilter-blocker' ) ); |
331 | 337 | |
332 | 338 | if ( $user && !$updater->updateRowExists( 'create abusefilter-blocker-user' ) ) { |
— | — | @@ -345,8 +351,6 @@ |
346 | 352 | # Promote user so it doesn't look too crazy. |
347 | 353 | $user->addGroup( 'sysop' ); |
348 | 354 | } |
349 | | - |
350 | | - return true; |
351 | 355 | } |
352 | 356 | |
353 | 357 | /** |