X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiBlock.php;h=f03cef2c67e68dd8885ab9654415ccdc88fc7448;hb=093bb2e23e7a984eee9c32be79058c6e6974a740;hp=07f62c668c308f497fc404f08f4a262698e90852;hpb=efb41a22049a05c9beb25df66edc5ec7087ee0ad;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index 07f62c668c..f03cef2c67 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -78,7 +78,7 @@ class ApiBlock extends ApiBase { 'other', $params['reason'] ), - 'Expiry' => $params['expiry'] == 'never' ? 'infinite' : $params['expiry'], + 'Expiry' => $params['expiry'], 'HardBlock' => !$params['anononly'], 'CreateAccount' => $params['nocreate'], 'AutoBlock' => $params['autoblock'], @@ -165,38 +165,16 @@ class ApiBlock extends ApiBase { ); } - public function getParamDescription() { - return array( - 'user' => 'Username, IP address or IP range you want to block', - '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', - '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', - 'noemail' - => 'Prevent user from sending email through the wiki. (Requires the "blockemail" right.)', - 'hidename' => 'Hide the username from the block log. (Requires the "hideuser" right.)', - 'allowusertalk' - => 'Allow the user to edit their own talk page (depends on $wgBlockAllowsUTEdit)', - 'reblock' => 'If the user is already blocked, overwrite the existing block', - 'watchuser' => 'Watch the user/IP\'s user and talk pages', - ); - } - - public function getDescription() { - return 'Block a user.'; - } - public function needsToken() { return 'csrf'; } - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=block&user=123.5.5.12&expiry=3%20days&reason=First%20strike&token=123ABC', - 'api.php?action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC' + 'action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC' + => 'apihelp-block-example-ip-simple', + 'action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC' + => 'apihelp-block-example-user-complex', ); }