https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114386

Revision: 114386
Author:   emsmith
Date:     2012-03-21 18:16:54 +0000 (Wed, 21 Mar 2012)
Log Message:
-----------
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: 
trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php
===================================================================
--- trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php 
2012-03-21 18:02:21 UTC (rev 114385)
+++ trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php 
2012-03-21 18:16:54 UTC (rev 114386)
@@ -242,12 +242,30 @@
         * @return array db record rows
         */
        protected function fetchActivity( $title, $feedbackId, $limit = 25, 
$continue = null ) {
+               global $wgUser; // we need to check permissions in here for 
suppressionlog stuff
 
-               $where = array (
+
+               // get afv5 log items PLUS suppress log
+               if ( $wgUser->isAllowed( 'aftv5-delete-feedback' ) ) {
+                       $where = array (
+                               0 => "FOO (log_type = 'articlefeedbackv5')
+                                       OR (log_type = 'suppress' AND
+                                       (log_action = 'oversight' OR
+                                        log_action = 'unoversight' OR
+                                        log_action = 'decline' OR
+                                        log_action = 'request' OR
+                                        log_action = 'unrequest'))",
+                               'log_namespace' => NS_SPECIAL,
+                               'log_title' => 
"ArticleFeedbackv5/$title/$feedbackId"
+                       );
+               // get only afv5 log items
+               } else {
+                       $where = array (
                                'log_type' => 'articlefeedbackv5',
                                'log_namespace' => NS_SPECIAL,
                                'log_title' => 
"ArticleFeedbackv5/$title/$feedbackId"
                        );
+               }
 
                $where = $this->applyContinue( $continue, $where );
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to