(bug 35993) gettoken should go die in a fire (part 1)
authorSzymon Świerkosz <beau@adres.pl>
Sun, 6 May 2012 14:43:09 +0000 (16:43 +0200)
committerSzymon Świerkosz <beau@adres.pl>
Sun, 6 May 2012 14:43:09 +0000 (16:43 +0200)
Mark gettoken param as deprecated, so users can fix their tools.
The second part will remove the support for gettoken from ApiMain,
but that is in the future.

Change-Id: I369ddc740c38d80aa8389544087ac6671cabc618

includes/api/ApiBlock.php
includes/api/ApiUnblock.php

index 7d3a40b..c566a5c 100644 (file)
@@ -149,7 +149,10 @@ class ApiBlock extends ApiBase {
                                ApiBase::PARAM_REQUIRED => true
                        ),
                        'token' => null,
-                       'gettoken' => false,
+                       'gettoken' => array(
+                               ApiBase::PARAM_DFLT => false,
+                               ApiBase::PARAM_DEPRECATED => true,
+                       ),
                        'expiry' => 'never',
                        'reason' => null,
                        'anononly' => false,
@@ -166,7 +169,7 @@ class ApiBlock extends ApiBase {
        public function getParamDescription() {
                return array(
                        'user' => 'Username, IP address or IP range you want to block',
-                       'token' => 'A block token previously obtained through the gettoken parameter or prop=info',
+                       'token' => 'A block token previously obtained through prop=info',
                        'gettoken' => 'If set, a block token will be returned, and no other action will be taken',
                        'expiry' => 'Relative expiry time, e.g. \'5 months\' or \'2 weeks\'. If set to \'infinite\', \'indefinite\' or \'never\', the block will never expire.',
                        'reason' => 'Reason for block (optional)',
index e599e32..32e0d88 100644 (file)
@@ -98,7 +98,10 @@ class ApiUnblock extends ApiBase {
                        ),
                        'user' => null,
                        'token' => null,
-                       'gettoken' => false,
+                       'gettoken' => array(
+                               ApiBase::PARAM_DFLT => false,
+                               ApiBase::PARAM_DEPRECATED => true,
+                       ),
                        'reason' => null,
                );
        }
@@ -108,7 +111,7 @@ class ApiUnblock extends ApiBase {
                return array(
                        'id' => "ID of the block you want to unblock (obtained through list=blocks). Cannot be used together with {$p}user",
                        'user' => "Username, IP address or IP range you want to unblock. Cannot be used together with {$p}id",
-                       'token' => "An unblock token previously obtained through the gettoken parameter or {$p}prop=info",
+                       'token' => "An unblock token previously obtained through prop=info",
                        'gettoken' => 'If set, an unblock token will be returned, and no other action will be taken',
                        'reason' => 'Reason for unblock (optional)',
                );