r70722 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70721‎ | r70722 | r70723 >
Date:19:01, 8 August 2010
Author:maxsem
Status:ok
Tags:
Comment:
Follow-up r70719 and r70721: on the second thought, this permission reflects my previous design, where gadget export page was much more computation-heave. It's not needed.
Modified paths:
  • /trunk/extensions/Gadgets/Gadgets.i18n.php (modified) (history)
  • /trunk/extensions/Gadgets/Gadgets.php (modified) (history)
  • /trunk/extensions/Gadgets/SpecialGadgets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Gadgets/Gadgets.i18n.php
@@ -41,7 +41,6 @@
4242 <pre>$2</pre>
4343 You must have appropriate permissions on destination wiki (including the right to edit system messages) and import from file uploads must be enabled.',
4444 'gadgets-export-download' => 'Download',
45 - 'right-exportgadgets' => 'Export gadgets',
4645 );
4746
4847 /** Message documentation (Message documentation)
Index: trunk/extensions/Gadgets/Gadgets.php
@@ -36,9 +36,6 @@
3737 $wgSpecialPages['Gadgets'] = 'SpecialGadgets';
3838 $wgSpecialPageGroups['Gadgets'] = 'wiki';
3939
40 -// to restrict bots and spiders from pegging the server, disable this right for anons
41 -$wgGroupPermissions['*']['exportgadgets'] = true;
42 -
4340 function wfGadgetsArticleSaveComplete( $article, $user, $text ) {
4441 //update cache if MediaWiki:Gadgets-definition was edited
4542 $title = $article->mTitle;
Index: trunk/extensions/Gadgets/SpecialGadgets.php
@@ -65,7 +65,6 @@
6666
6767 $msgOpt = array( 'parseinline', 'parsemag' );
6868 $editInterfaceAllowed = $wgUser->isAllowed( 'editinterface' );
69 - $exportAllowed = $wgUser->isAllowed( 'exportgadgets' );
7069
7170 foreach ( $gadgets as $section => $entries ) {
7271 if ( $section !== false && $section !== '' ) {
@@ -95,11 +94,9 @@
9695 if ( $editInterfaceAllowed ) {
9796 $links[] = $skin->link( $t, wfMsgHTML( 'edit' ), array(), array( 'action' => 'edit' ) );
9897 }
99 - if ( $exportAllowed ) {
100 - $links[] = $skin->link( $this->getTitle(), wfMsgHtml( 'gadgets-export' ),
101 - array(), array( 'export' => $gname )
102 - );
103 - }
 98+ $links[] = $skin->link( $this->getTitle(), wfMsgHtml( 'gadgets-export' ),
 99+ array(), array( 'export' => $gname )
 100+ );
104101
105102 $ttext = wfMsgExt( "gadget-$gname", $msgOpt );
106103
@@ -107,11 +104,7 @@
108105 $listOpen = true;
109106 $wgOut->addHTML( Xml::openElement( 'ul' ) );
110107 }
111 - if ( !empty( $links ) ) {
112 - $lnk = '&#160;&#160;' . wfMsg( 'parentheses', $wgLang->pipeList( $links ) );
113 - } else {
114 - $lnk = '';
115 - }
 108+ $lnk = '&#160;&#160;' . wfMsg( 'parentheses', $wgLang->pipeList( $links ) );
116109 $wgOut->addHTML( Xml::openElement( 'li' ) .
117110 $ttext . $lnk . "<br />" .
118111 wfMsgHTML( 'gadgets-uses' ) . wfMsg( 'colon-separator' )
@@ -141,11 +134,6 @@
142135 public function showExportForm( $gadget ) {
143136 global $wgOut, $wgRequest, $wgUser, $wgScript;
144137
145 - if ( !$wgUser->isAllowed( 'exportgadgets' ) ) {
146 - $wgOut->permissionRequired( 'exportgadgets' );
147 - return;
148 - }
149 -
150138 $gadgets = wfLoadGadgets();
151139 if ( !isset( $gadgets[$gadget] ) ) {
152140 $wgOut->showErrorPage( 'error', 'gadgets-not-found', array( $gadget ) );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70719Gadgets: added export feature for easier reusemaxsem18:22, 8 August 2010
r70721Follow-up r70719: Add message for the new user rightraymond18:50, 8 August 2010

Status & tagging log