r26151 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26150‎ | r26151 | r26152 >
Date:12:10, 26 September 2007
Author:aaron
Status:old
Tags:
Comment:
*Don't show submit if the user can't
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php
@@ -848,6 +848,7 @@
849849
850850 $confirm = $wgRequest->wasPosted() &&
851851 $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
 852+
852853 $this->isAllowed = $wgUser->isAllowed( 'stablesettings' );
853854 # Let anyone view, but not submit...
854855 if( $wgRequest->wasPosted() ) {
@@ -953,13 +954,14 @@
954955 $form .= "<td>".Xml::radio( 'override', 0, (0==$encoverride), array('id' => 'default2') + $off)."</td>";
955956 $form .= "<td>".Xml::label( wfMsg('stabilization-def2'), 'default2' )."</td>";
956957 $form .= "</tr></table></fieldset>";
 958+ if( $this->isAllowed ) {
 959+ $form .= Xml::hidden('title', $wgTitle->getPrefixedText() );
 960+ $form .= Xml::hidden('page', $this->page->getPrefixedText() );
 961+ $form .= wfHidden( 'wpEditToken', $wgUser->editToken() );
957962
958 - $form .= Xml::hidden('title', $wgTitle->getPrefixedText() );
959 - $form .= Xml::hidden('page', $this->page->getPrefixedText() );
960 - $form .= wfHidden( 'wpEditToken', $wgUser->editToken() );
961 -
962 - $form .= '<p>'.wfInputLabel( wfMsgHtml( 'revreview-log' ), 'wpReason', 'wpReason', 60 ).'</p>';
963 - $form .= wfSubmitButton( wfMsgHtml( 'stabilization-submit' ) );
 963+ $form .= '<p>'.wfInputLabel( wfMsgHtml( 'revreview-log' ), 'wpReason', 'wpReason', 60 ).'</p>';
 964+ $form .= wfSubmitButton( wfMsgHtml( 'stabilization-submit' ) );
 965+ }
964966 $form .= '</form>';
965967
966968 $wgOut->addHTML( $form );

Status & tagging log