49 if ( !
$user->isAllowed(
'block' ) ) {
52 # bug 15810: blocked admins should have limited access here
53 if (
$user->isBlocked() ) {
67 if ( !is_null(
$params[
'tags'] ) ) {
69 if ( !$ableToTag->isOK() ) {
75 'Target' => is_null(
$params[
'id'] ) ?
$params[
'user'] :
"#{$params['id']}",
85 $res[
'id'] = $block->getId();
87 $res[
'user'] = $target instanceof
User ? $target->getName() : $target;
88 $res[
'userid'] = $target instanceof
User ? $target->getId() : 0;
121 'action=unblock&id=105'
122 =>
'apihelp-unblock-example-id',
123 'action=unblock&user=Bob&reason=Sorry%20Bob'
124 =>
'apihelp-unblock-example-user',
129 return 'https://www.mediawiki.org/wiki/API:Block';
static checkUnblockSelf($user, User $performer)
bug 15810: blocked admins should not be able to block/unblock others, and probably shouldn't be able ...
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
getResult()
Get the result object.
API module that facilitates the unblocking of users.
execute()
Unblocks the specified user or provides the reason the unblock failed.
extractRequestParams($parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user...
static getBlockInfo(Block $block)
Get basic info about a given block.
static newFromTarget($specificTarget, $vagueTarget=null, $fromMaster=false)
Given a target and the target's type, get an existing Block object if possible.
getContext()
Get the base IContextSource object.
getModuleName()
Get the name of the module being executed by this instance.
static processUnblock(array $data, IContextSource $context)
Process the form.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
dieUsage($description, $errorCode, $httpRespCode=0, $extradata=null)
Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an...
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
This abstract class implements many basic API functions, and is the base of all API classes...
parseMsg($error)
Return the error message related to a certain array.
dieStatus($status)
Throw a UsageException based on the errors in the Status object.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account incomplete not yet checked for validity & $retval
getUser()
Get the User object.
dieUsageMsg($error)
Output the error message related to a certain array.