From: Szymon ƚwierkosz Date: Sun, 6 May 2012 14:43:09 +0000 (+0200) Subject: (bug 35993) gettoken should go die in a fire (part 1) X-Git-Tag: 1.31.0-rc.0~23683^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=aa86d2d3e632a57d58590b51516128b7b999228a;p=lhc%2Fweb%2Fwiklou.git (bug 35993) gettoken should go die in a fire (part 1) 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 --- diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index 7d3a40bb5f..c566a5cbaf 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -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)', diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index e599e3286e..32e0d88e82 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -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)', );