Merge "multi dbms support in api"
[lhc/web/wiklou.git] / includes / api / ApiBlock.php
index d7f121f..e229ef0 100644 (file)
@@ -103,9 +103,11 @@ class ApiBlock extends ApiBase {
                        $res['expiry'] = $block->mExpiry == $this->getDB()->getInfinity()
                                ? 'infinite'
                                : wfTimestamp( TS_ISO_8601, $block->mExpiry );
+                       $res['id'] = $block->getId();
                } else {
                        # should be unreachable
                        $res['expiry'] = '';
+                       $res['id'] = '';
                }
 
                $res['reason'] = $params['reason'];
@@ -149,7 +151,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 +171,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)',