From: Roan Kattouw Date: Wed, 22 Apr 2009 09:21:33 +0000 (+0000) Subject: API: (bug 18554) Also list hidden revisions in list=usercontribs for privileged users X-Git-Tag: 1.31.0-rc.0~42076 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=6f5aa4c0789271e01ce6ce991a94ee41a7299517;p=lhc%2Fweb%2Fwiklou.git API: (bug 18554) Also list hidden revisions in list=usercontribs for privileged users --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8003f78c3b..da6881890d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -415,6 +415,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 17832) action=delete returns 'unknownerror' instead of 'permissiondenied' when the user is blocked * (bug 18546) Added timestamp of new revision to action=edit output +* (bug 18554) Also list hidden revisions in list=usercontribs for privileged + users === Languages updated in 1.15 === diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 62c8cc5592..701169b606 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -141,6 +141,7 @@ class ApiQueryContributions extends ApiQueryBase { // We're after the revision table, and the corresponding page // row for anything we retrieve. We may also need the // recentchanges row. + global $wgUser; $tables = array('page', 'revision'); // Order may change $this->addWhere('page_id=rev_page'); @@ -159,7 +160,8 @@ class ApiQueryContributions extends ApiQueryBase { "rev_timestamp $op= '$encTS')"); } - $this->addWhereFld('rev_deleted', 0); + if(!$wgUser->isAllowed('hideuser')) + $this->addWhereFld('rev_deleted & ' . Revision::DELETED_USER . ' = 0'); // We only want pages by the specified users. if($this->prefixMode) $this->addWhere("rev_user_text LIKE '" . $this->getDB()->escapeLike($this->userprefix) . "%'"); @@ -197,6 +199,7 @@ class ApiQueryContributions extends ApiQueryBase { 'page_namespace', 'page_title', 'rev_user_text', + 'rev_deleted' )); if(isset($show['patrolled']) || isset($show['!patrolled']) || @@ -250,6 +253,8 @@ class ApiQueryContributions extends ApiQueryBase { $vals = array(); $vals['user'] = $row->rev_user_text; + if ($row->rev_deleted & Revision::DELETED_USER) + $vals['userhidden'] = ''; if ($this->fld_ids) { $vals['pageid'] = intval($row->rev_page); $vals['revid'] = intval($row->rev_id); @@ -272,8 +277,12 @@ class ApiQueryContributions extends ApiQueryBase { $vals['top'] = ''; } - if ($this->fld_comment && isset($row->rev_comment)) - $vals['comment'] = $row->rev_comment; + if ($this->fld_comment && isset($row->rev_comment)) { + if ($row->rev_deleted & Revision::DELETED_COMMENT) + $vals['commenthidden'] = ''; + else + $vals['comment'] = $row->rev_comment; + } if ($this->fld_patrolled && $row->rc_patrolled) $vals['patrolled'] = '';