http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95910

Revision: 95910
Author:   jeroendedauw
Date:     2011-08-31 21:44:04 +0000 (Wed, 31 Aug 2011)
Log Message:
-----------
require tokens

Modified Paths:
--------------
    trunk/extensions/Survey/api/ApiAddSurvey.php
    trunk/extensions/Survey/api/ApiDeleteSurvey.php
    trunk/extensions/Survey/api/ApiEditSurvey.php
    trunk/extensions/Survey/api/ApiQuerySurveys.php
    trunk/extensions/Survey/api/ApiSubmitSurvey.php

Modified: trunk/extensions/Survey/api/ApiAddSurvey.php
===================================================================
--- trunk/extensions/Survey/api/ApiAddSurvey.php        2011-08-31 21:02:22 UTC 
(rev 95909)
+++ trunk/extensions/Survey/api/ApiAddSurvey.php        2011-08-31 21:44:04 UTC 
(rev 95910)
@@ -68,6 +68,14 @@
                        $survey->getName()
                );
        }
+       
+       public function needsToken() {
+               return true;
+       }
+       
+       public function getTokenSalt() {
+               return '';
+       }
 
        public function getAllowedParams() {
                return array(
@@ -84,6 +92,7 @@
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_DFLT => '',
                        ),
+                       'token' => null,
                );
        }
        
@@ -92,6 +101,7 @@
                        'name' => 'The name of the survey',
                        'enabled' => 'Enable the survey or not',
                        'questions' => 'The questions that make up the survey',
+                       'token' => 'Edit token. You can get one of these 
through prop=info.',
                );
        }
        
@@ -116,6 +126,6 @@
        
        public function getVersion() {
                return __CLASS__ . ': $Id$';
-       }               
+       }       
        
 }

Modified: trunk/extensions/Survey/api/ApiDeleteSurvey.php
===================================================================
--- trunk/extensions/Survey/api/ApiDeleteSurvey.php     2011-08-31 21:02:22 UTC 
(rev 95909)
+++ trunk/extensions/Survey/api/ApiDeleteSurvey.php     2011-08-31 21:44:04 UTC 
(rev 95910)
@@ -41,6 +41,14 @@
                );
        }
        
+       public function needsToken() {
+               return true;
+       }
+       
+       public function getTokenSalt() {
+               return '';
+       }
+       
        public function getAllowedParams() {
                return array(
                        'ids' => array(
@@ -48,12 +56,14 @@
                                ApiBase::PARAM_REQUIRED => true,
                                ApiBase::PARAM_ISMULTI => true,
                        ),
+                       'token' => null,
                );
        }
        
        public function getParamDescription() {
                return array(
-                       'ids' => 'The IDs of the surveys to delete'
+                       'ids' => 'The IDs of the surveys to delete',
+                       'token' => 'Edit token. You can get one of these 
through prop=info.',
                );
        }
        

Modified: trunk/extensions/Survey/api/ApiEditSurvey.php
===================================================================
--- trunk/extensions/Survey/api/ApiEditSurvey.php       2011-08-31 21:02:22 UTC 
(rev 95909)
+++ trunk/extensions/Survey/api/ApiEditSurvey.php       2011-08-31 21:44:04 UTC 
(rev 95910)
@@ -60,6 +60,14 @@
                        $survey->getName()
                );
        }
+       
+       public function needsToken() {
+               return true;
+       }
+       
+       public function getTokenSalt() {
+               return '';
+       }
 
        public function getAllowedParams() {
                return array(
@@ -80,6 +88,7 @@
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_REQUIRED => true,
                        ),
+                       'token' => null,
                );
        }
        
@@ -89,6 +98,7 @@
                        'name' => 'The name of the survey',
                        'enabled' => 'Enable the survey or not',
                        'questions' => 'The questions that make up the survey',
+                       'token' => 'Edit token. You can get one of these 
through prop=info.',
                );
        }
        

Modified: trunk/extensions/Survey/api/ApiQuerySurveys.php
===================================================================
--- trunk/extensions/Survey/api/ApiQuerySurveys.php     2011-08-31 21:02:22 UTC 
(rev 95909)
+++ trunk/extensions/Survey/api/ApiQuerySurveys.php     2011-08-31 21:44:04 UTC 
(rev 95910)
@@ -104,6 +104,7 @@
                                ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
                        ),
                        'continue' => null,
+                       'token' => null,
                );
                
        }
@@ -119,6 +120,7 @@
                        'incquestions' => 'Include the questions of the surveys 
or not',
                        'continue' => 'Offset number from where to continue the 
query',
                        'limit'   => 'Max amount of words to return',
+                       'token' => 'Edit token. You can get one of these 
through prop=info.',
                );
        }
 

Modified: trunk/extensions/Survey/api/ApiSubmitSurvey.php
===================================================================
--- trunk/extensions/Survey/api/ApiSubmitSurvey.php     2011-08-31 21:02:22 UTC 
(rev 95909)
+++ trunk/extensions/Survey/api/ApiSubmitSurvey.php     2011-08-31 21:44:04 UTC 
(rev 95910)
@@ -44,6 +44,14 @@
                $submission = new SurveySubmission();
        }
 
+       public function needsToken() {
+               return true;
+       }
+       
+       public function getTokenSalt() {
+               return '';
+       }
+       
        public function getAllowedParams() {
                return array(
                        'id' => array(
@@ -52,11 +60,15 @@
                        'name' => array(
                                ApiBase::PARAM_TYPE => 'string',
                        ),
+                       'token' => null,
                );
        }
        
        public function getParamDescription() {
                return array(
+                       'id' => 'The ID of the survey being submitted.',
+                       'name' => 'The name of the survey being submitted.',
+                       'token' => 'Edit token. You can get one of these 
through prop=info.',
                );
        }
        


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

Reply via email to