X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiBlock.php;h=c879b35d8bec143453108272b0d35bdd38e947df;hb=6236aebcf08ded84d039605f3d1e4296cc7be74f;hp=e229ef01c3d56b9b90288c152490603d9d7b2ffd;hpb=b47a2148c68b7bc58b12ec77fa3fe159f834e4e7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index e229ef01c3..c879b35d8b 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -4,7 +4,7 @@ * * Created on Sep 4, 2007 * - * Copyright © 2007 Roan Kattouw .@gmail.com + * Copyright © 2007 Roan Kattouw ".@gmail.com" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,9 +72,9 @@ class ApiBlock extends ApiBase { $data = array( 'Target' => $params['user'], 'Reason' => array( - is_null( $params['reason'] ) ? '' : $params['reason'], + $params['reason'], 'other', - is_null( $params['reason'] ) ? '' : $params['reason'] + $params['reason'] ), 'Expiry' => $params['expiry'] == 'never' ? 'infinite' : $params['expiry'], 'HardBlock' => !$params['anononly'], @@ -156,7 +156,7 @@ class ApiBlock extends ApiBase { ApiBase::PARAM_DEPRECATED => true, ), 'expiry' => 'never', - 'reason' => null, + 'reason' => '', 'anononly' => false, 'nocreate' => false, 'autoblock' => false, @@ -174,7 +174,7 @@ class ApiBlock extends ApiBase { '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)', + 'reason' => 'Reason for block', 'anononly' => 'Block anonymous users only (i.e. disable anonymous edits for this IP)', 'nocreate' => 'Prevent account creation', 'autoblock' => 'Automatically block the last used IP address, and any subsequent IP addresses they try to login from', @@ -186,6 +186,44 @@ class ApiBlock extends ApiBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'blocktoken' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'user' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'userID' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true + ), + 'expiry' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'id' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true + ), + 'reason' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'anononly' => 'boolean', + 'nocreate' => 'boolean', + 'autoblock' => 'boolean', + 'noemail' => 'boolean', + 'hidename' => 'boolean', + 'allowusertalk' => 'boolean', + 'watchuser' => 'boolean' + ) + ); + } + public function getDescription() { return 'Block a user'; }