r95910 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95909‎ | r95910 | r95911 >
Date:21:44, 31 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
require tokens
Modified paths:
  • /trunk/extensions/Survey/api/ApiAddSurvey.php (modified) (history)
  • /trunk/extensions/Survey/api/ApiDeleteSurvey.php (modified) (history)
  • /trunk/extensions/Survey/api/ApiEditSurvey.php (modified) (history)
  • /trunk/extensions/Survey/api/ApiQuerySurveys.php (modified) (history)
  • /trunk/extensions/Survey/api/ApiSubmitSurvey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/api/ApiDeleteSurvey.php
@@ -41,6 +41,14 @@
4242 );
4343 }
4444
 45+ public function needsToken() {
 46+ return true;
 47+ }
 48+
 49+ public function getTokenSalt() {
 50+ return '';
 51+ }
 52+
4553 public function getAllowedParams() {
4654 return array(
4755 'ids' => array(
@@ -48,12 +56,14 @@
4957 ApiBase::PARAM_REQUIRED => true,
5058 ApiBase::PARAM_ISMULTI => true,
5159 ),
 60+ 'token' => null,
5261 );
5362 }
5463
5564 public function getParamDescription() {
5665 return array(
57 - 'ids' => 'The IDs of the surveys to delete'
 66+ 'ids' => 'The IDs of the surveys to delete',
 67+ 'token' => 'Edit token. You can get one of these through prop=info.',
5868 );
5969 }
6070
Index: trunk/extensions/Survey/api/ApiSubmitSurvey.php
@@ -44,6 +44,14 @@
4545 $submission = new SurveySubmission();
4646 }
4747
 48+ public function needsToken() {
 49+ return true;
 50+ }
 51+
 52+ public function getTokenSalt() {
 53+ return '';
 54+ }
 55+
4856 public function getAllowedParams() {
4957 return array(
5058 'id' => array(
@@ -52,11 +60,15 @@
5361 'name' => array(
5462 ApiBase::PARAM_TYPE => 'string',
5563 ),
 64+ 'token' => null,
5665 );
5766 }
5867
5968 public function getParamDescription() {
6069 return array(
 70+ 'id' => 'The ID of the survey being submitted.',
 71+ 'name' => 'The name of the survey being submitted.',
 72+ 'token' => 'Edit token. You can get one of these through prop=info.',
6173 );
6274 }
6375
Index: trunk/extensions/Survey/api/ApiEditSurvey.php
@@ -60,6 +60,14 @@
6161 $survey->getName()
6262 );
6363 }
 64+
 65+ public function needsToken() {
 66+ return true;
 67+ }
 68+
 69+ public function getTokenSalt() {
 70+ return '';
 71+ }
6472
6573 public function getAllowedParams() {
6674 return array(
@@ -80,6 +88,7 @@
8189 ApiBase::PARAM_ISMULTI => true,
8290 ApiBase::PARAM_REQUIRED => true,
8391 ),
 92+ 'token' => null,
8493 );
8594 }
8695
@@ -89,6 +98,7 @@
9099 'name' => 'The name of the survey',
91100 'enabled' => 'Enable the survey or not',
92101 'questions' => 'The questions that make up the survey',
 102+ 'token' => 'Edit token. You can get one of these through prop=info.',
93103 );
94104 }
95105
Index: trunk/extensions/Survey/api/ApiAddSurvey.php
@@ -68,6 +68,14 @@
6969 $survey->getName()
7070 );
7171 }
 72+
 73+ public function needsToken() {
 74+ return true;
 75+ }
 76+
 77+ public function getTokenSalt() {
 78+ return '';
 79+ }
7280
7381 public function getAllowedParams() {
7482 return array(
@@ -84,6 +92,7 @@
8593 ApiBase::PARAM_ISMULTI => true,
8694 ApiBase::PARAM_DFLT => '',
8795 ),
 96+ 'token' => null,
8897 );
8998 }
9099
@@ -92,6 +101,7 @@
93102 'name' => 'The name of the survey',
94103 'enabled' => 'Enable the survey or not',
95104 'questions' => 'The questions that make up the survey',
 105+ 'token' => 'Edit token. You can get one of these through prop=info.',
96106 );
97107 }
98108
@@ -116,6 +126,6 @@
117127
118128 public function getVersion() {
119129 return __CLASS__ . ': $Id$';
120 - }
 130+ }
121131
122132 }
Index: trunk/extensions/Survey/api/ApiQuerySurveys.php
@@ -104,6 +104,7 @@
105105 ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
106106 ),
107107 'continue' => null,
 108+ 'token' => null,
108109 );
109110
110111 }
@@ -119,6 +120,7 @@
120121 'incquestions' => 'Include the questions of the surveys or not',
121122 'continue' => 'Offset number from where to continue the query',
122123 'limit' => 'Max amount of words to return',
 124+ 'token' => 'Edit token. You can get one of these through prop=info.',
123125 );
124126 }
125127

Status & tagging log