r49732 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49731‎ | r49732 | r49733 >
Date:09:21, 22 April 2009
Author:catrope
Status:ok
Tags:
Comment:
API: (bug 18554) Also list hidden revisions in list=usercontribs for privileged users
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -141,6 +141,7 @@
142142 // We're after the revision table, and the corresponding page
143143 // row for anything we retrieve. We may also need the
144144 // recentchanges row.
 145+ global $wgUser;
145146 $tables = array('page', 'revision'); // Order may change
146147 $this->addWhere('page_id=rev_page');
147148
@@ -159,7 +160,8 @@
160161 "rev_timestamp $op= '$encTS')");
161162 }
162163
163 - $this->addWhereFld('rev_deleted', 0);
 164+ if(!$wgUser->isAllowed('hideuser'))
 165+ $this->addWhereFld('rev_deleted & ' . Revision::DELETED_USER . ' = 0');
164166 // We only want pages by the specified users.
165167 if($this->prefixMode)
166168 $this->addWhere("rev_user_text LIKE '" . $this->getDB()->escapeLike($this->userprefix) . "%'");
@@ -197,6 +199,7 @@
198200 'page_namespace',
199201 'page_title',
200202 'rev_user_text',
 203+ 'rev_deleted'
201204 ));
202205
203206 if(isset($show['patrolled']) || isset($show['!patrolled']) ||
@@ -250,6 +253,8 @@
251254 $vals = array();
252255
253256 $vals['user'] = $row->rev_user_text;
 257+ if ($row->rev_deleted & Revision::DELETED_USER)
 258+ $vals['userhidden'] = '';
254259 if ($this->fld_ids) {
255260 $vals['pageid'] = intval($row->rev_page);
256261 $vals['revid'] = intval($row->rev_id);
@@ -272,8 +277,12 @@
273278 $vals['top'] = '';
274279 }
275280
276 - if ($this->fld_comment && isset($row->rev_comment))
277 - $vals['comment'] = $row->rev_comment;
 281+ if ($this->fld_comment && isset($row->rev_comment)) {
 282+ if ($row->rev_deleted & Revision::DELETED_COMMENT)
 283+ $vals['commenthidden'] = '';
 284+ else
 285+ $vals['comment'] = $row->rev_comment;
 286+ }
278287
279288 if ($this->fld_patrolled && $row->rc_patrolled)
280289 $vals['patrolled'] = '';
Index: trunk/phase3/RELEASE-NOTES
@@ -415,6 +415,8 @@
416416 * (bug 17832) action=delete returns 'unknownerror' instead of 'permissiondenied'
417417 when the user is blocked
418418 * (bug 18546) Added timestamp of new revision to action=edit output
 419+* (bug 18554) Also list hidden revisions in list=usercontribs for privileged
 420+ users
419421
420422 === Languages updated in 1.15 ===
421423

Follow-up revisions

RevisionCommit summaryAuthorDate
r50423API: (bug 18743) Add ucprop=size (enabled by default) to list=usercontribs. A...catrope09:25, 10 May 2009

Status & tagging log