Add logging for Special:DisableAccount
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 2 Dec 2010 05:27:32 +0000 (05:27 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 2 Dec 2010 05:27:32 +0000 (05:27 +0000)
includes/DefaultSettings.php
includes/specials/SpecialDisableAccount.php
languages/messages/MessagesEn.php

index b179b4b..1bd0d69 100644 (file)
@@ -4628,6 +4628,7 @@ $wgLogActions = array(
        'protect/unprotect' => 'unprotectedarticle',
        'protect/move_prot' => 'movedarticleprotection',
        'rights/rights'     => 'rightslogentry',
+       'rights/disable'    => 'disableaccount-logentry',
        'delete/delete'     => 'deletedarticle',
        'delete/restore'    => 'undeletedarticle',
        'delete/revision'   => 'revdelete-logentry',
index 0df2159..e937a64 100644 (file)
@@ -13,6 +13,10 @@ class SpecialDisableAccount extends SpecialPage {
                                'validation-callback' => array( __CLASS__, 'validateUser' ),
                                'label-message' => 'disableaccount-user',
                        ),
+                       'comment' => array(
+                               'type' => 'text',
+                               'label-message' => 'movereason',
+                       ),
                        'confirm' => array(
                                'type' => 'toggle',
                                'validation-callback' => array( __CLASS__, 'checkConfirmation' ),
@@ -57,6 +61,10 @@ class SpecialDisableAccount extends SpecialPage {
                $user->saveSettings();
                $user->invalidateCache();
 
+               $logPage = new LogPage( 'rights' );
+
+               $logPage->addEntry( 'disable', $user->getUserPage(), $fields['comment'] );
+
                global $wgOut;
                $wgOut->addWikiMsg( 'disableaccount-success', $user->getName() );
 
index 9dbdec5..aee6e9c 100644 (file)
@@ -4371,4 +4371,5 @@ If the user is currently logged in anywhere, they will be immediately logged out
 'disableaccount-mustconfirm' => 'You must confirm that you wish to disable this account.',
 'disableaccount-nosuchuser' => 'The user account "$1" does not exist.',
 'disableaccount-success' => 'The user account "$1" has been permanently disabled.',
+'disableaccount-logentry' => 'permanently disabled the user account [[$1]].',
 );