r97129 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97128‎ | r97129 | r97130 >
Date:00:31, 15 September 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
prevent users from being able to get a disabled survey
Modified paths:
  • /trunk/extensions/Survey/api/ApiQuerySurveys.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/api/ApiQuerySurveys.php
@@ -56,7 +56,10 @@
5757 $this->addWhere( array( 'survey_name' => $params['names'] ) );
5858 }
5959
60 - if ( isset( $params['enabled'] ) ) {
 60+ if ( !$GLOBALS['wgUser']->isAllowed( 'surveyadmin' ) ) {
 61+ $this->addWhere( array( 'survey_enabled' => 1 ) );
 62+ }
 63+ else if ( isset( $params['enabled'] ) ) {
6164 $this->addWhere( array( 'survey_enabled' => $params['enabled'] ) );
6265 }
6366

Status & tagging log