Revert r77555 and followups r77563, r77572, r78116 (merge DisableAccount to core).
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 15 Apr 2011 22:49:03 +0000 (22:49 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 15 Apr 2011 22:49:03 +0000 (22:49 +0000)
Per CR at the time: this creates a nearly irreversable action that is not nearly well documented enough (even if disabled by default).

We already have the $wgBlockDisablesLogin kludge in place for this. If we're going to do more work on this idea, it should be well thought out, not another hack.

RELEASE-NOTES
includes/AutoLoader.php
includes/DefaultSettings.php
includes/SpecialPage.php
includes/specials/SpecialDisableAccount.php [deleted file]
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 8b3956f..04b961f 100644 (file)
@@ -67,8 +67,6 @@ PHP if you have not done so prior to upgrading MediaWiki.
   require_once "$IP/extensions/Math/Math.php";
 
 === New features in 1.18 ===
-* Added a special page, disabled by default, that allows users with the
-  'disableaccount' privilege to permanently deactivate user accounts.
 * (bug 8130) Query pages should limit to content namespaces, not just main
   namespace
 * Search suggestions (other than in the Vector skin) will now use the HTML5
index 79c1b57..a19433b 100644 (file)
@@ -683,7 +683,6 @@ $wgAutoloadLocalClasses = array(
        'SpecialBookSources' => 'includes/specials/SpecialBooksources.php',
        'SpecialCategories' => 'includes/specials/SpecialCategories.php',
        'SpecialComparePages' => 'includes/specials/SpecialComparePages.php',
-       'SpecialDisableAccount' => 'includes/specials/SpecialDisableAccount.php',
        'SpecialEditWatchlist' => 'includes/specials/SpecialEditWatchlist.php',
        'SpecialExport' => 'includes/specials/SpecialExport.php',
        'SpecialFilepath' => 'includes/specials/SpecialFilepath.php',
index 56f16e9..bc147c4 100644 (file)
@@ -3370,11 +3370,6 @@ $wgGroupPermissions['bureaucrat']['noratelimit'] = true;
 // For private suppression log access
 #$wgGroupPermissions['suppress']['suppressionlog'] = true;
 
-// Permission to disable user accounts
-// Note that disabling an account is not reversible without a system administrator
-// who has direct access to the database
-#$wgGroupPermissions['bureaucrat']['disableaccount']  = true;
-
 /**
  * The developer group is deprecated, but can be activated if need be
  * to use the 'lockdb' and 'unlockdb' special pages. Those require
index 03671b5..edd789f 100644 (file)
@@ -133,7 +133,6 @@ class SpecialPage {
                'Listbots'                  => 'SpecialListBots',
                'Activeusers'               => 'SpecialActiveUsers',
                'Userrights'                => 'UserrightsPage',
-               'DisableAccount'            => 'SpecialDisableAccount',
                'EditWatchlist'             => 'SpecialEditWatchlist',
 
                # Recent changes and logs
diff --git a/includes/specials/SpecialDisableAccount.php b/includes/specials/SpecialDisableAccount.php
deleted file mode 100644 (file)
index 94b7d17..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-
-class SpecialDisableAccount extends SpecialPage {
-       function __construct() {
-               parent::__construct( 'DisableAccount', 'disableaccount',
-                                       true, array( $this, 'show' ) );
-       }
-
-       public function show( $par ) {
-               $formFields = array(
-                       'account' => array(
-                               'type' => 'text',
-                               'validation-callback' => array( __CLASS__, 'validateUser' ),
-                               'label-message' => 'disableaccount-user',
-                       ),
-                       'comment' => array(
-                               'type' => 'text',
-                               'label-message' => 'disableaccount-reason',
-                       ),
-                       'confirm' => array(
-                               'type' => 'toggle',
-                               'validation-callback' => array( __CLASS__, 'checkConfirmation' ),
-                               'label-message' => 'disableaccount-confirm',
-                       ),
-               );
-
-               $htmlForm = new HTMLForm( $formFields, 'disableaccount' );
-
-               $htmlForm->setSubmitCallback( array( __CLASS__, 'submit' ) );
-               $htmlForm->setTitle( $this->getTitle() );
-
-               $htmlForm->show();
-       }
-
-       static function validateUser( $field, $allFields ) {
-               $u = User::newFromName( $field );
-
-               if ( $u && $u->getID() != 0 ) {
-                       return true;
-               } else {
-                       return wfMsgExt( 'disableaccount-nosuchuser', 'parseinline', array( $field ) );
-               }
-       }
-
-       static function checkConfirmation( $field, $allFields ) {
-               if ( $field ) {
-                       return true;
-               } else {
-                       return wfMsgExt( 'disableaccount-mustconfirm', 'parseinline' );
-               }
-       }
-
-       static function submit( $fields ) {
-               $user = User::newFromName( $fields['account'] );
-
-               $user->setPassword( null );
-               $user->setEmail( null );
-               $user->setToken();
-               $user->addGroup( 'inactive' );
-
-               $user->saveSettings();
-               $user->invalidateCache();
-
-               $logPage = new LogPage( 'rights' );
-
-               $logPage->addEntry( 'disable', $user->getUserPage(), $fields['comment'] );
-
-               global $wgOut;
-               $wgOut->addWikiMsg( 'disableaccount-success', $user->getName() );
-
-               return true;
-       }
-}
\ No newline at end of file
index d00d960..5d19254 100644 (file)
@@ -382,7 +382,6 @@ $specialPageAliases = array(
        'CreateAccount'             => array( 'CreateAccount' ),
        'Deadendpages'              => array( 'DeadendPages' ),
        'DeletedContributions'      => array( 'DeletedContributions' ),
-       'DisableAccount'            => array( 'DisableAccount' ),
        'Disambiguations'           => array( 'Disambiguations' ),
        'DoubleRedirects'           => array( 'DoubleRedirects' ),
        'EditWatchlist'             => array( 'EditWatchlist' ),
@@ -1970,7 +1969,6 @@ If you choose to provide it, this will be used for giving you attribution for yo
 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5',
 'right-sendemail'             => 'Send e-mail to other users',
 'right-revisionmove'          => 'Move revisions',
-'right-disableaccount'        => 'Disable accounts',
 
 # User rights log
 'rightslog'      => 'User rights log',
@@ -4425,18 +4423,4 @@ This site is experiencing technical difficulties.',
 # SQLite database support
 'sqlite-has-fts' => '$1 with full-text search support',
 'sqlite-no-fts'  => '$1 without full-text search support',
-
-# Special:DisableAccount
-'disableaccount'             => 'Disable a user account',
-'disableaccount-user'        => 'Username:',
-'disableaccount-reason'      => 'Reason:',
-'disableaccount-confirm'     => "Disable this user account.
-The user will not be able to log in, reset their password, or receive e-mail notifications.
-If the user is currently logged in anywhere, they will be immediately logged out.
-''Note that disabling an account is not reversible without system administrator intervention.''",
-'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]]',
-
 );
index 5803872..e468646 100644 (file)
@@ -1149,7 +1149,6 @@ $wgMessageStructure = array(
                'right-override-export-depth',
                'right-sendemail',
                'right-revisionmove',
-               'right-disableaccount',
        ),
        'rightslog' => array(
                'rightslog',
@@ -3301,17 +3300,6 @@ $wgMessageStructure = array(
                'sqlite-has-fts',
                'sqlite-no-fts',
        ),
-       'disableaccount' => array(
-               'disableaccount',
-               'disableaccount-user',
-               'disableaccount-reason',
-               'disableaccount-confirm',
-               'disableaccount-mustconfirm',
-               'disableaccount-confirm',
-               'disableaccount-nosuchuser',
-               'disableaccount-success',
-               'disableaccount-logentry',
-       ),
 );
 
 /** Comments for each block */
@@ -3526,5 +3514,4 @@ Variants for Chinese language",
        'db-error-messages'     => 'Database error messages',
        'html-forms'            => 'HTML forms',
        'sqlite'                => 'SQLite database support',
-       'disableaccount'        => 'Special:DisableAccount',
 );