Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2759,6 +2759,17 @@ |
2760 | 2760 | 'external_images' => array( |
2761 | 2761 | 'external_image_whitelist', |
2762 | 2762 | ), |
| 2763 | + 'special-nuke' => array( |
| 2764 | + 'nuke', |
| 2765 | + 'nuke-nopages', |
| 2766 | + 'nuke-list', |
| 2767 | + 'nuke-defaultreason', |
| 2768 | + 'nuke-tools', |
| 2769 | + 'nuke-submit-user', |
| 2770 | + 'nuke-submit-delete', |
| 2771 | + 'right-nuke', |
| 2772 | + ), |
| 2773 | + |
2763 | 2774 | ); |
2764 | 2775 | |
2765 | 2776 | /** Comments for each block */ |
— | — | @@ -2953,6 +2964,7 @@ |
2954 | 2965 | 'special-specialpages' => 'Special:SpecialPages', |
2955 | 2966 | 'special-blank' => 'Special:BlankPage', |
2956 | 2967 | 'external_images' => 'External image whitelist', |
| 2968 | + 'special-nuke' => 'Special:Nuke', |
2957 | 2969 | ); |
2958 | 2970 | |
2959 | 2971 | /** Short comments for standalone messages */ |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -477,6 +477,7 @@ |
478 | 478 | 'SpecialBookSources' => 'includes/specials/SpecialBooksources.php', |
479 | 479 | 'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php', |
480 | 480 | 'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php', |
| 481 | + 'SpecialNuke' => 'includes/specials/SpecialNuke.php', |
481 | 482 | 'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php', |
482 | 483 | 'SpecialRandomredirect' => 'includes/specials/SpecialRandomredirect.php', |
483 | 484 | 'SpecialRecentchanges' => 'includes/specials/SpecialRecentchanges.php', |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1183,6 +1183,8 @@ |
1184 | 1184 | $wgGroupPermissions['sysop']['apihighlimits'] = true; |
1185 | 1185 | $wgGroupPermissions['sysop']['browsearchive'] = true; |
1186 | 1186 | $wgGroupPermissions['sysop']['noratelimit'] = true; |
| 1187 | +$wgGroupPermissions['sysop']['nuke'] = true; |
| 1188 | + |
1187 | 1189 | #$wgGroupPermissions['sysop']['mergehistory'] = true; |
1188 | 1190 | |
1189 | 1191 | // Permission to change users' group assignments |
— | — | @@ -2850,6 +2852,7 @@ |
2851 | 2853 | 'Export' => 'pagetools', |
2852 | 2854 | 'Import' => 'pagetools', |
2853 | 2855 | 'Whatlinkshere' => 'pagetools', |
| 2856 | + 'Nuke' => 'pagetools', |
2854 | 2857 | |
2855 | 2858 | 'Statistics' => 'wiki', |
2856 | 2859 | 'Version' => 'wiki', |
Index: trunk/phase3/includes/specials/SpecialNuke.php |
— | — | @@ -0,0 +1,159 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @file |
| 5 | + * @ingroup SpecialPage |
| 6 | + * |
| 7 | + * @author Brion Vibber |
| 8 | + * @copyright Copyright © 2005-2008, Brion Vibber |
| 9 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 10 | + */ |
| 11 | + |
| 12 | +/** |
| 13 | + * implements Special:Nuke |
| 14 | + */ |
| 15 | + |
| 16 | +class SpecialNuke extends SpecialPage { |
| 17 | + function __construct() { |
| 18 | + parent::__construct( 'Nuke', 'nuke' ); |
| 19 | + } |
| 20 | + |
| 21 | + function execute( $par ){ |
| 22 | + global $wgUser, $wgRequest; |
| 23 | + |
| 24 | + if( !$this->userCanExecute( $wgUser ) ){ |
| 25 | + $this->displayRestrictionError(); |
| 26 | + return; |
| 27 | + } |
| 28 | + |
| 29 | + $this->setHeaders(); |
| 30 | + $this->outputHeader(); |
| 31 | + |
| 32 | + $target = $wgRequest->getText( 'target', $par ); |
| 33 | + $reason = $wgRequest->getText( 'wpReason', |
| 34 | + wfMsgForContent( 'nuke-defaultreason', $target ) ); |
| 35 | + $posted = $wgRequest->wasPosted() && |
| 36 | + $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ); |
| 37 | + if( $posted ) { |
| 38 | + $pages = $wgRequest->getArray( 'pages' ); |
| 39 | + if( $pages ) { |
| 40 | + return $this->doDelete( $pages, $reason ); |
| 41 | + } |
| 42 | + } |
| 43 | + if( $target != '' ) { |
| 44 | + $this->listForm( $target, $reason ); |
| 45 | + } else { |
| 46 | + $this->promptForm(); |
| 47 | + } |
| 48 | + } |
| 49 | + |
| 50 | + function promptForm() { |
| 51 | + global $wgUser, $wgOut; |
| 52 | + $sk =& $wgUser->getSkin(); |
| 53 | + |
| 54 | + $nuke = Title::makeTitle( NS_SPECIAL, 'Nuke' ); |
| 55 | + $submit = Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsgHtml( 'nuke-submit-user' ) ) ); |
| 56 | + |
| 57 | + $wgOut->addWikiText( wfMsg( 'nuke-tools' ) ); |
| 58 | + $wgOut->addHTML( Xml::element( 'form', array( |
| 59 | + 'action' => $nuke->getLocalURL( 'action=submit' ), |
| 60 | + 'method' => 'post' ), |
| 61 | + null ) . |
| 62 | + Xml::element( 'input', array( |
| 63 | + 'type' => 'text', |
| 64 | + 'size' => 40, |
| 65 | + 'name' => 'target' ) ) . |
| 66 | + "\n$submit\n" ); |
| 67 | + |
| 68 | + $wgOut->addHTML( "</form>" ); |
| 69 | + } |
| 70 | + |
| 71 | + function listForm( $username, $reason ) { |
| 72 | + global $wgUser, $wgOut, $wgLang; |
| 73 | + |
| 74 | + $pages = $this->getNewPages( $username ); |
| 75 | + $escapedName = wfEscapeWikiText( $username ); |
| 76 | + if( count( $pages ) == 0 ) { |
| 77 | + $wgOut->addWikiText( wfMsg( 'nuke-nopages', $escapedName ) ); |
| 78 | + return $this->promptForm(); |
| 79 | + } |
| 80 | + $wgOut->addWikiText( wfMsg( 'nuke-list', $escapedName ) ); |
| 81 | + |
| 82 | + $nuke = $this->getTitle(); |
| 83 | + $submit = Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsgHtml( 'nuke-submit-delete' ) ) ); |
| 84 | + |
| 85 | + $wgOut->addHTML( Xml::element( 'form', array( |
| 86 | + 'action' => $nuke->getLocalURL( 'action=delete' ), |
| 87 | + 'method' => 'post' ), |
| 88 | + null ) . |
| 89 | + "\n<div>" . |
| 90 | + wfMsgHtml( 'deletecomment' ) . ' ' . |
| 91 | + Xml::element( 'input', array( |
| 92 | + 'name' => 'wpReason', |
| 93 | + 'value' => $reason, |
| 94 | + 'size' => 60 ) ) . |
| 95 | + "</div><br />" . |
| 96 | + $submit . |
| 97 | + Xml::element( 'input', array( |
| 98 | + 'type' => 'hidden', |
| 99 | + 'name' => 'wpEditToken', |
| 100 | + 'value' => $wgUser->editToken() ) ) . |
| 101 | + "\n<ul>\n" ); |
| 102 | + |
| 103 | + $sk =& $wgUser->getSkin(); |
| 104 | + foreach( $pages as $info ) { |
| 105 | + list( $title, $edits ) = $info; |
| 106 | + $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false; |
| 107 | + $thumb = $image && $image->exists() ? $image->getThumbnail( 120, 120 ) : false; |
| 108 | + |
| 109 | + $wgOut->addHTML( '<li>' . |
| 110 | + Xml::element( 'input', array( |
| 111 | + 'type' => 'checkbox', |
| 112 | + 'name' => "pages[]", |
| 113 | + 'value' => $title->getPrefixedDbKey(), |
| 114 | + 'checked' => 'checked' ) ) . |
| 115 | + ' ' . |
| 116 | + ( $thumb ? $thumb->toHtml( array( 'desc-link' => true ) ) : '' ) . |
| 117 | + $sk->makeKnownLinkObj( $title ) . |
| 118 | + ' (' . |
| 119 | + $sk->makeKnownLinkObj( $title, wfMsgExt( 'nchanges', array( 'parsemag' ), $wgLang->formatNum( $edits ) ), 'action=history' ) . |
| 120 | + ")</li>\n" ); |
| 121 | + } |
| 122 | + $wgOut->addHTML( "</ul>\n$submit</form>" ); |
| 123 | + } |
| 124 | + |
| 125 | + function getNewPages( $username ) { |
| 126 | + $dbr = wfGetDB( DB_SLAVE ); |
| 127 | + $result = $dbr->select( 'recentchanges', |
| 128 | + array( 'rc_namespace', 'rc_title', 'rc_timestamp', 'COUNT(*) AS edits' ), |
| 129 | + array( |
| 130 | + 'rc_user_text' => $username, |
| 131 | + '(rc_new = 1) OR (rc_log_type = "upload" AND rc_log_action = "upload")' |
| 132 | + ), |
| 133 | + __METHOD__, |
| 134 | + array( |
| 135 | + 'ORDER BY' => 'rc_timestamp DESC', |
| 136 | + 'GROUP BY' => 'rc_namespace, rc_title' |
| 137 | + ) |
| 138 | + ); |
| 139 | + $pages = array(); |
| 140 | + while( $row = $dbr->fetchObject( $result ) ) { |
| 141 | + $pages[] = array( Title::makeTitle( $row->rc_namespace, $row->rc_title ), $row->edits ); |
| 142 | + } |
| 143 | + $dbr->freeResult( $result ); |
| 144 | + return $pages; |
| 145 | + } |
| 146 | + |
| 147 | + function doDelete( $pages, $reason ) { |
| 148 | + foreach( $pages as $page ) { |
| 149 | + $title = Title::newFromUrl( $page ); |
| 150 | + $file = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false; |
| 151 | + if ( $file ) { |
| 152 | + $oldimage = null; // Must be passed by reference |
| 153 | + FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false ); |
| 154 | + } else { |
| 155 | + $article = new Article( $title ); |
| 156 | + $article->doDelete( $reason ); |
| 157 | + } |
| 158 | + } |
| 159 | + } |
| 160 | +} |
Property changes on: trunk/phase3/includes/specials/SpecialNuke.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
Added: svn:eol-style |
1 | 161 | + native |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -164,6 +164,7 @@ |
165 | 165 | 'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ), |
166 | 166 | 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ), |
167 | 167 | 'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ), |
| 168 | + 'Nuke' => 'SpecialNuke', |
168 | 169 | ); |
169 | 170 | |
170 | 171 | static public $mAliases; |
Index: trunk/phase3/languages/messages/MessagesHe.php |
— | — | @@ -283,6 +283,7 @@ |
284 | 284 | 'Blankpage' => array( 'דף_ריק' ), |
285 | 285 | 'LinkSearch' => array( 'חיפוש_קישורים_חיצוניים' ), |
286 | 286 | 'DeletedContributions' => array( 'תרומות_מחוקות' ), |
| 287 | + 'Nuke' => array( 'מחיקה_מרובה' ), |
287 | 288 | ); |
288 | 289 | |
289 | 290 | $namespaceNames = array( |
Index: trunk/phase3/languages/messages/MessagesAr.php |
— | — | @@ -367,6 +367,7 @@ |
368 | 368 | 'Blankpage' => array( 'صفحة_فارغة' ), |
369 | 369 | 'LinkSearch' => array( 'بحث_الوصلات' ), |
370 | 370 | 'DeletedContributions' => array( 'مساهمات_محذوفة' ), |
| 371 | + 'Nuke' => array( 'حذف_كمي' ), |
371 | 372 | ); |
372 | 373 | |
373 | 374 | $imageFiles = array( |
Index: trunk/phase3/languages/messages/MessagesNds_nl.php |
— | — | @@ -251,6 +251,7 @@ |
252 | 252 | 'Withoutinterwiki' => array( 'Gien_interwiki' ), |
253 | 253 | 'LinkSearch' => array( 'Verwiezingen_zeuken' ), |
254 | 254 | 'DeletedContributions' => array( 'Vort-ehaolen gebrukersbiedragen' ), |
| 255 | + 'Nuke' => array( 'Massaal_vortdoon' ), |
255 | 256 | ); |
256 | 257 | |
257 | 258 | $linkTrail = '/^([a-zäöüïëéèà]+)(.*)$/sDu'; |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -439,6 +439,7 @@ |
440 | 440 | 'Blankpage' => array( 'BlankPage' ), |
441 | 441 | 'LinkSearch' => array( 'LinkSearch' ), |
442 | 442 | 'DeletedContributions' => array( 'DeletedContributions' ), |
| 443 | + 'Nuke' => array( 'Nuke' ), |
443 | 444 | ); |
444 | 445 | |
445 | 446 | /** |
— | — | @@ -3670,4 +3671,16 @@ |
3671 | 3672 | |
3672 | 3673 | #Put all regex fragments above this line. Leave this line exactly as it is</pre>', |
3673 | 3674 | |
| 3675 | +# Special:Nuke |
| 3676 | +'nuke' => 'Mass delete', |
| 3677 | +'nuke-nopages' => 'No new pages by [[Special:Contributions/$1|$1]] in recent changes.', |
| 3678 | +'nuke-list' => 'The following pages were recently created by [[Special:Contributions/$1|$1]]; |
| 3679 | +put in a comment and hit the button to delete them.', |
| 3680 | +'nuke-defaultreason' => 'Mass removal of pages added by $1', |
| 3681 | +'nuke-tools' => 'This tool allows for mass deletions of pages recently added by a given user or IP. |
| 3682 | +Input the username or IP to get a list of pages to delete.', |
| 3683 | +'nuke-submit-user' => 'Go', |
| 3684 | +'nuke-submit-delete' => 'Delete selected', |
| 3685 | +'right-nuke' => 'Mass delete pages', |
| 3686 | + |
3674 | 3687 | ); |
Index: trunk/phase3/languages/messages/MessagesNo.php |
— | — | @@ -163,6 +163,7 @@ |
164 | 164 | 'Blankpage' => array( 'Blank side' ), |
165 | 165 | 'LinkSearch' => array( 'Lenkesøk' ), |
166 | 166 | 'DeletedContributions' => array( 'Slettede bidrag' ), |
| 167 | + 'Nuke' => array( 'Massesletting' ), |
167 | 168 | ); |
168 | 169 | |
169 | 170 | $messages = array( |
Index: trunk/phase3/languages/messages/MessagesArz.php |
— | — | @@ -264,6 +264,7 @@ |
265 | 265 | 'Blankpage' => array( 'صفحة_فارغة' ), |
266 | 266 | 'LinkSearch' => array( 'بحث_الوصلات' ), |
267 | 267 | 'DeletedContributions' => array( 'مساهمات_محذوفة' ), |
| 268 | + 'Nuke' => array( 'حذف_كمى' ), |
268 | 269 | ); |
269 | 270 | |
270 | 271 | $messages = array( |
Index: trunk/phase3/languages/messages/MessagesNl.php |
— | — | @@ -278,6 +278,7 @@ |
279 | 279 | 'ListUserRestrictions' => array( 'Gebruikersbeperkingen' ), |
280 | 280 | 'RemoveRestrictions' => array( 'BeperkingenVerwijderen' ), |
281 | 281 | 'RestrictUser' => array( 'GebruikerBeperken' ), |
| 282 | + 'Nuke' => array( 'MassaalVerwijderen' ), |
282 | 283 | ); |
283 | 284 | |
284 | 285 | $linkTrail = '/^([a-zäöüïëéèà]+)(.*)$/sDu'; |
Index: trunk/phase3/languages/messages/MessagesDe.php |
— | — | @@ -157,6 +157,7 @@ |
158 | 158 | 'Blankpage' => array( 'Leerseite' ), |
159 | 159 | 'LinkSearch' => array( 'Weblink-Suche' ), |
160 | 160 | 'DeletedContributions' => array( 'Gelöschte Beiträge' ), |
| 161 | + 'Nuke' => array( 'Massenlöschung' ), |
161 | 162 | ); |
162 | 163 | |
163 | 164 | $datePreferences = array( |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | * Special:LinkSearch to search for external links (was extension LinkSearch) |
60 | 60 | * RenderHash |
61 | 61 | * NoMoveUserPages |
| 62 | +* Special:Nuke to mass delete all pages created by a user |
62 | 63 | |
63 | 64 | === New features in 1.14 === |
64 | 65 | |
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -369,7 +369,6 @@ |
370 | 370 | 'ext-usernameblacklist', |
371 | 371 | 'ext-checkuser', // sysop or higher only |
372 | 372 | 'ext-globalblocking', |
373 | | - 'ext-nuke', |
374 | 373 | 'ext-oversight', |
375 | 374 | 'ext-renameuser', |
376 | 375 | 'ext-assertedit', // bots |
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt |
— | — | @@ -455,9 +455,6 @@ |
456 | 456 | |
457 | 457 | No Move Userpages |
458 | 458 | |
459 | | -Nuke |
460 | | -file = Nuke/SpecialNuke.i18n.php |
461 | | - |
462 | 459 | OAI-PMH repository |
463 | 460 | id = ext-oai |
464 | 461 | file = OAI/OAIRepo.i18n.php |
Index: trunk/extensions/Translate/aliases.txt |
— | — | @@ -151,9 +151,6 @@ |
152 | 152 | News channel |
153 | 153 | file = NewsChannel/NewsChannel.alias.php |
154 | 154 | |
155 | | -Nuke |
156 | | -file = Nuke/SpecialNuke.alias.php |
157 | | - |
158 | 155 | Oversight |
159 | 156 | file = Oversight/HideRevision.alias.php |
160 | 157 | |