r46088 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46087‎ | r46088 | r46089 >
Date:19:05, 23 January 2009
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
(bug 17118) Open up OldReviewedPages to public (except for watchlist stuff)
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php
@@ -7,7 +7,7 @@
88 class OldReviewedPages extends SpecialPage
99 {
1010 function __construct() {
11 - parent::__construct( 'OldReviewedPages', 'unreviewedpages' );
 11+ parent::__construct( 'OldReviewedPages' );
1212 // $this->includable( true );
1313 wfLoadExtensionMessages( 'OldReviewedPages' );
1414 wfLoadExtensionMessages( 'FlaggedRevs' );
@@ -16,10 +16,6 @@
1717 function execute( $par ) {
1818 global $wgRequest, $wgUser, $wgOut;
1919 $this->setHeaders();
20 - if( !$wgUser->isAllowed( 'unreviewedpages' ) ) {
21 - $wgOut->permissionRequired( 'unreviewedpages' );
22 - return;
23 - }
2420 $this->skin = $wgUser->getSkin();
2521 $this->namespace = $wgRequest->getIntOrNull( 'namespace' );
2622 $this->category = trim( $wgRequest->getVal( 'category' ) );
@@ -44,7 +40,7 @@
4541 }
4642
4743 function showList( $par ) {
48 - global $wgOut, $wgScript, $wgTitle, $wgFlaggedRevsNamespaces;
 44+ global $wgOut, $wgScript, $wgUser, $wgFlaggedRevsNamespaces;
4945 $limit = $this->parseParams( $par );
5046 $pager = new OldReviewedPagesPager( $this, $this->namespace, $this->category,
5147 $this->size, $this->watched );
@@ -55,7 +51,7 @@
5652 $wgOut->addHTML(
5753 "<form action=\"$action\" method=\"get\">\n" .
5854 '<fieldset><legend>' . wfMsg('oldreviewedpages-legend') . '</legend>' .
59 - Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() )
 55+ Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() )
6056 );
6157 # Display dropdown as needed
6258 if( count($wgFlaggedRevsNamespaces) > 1 ) {
@@ -66,8 +62,11 @@
6763 Xml::input( 'category', 35, $this->category, array('id' => 'wpCategory') ) . '<br/>' .
6864 Xml::label( wfMsg('oldreviewed-size'), 'wpSize' ) . '&nbsp;' .
6965 Xml::input( 'size', 5, $this->size, array( 'id' => 'wpSize' ) ) . '&nbsp;' .
70 - Xml::label( wfMsg('oldreviewed-watched'), 'wpWatched' ) . '&nbsp;' .
71 - Xml::check( 'watched', $this->watched, array( 'id' => 'wpWatched' ) ) .
 66+ ( $wgUser->getId() ?
 67+ Xml::label( wfMsg('oldreviewed-watched'), 'wpWatched' ) . '&nbsp;' .
 68+ Xml::check( 'watched', $this->watched, array( 'id' => 'wpWatched' ) )
 69+ : ""
 70+ ) .
7271 '&nbsp;&nbsp;' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
7372 "</fieldset></form>"
7473 );
@@ -173,17 +172,25 @@
174173 }
175174
176175 public function formatRow( $result ) {
177 - global $wgLang;
 176+ global $wgLang, $wgUser;
178177
179178 $title = Title::makeTitle( $result->page_namespace, $result->page_title );
180179 $link = $this->skin->makeKnownLinkObj( $title );
181180 $css = $stxt = $review = '';
182181 $stxt = ChangesList::showCharacterDifference( $result->rev_len, $result->page_len );
183182 $review = $this->skin->makeKnownLinkObj( $title, wfMsg('oldreviewed-diff'),
184 - "diff=cur&oldid={$result->fp_stable}&diffonly=0" );
 183+ "diff=cur&oldid={$result->fp_stable}&diffonly=0" );
185184 $quality = $result->fp_quality ? wfMsgHtml('oldreviewedpages-quality') : wfMsgHtml('oldreviewedpages-stable');
186185 # Is anybody watching?
187 - $uw = UnreviewedPages::usersWatching( $title );
 186+ if( $wgUser->isAllowed( 'unreviewedpages' ) ) {
 187+ $uw = UnreviewedPages::usersWatching( $title );
 188+ $watching = $uw ?
 189+ wfMsgExt('oldreviewedpages-watched','parsemag',$uw,$uw) : wfMsgHtml('oldreviewedpages-unwatched');
 190+ $watching = ' '.$watching;
 191+ } else {
 192+ $uw = -1;
 193+ $watching = ''; // leave out data
 194+ }
188195 # Get how long the first unreviewed edit has been waiting...
189196 if( $result->fp_pending_since ) {
190197 static $currentTime;
@@ -207,10 +214,8 @@
208215 } else {
209216 $age = ""; // wtf?
210217 }
211 - $watching = $uw ?
212 - wfMsgExt("oldreviewedpages-watched",array('parsemag'),$uw,$uw) : wfMsgHtml("oldreviewedpages-unwatched");
213218
214 - return( "<li{$css}>{$link} {$stxt} ({$review}) <i>{$age}</i> <strong>[{$quality}]</strong> {$watching}</li>" );
 219+ return( "<li{$css}>{$link} {$stxt} ({$review}) <i>{$age}</i> <strong>[{$quality}]</strong>{$watching}</li>" );
215220 }
216221
217222 /**
@@ -232,7 +237,7 @@
233238 }
234239
235240 protected static function getLineClass( $hours, $uw ) {
236 - if( !$uw )
 241+ if( $uw == 0 )
237242 return 'fr-unreviewed-unwatched';
238243 else
239244 return "";

Comments

#Comment by Catrope (talk | contribs)   20:37, 13 August 2009

Per bug 17118 comment #3 this doesn't update the permissions checks in the oldreviewedpages API module

#Comment by 😂 (talk | contribs)   10:43, 15 August 2009

Resolved in r54972?

#Comment by Catrope (talk | contribs)   10:47, 15 August 2009

Yes

Status & tagging log