Back out r41630 -- merging of Nuke extension to core
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 15 Oct 2008 21:35:19 +0000 (21:35 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 15 Oct 2008 21:35:19 +0000 (21:35 +0000)
Nuke started as a crappy hack, and it's still pretty crappy. ;) Needs better reversibility tools etc before we consider merging to core.

14 files changed:
RELEASE-NOTES
includes/AutoLoader.php
includes/DefaultSettings.php
includes/SpecialPage.php
includes/specials/SpecialNuke.php [deleted file]
languages/messages/MessagesAr.php
languages/messages/MessagesArz.php
languages/messages/MessagesDe.php
languages/messages/MessagesEn.php
languages/messages/MessagesHe.php
languages/messages/MessagesNds_nl.php
languages/messages/MessagesNl.php
languages/messages/MessagesNo.php
maintenance/language/messages.inc

index 9e5a780..6cfc0d3 100644 (file)
@@ -59,7 +59,6 @@ The following extensions are migrated into MediaWiki 1.14:
 * Special:LinkSearch to search for external links (was extension LinkSearch)
 * RenderHash
 * NoMoveUserPages
-* Special:Nuke to mass delete all pages created by a user
 * Poem (patch by Nathaniel Herman)
 * UniversalEditButton
 
index 49e763c..5382fcc 100644 (file)
@@ -478,7 +478,6 @@ $wgAutoloadLocalClasses = array(
        'SpecialBookSources' => 'includes/specials/SpecialBooksources.php',
        'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php',
        'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php',
-       'SpecialNuke' => 'includes/specials/SpecialNuke.php',
        'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php',
        'SpecialRandomredirect' => 'includes/specials/SpecialRandomredirect.php',
        'SpecialRecentchanges' => 'includes/specials/SpecialRecentchanges.php',
index 88d2727..209a3ee 100644 (file)
@@ -1186,8 +1186,6 @@ $wgGroupPermissions['sysop']['markbotedits']     = true;
 $wgGroupPermissions['sysop']['apihighlimits']    = true;
 $wgGroupPermissions['sysop']['browsearchive']    = true;
 $wgGroupPermissions['sysop']['noratelimit']      = true;
-$wgGroupPermissions['sysop']['nuke']             = true;
-
 #$wgGroupPermissions['sysop']['mergehistory']     = true;
 
 // Permission to change users' group assignments
@@ -2862,7 +2860,6 @@ $wgSpecialPageGroups = array(
        'Export'                    => 'pagetools',
        'Import'                    => 'pagetools',
        'Whatlinkshere'             => 'pagetools',
-       'Nuke'                      => 'pagetools',
 
        'Statistics'                => 'wiki',
        'Version'                   => 'wiki',
index f807d19..7c57672 100644 (file)
@@ -164,7 +164,6 @@ class SpecialPage
                'Listadmins'                => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
                'MergeHistory'              => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ),
                'Listbots'                  => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
-               'Nuke'                      => 'SpecialNuke',
        );
 
        static public $mAliases;
diff --git a/includes/specials/SpecialNuke.php b/includes/specials/SpecialNuke.php
deleted file mode 100644 (file)
index ff17a57..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-/**
- * @file
- * @ingroup SpecialPage
- *
- * @author Brion Vibber
- * @copyright Copyright © 2005-2008, Brion Vibber
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
- */
-
-/**
- * implements Special:Nuke
- */
-
-class SpecialNuke extends SpecialPage {
-       function __construct() {
-               parent::__construct( 'Nuke', 'nuke' );
-       }
-
-       function execute( $par ){
-               global $wgUser, $wgRequest;
-
-               if( !$this->userCanExecute( $wgUser ) ){
-                       $this->displayRestrictionError();
-                       return;
-               }
-
-               $this->setHeaders();
-               $this->outputHeader();
-
-               $target = $wgRequest->getText( 'target', $par );
-               $reason = $wgRequest->getText( 'wpReason',
-                       wfMsgForContent( 'nuke-defaultreason', $target ) );
-               $posted = $wgRequest->wasPosted() &&
-                       $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
-               if( $posted ) {
-                       $pages = $wgRequest->getArray( 'pages' );
-                       if( $pages ) {
-                               return $this->doDelete( $pages, $reason );
-                       }
-               }
-               if( $target != '' ) {
-                       $this->listForm( $target, $reason );
-               } else {
-                       $this->promptForm();
-               }
-       }
-
-       function promptForm() {
-               global $wgUser, $wgOut;
-
-               $sk = $wgUser->getSkin();
-
-               $nuke = $this->getTitle();
-               $submit = Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsgHtml( 'nuke-submit-user' ) ) );
-
-               $wgOut->addWikiMsg( 'nuke-tools' );
-               $wgOut->addHTML( Xml::element( 'form', array(
-                               'action' => $nuke->getLocalURL( 'action=submit' ),
-                               'method' => 'post' ),
-                               null ) .
-                       Xml::element( 'input', array(
-                               'type' => 'text',
-                               'size' => 40,
-                               'name' => 'target' ) ) .
-                       "\n$submit\n" );
-
-               $wgOut->addHTML( "</form>" );
-       }
-
-       function listForm( $username, $reason ) {
-               global $wgUser, $wgOut, $wgLang;
-
-               $pages = $this->getNewPages( $username );
-               $escapedName = wfEscapeWikiText( $username );
-               if( count( $pages ) == 0 ) {
-                       $wgOut->addWikiMsg( 'nuke-nopages', $escapedName );
-                       return $this->promptForm();
-               }
-               $wgOut->addWikiMsg( 'nuke-list', $escapedName );
-
-               $nuke = $this->getTitle();
-               $submit = Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsgHtml( 'nuke-submit-delete' ) ) );
-
-               $wgOut->addHTML( Xml::element( 'form', array(
-                       'action' => $nuke->getLocalURL( 'action=delete' ),
-                       'method' => 'post' ),
-                       null ) .
-                       "\n<div>" .
-                       wfMsgHtml( 'deletecomment' ) . ' ' .
-                       Xml::element( 'input', array(
-                               'name' => 'wpReason',
-                               'value' => $reason,
-                               'size' => 60 ) ) .
-                       "</div><br />" .
-                       $submit .
-                       Xml::element( 'input', array(
-                               'type' => 'hidden',
-                               'name' => 'wpEditToken',
-                               'value' => $wgUser->editToken() ) ) .
-                       "\n<ul>\n" );
-
-               $sk = $wgUser->getSkin();
-               foreach( $pages as $info ) {
-                       list( $title, $edits ) = $info;
-                       $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
-                       $thumb = $image && $image->exists() ? $image->getThumbnail( 120, 120 ) : false;
-
-                       $wgOut->addHTML( '<li>' .
-                               Xml::element( 'input', array(
-                                       'type' => 'checkbox',
-                                       'name' => "pages[]",
-                                       'value' => $title->getPrefixedDbKey(),
-                                       'checked' => 'checked' ) ) .
-                               '&nbsp;' .
-                               ( $thumb ? $thumb->toHtml( array( 'desc-link' => true ) ) : '' ) .
-                               $sk->makeKnownLinkObj( $title ) .
-                               '&nbsp;(' .
-                               $sk->makeKnownLinkObj( $title, wfMsgExt( 'nchanges', array( 'parsemag' ), $wgLang->formatNum( $edits ) ), 'action=history' ) .
-                               ")</li>\n" );
-               }
-               $wgOut->addHTML( "</ul>\n$submit</form>" );
-       }
-
-       function getNewPages( $username ) {
-               $dbr = wfGetDB( DB_SLAVE );
-               $result = $dbr->select( 'recentchanges',
-                       array( 'rc_namespace', 'rc_title', 'rc_timestamp', 'COUNT(*) AS edits' ),
-                       array(
-                               'rc_user_text' => $username,
-                               '(rc_new = 1) OR (rc_log_type = "upload" AND rc_log_action = "upload")'
-                       ),
-                       __METHOD__,
-                       array(
-                               'ORDER BY' => 'rc_timestamp DESC',
-                               'GROUP BY' => 'rc_namespace, rc_title'
-                       )
-               );
-               $pages = array();
-               while( $row = $result->fetchObject() ) {
-                       $pages[] = array( Title::makeTitle( $row->rc_namespace, $row->rc_title ), $row->edits );
-               }
-               $result->free();
-               return $pages;
-       }
-
-       function doDelete( $pages, $reason ) {
-               foreach( $pages as $page ) {
-                       $title = Title::newFromUrl( $page );
-                       $file = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
-                       if ( $file ) {
-                               $oldimage = null; // Must be passed by reference
-                               FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false );
-                       } else {
-                               $article = new Article( $title );
-                               $article->doDelete( $reason );
-                       }
-               }
-       }
-}
index 91d2f76..63adce0 100644 (file)
@@ -370,7 +370,6 @@ $specialPageAliases = array(
        'Blankpage'                 => array( 'صفحة_فارغة' ),
        'LinkSearch'                => array( 'بحث_الوصلات' ),
        'DeletedContributions'      => array( 'مساهمات_محذوفة' ),
-       'Nuke'                      => array( 'حذف_كمي' ),
 );
 
 $imageFiles = array(
index 584a73f..2e9f1fa 100644 (file)
@@ -267,7 +267,6 @@ $specialPageAliases = array(
        'Blankpage'                 => array( 'صفحة_فارغة' ),
        'LinkSearch'                => array( 'بحث_الوصلات' ),
        'DeletedContributions'      => array( 'مساهمات_محذوفة' ),
-       'Nuke'                      => array( 'حذف_كمى' ),
 );
 
 $messages = array(
index 67dda68..d9878fe 100644 (file)
@@ -158,7 +158,6 @@ $specialPageAliases = array(
        'Blankpage'                 => array( 'Leerseite' ),
        'LinkSearch'                => array( 'Weblink-Suche' ),
        'DeletedContributions'      => array( 'Gelöschte Beiträge' ),
-       'Nuke'                      => array( 'Massenlöschung' ),
 );
 
 $datePreferences = array(
index e85ca0a..b30688a 100644 (file)
@@ -442,7 +442,6 @@ $specialPageAliases = array(
        'Blankpage'                 => array( 'BlankPage' ),
        'LinkSearch'                => array( 'LinkSearch' ),
        'DeletedContributions'      => array( 'DeletedContributions' ),
-       'Nuke'                      => array( 'Nuke' ),
 );
 
 /**
@@ -3723,16 +3722,4 @@ Enter the filename without the "{{ns:image}}:" prefix.',
 
 #Put all regex fragments above this line. Leave this line exactly as it is</pre>',
 
-# Special:Nuke
-'nuke'               => 'Mass delete',
-'nuke-nopages'       => 'No new pages by [[Special:Contributions/$1|$1]] in recent changes.',
-'nuke-list'          => 'The following pages were recently created by [[Special:Contributions/$1|$1]];
-put in a comment and hit the button to delete them.',
-'nuke-defaultreason' => 'Mass removal of pages added by $1',
-'nuke-tools'         => 'This tool allows for mass deletions of pages recently added by a given user or IP.
-Input the username or IP to get a list of pages to delete.',
-'nuke-submit-user'   => 'Go',
-'nuke-submit-delete' => 'Delete selected',
-'right-nuke'         => 'Mass delete pages',
-
 );
index 08fc09d..6d745bb 100644 (file)
@@ -286,7 +286,6 @@ $specialPageAliases = array(
        'Blankpage'                 => array( 'דף_ריק' ),
        'LinkSearch'                => array( 'חיפוש_קישורים_חיצוניים' ),
        'DeletedContributions'      => array( 'תרומות_מחוקות' ),
-       'Nuke'                      => array( 'מחיקה_מרובה' ),
 );
 
 $namespaceNames = array(
index 46d9b10..cf1125b 100644 (file)
@@ -251,7 +251,6 @@ $specialPageAliases = array(
        'Withoutinterwiki'          => array( 'Gien_interwiki' ),
        'LinkSearch'                => array( 'Verwiezingen_zeuken' ),
        'DeletedContributions'      => array( 'Vort-ehaolen gebrukersbiedragen' ),
-       'Nuke'                      => array( 'Massaal_vortdoon' ),
 );
 
 $linkTrail = '/^([a-zäöüïëéèà]+)(.*)$/sDu';
index ecd6a05..8f0c531 100644 (file)
@@ -282,7 +282,6 @@ $specialPageAliases = array(
        'ListUserRestrictions'      => array( 'Gebruikersbeperkingen' ),
        'RemoveRestrictions'        => array( 'BeperkingenVerwijderen' ),
        'RestrictUser'              => array( 'GebruikerBeperken' ),
-       'Nuke'                      => array( 'MassaalVerwijderen' ),
 );
 
 $linkTrail = '/^([a-zäöüïëéèà]+)(.*)$/sDu';
index a8cefd4..76ed979 100644 (file)
@@ -163,7 +163,6 @@ $specialPageAliases = array(
        'Blankpage'                 => array( 'Blank side' ),
        'LinkSearch'                => array( 'Lenkesøk' ),
        'DeletedContributions'      => array( 'Slettede bidrag' ),
-       'Nuke'                      => array( 'Massesletting' ),
 );
 
 $messages = array(
index fdcece4..a19ab8e 100644 (file)
@@ -2810,16 +2810,6 @@ $wgMessageStructure = array(
        'external_images' => array(
                'external_image_whitelist',
        ),
-       'special-nuke' => array(
-               'nuke',
-               'nuke-nopages',
-               'nuke-list',
-               'nuke-defaultreason',
-               'nuke-tools',
-               'nuke-submit-user',
-               'nuke-submit-delete',
-               'right-nuke',
-       ),
 );
 
 /** Comments for each block */
@@ -3015,7 +3005,6 @@ Variants for Chinese language",
        'special-specialpages'  => 'Special:SpecialPages',
        'special-blank'         => 'Special:BlankPage',
        'external_images'       => 'External image whitelist',
-       'special-nuke'          => 'Special:Nuke',
 );
 
 /** Short comments for standalone messages */