r114386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114385‎ | r114386 | r114387 >
Date:18:16, 21 March 2012
Author:emsmith
Status:ok (Comments)
Tags:
Comment:
bug 35254 - bugfix for bugfix - make sure if the user has oversight (aftv5 delete) permissions that the activity log picks up all oversight activity as well, will NOT show up for those without aftv5 delete (oversight) permissions
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php
@@ -242,12 +242,30 @@
243243 * @return array db record rows
244244 */
245245 protected function fetchActivity( $title, $feedbackId, $limit = 25, $continue = null ) {
 246+ global $wgUser; // we need to check permissions in here for suppressionlog stuff
246247
247 - $where = array (
 248+
 249+ // get afv5 log items PLUS suppress log
 250+ if ( $wgUser->isAllowed( 'aftv5-delete-feedback' ) ) {
 251+ $where = array (
 252+ 0 => "FOO (log_type = 'articlefeedbackv5')
 253+ OR (log_type = 'suppress' AND
 254+ (log_action = 'oversight' OR
 255+ log_action = 'unoversight' OR
 256+ log_action = 'decline' OR
 257+ log_action = 'request' OR
 258+ log_action = 'unrequest'))",
 259+ 'log_namespace' => NS_SPECIAL,
 260+ 'log_title' => "ArticleFeedbackv5/$title/$feedbackId"
 261+ );
 262+ // get only afv5 log items
 263+ } else {
 264+ $where = array (
248265 'log_type' => 'articlefeedbackv5',
249266 'log_namespace' => NS_SPECIAL,
250267 'log_title' => "ArticleFeedbackv5/$title/$feedbackId"
251268 );
 269+ }
252270
253271 $where = $this->applyContinue( $continue, $where );
254272

Follow-up revisions

RevisionCommit summaryAuthorDate
r114387bug 35254 - typoemsmith18:18, 21 March 2012
r1143881.19wmf1: Update ArticleFeedbackv5 to trunk state to pick up r114386 and r114387catrope18:28, 21 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r114194bug 35254 - oversight items (request and unrequest oversight, decline oversig...emsmith21:42, 19 March 2012

Comments

#Comment by Catrope (talk | contribs)   18:27, 21 March 2012

You could do something like log_type='suppress' AND log_action IN ('foo', 'bar', 'baz') , that's cleaner, but this is fine too.

Status & tagging log