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();
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';
This abstract class implements many basic API functions, and is the base of all API classes.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
parseMsg( $error)
Return the error message related to a certain array.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
dieUsageMsg( $error)
Output the error message related to a certain array.
getResult()
Get the result object.
getModuleName()
Get the name of the module being executed by this instance.
dieStatus( $status)
Throw a UsageException based on the errors in the Status object.
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...
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
static getBlockInfo(Block $block)
Get basic info about a given block.
API module that facilitates the unblocking of users.
isWriteMode()
Indicates whether this module requires write mode.
needsToken()
Returns the token type this module requires in order to execute.
execute()
Unblocks the specified user or provides the reason the unblock failed.
getHelpUrls()
Return links to more detailed help pages about the module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
mustBePosted()
Indicates whether this module must be called with a POST request.
getExamplesMessages()
Returns usage examples for this module.
static newFromTarget( $specificTarget, $vagueTarget=null, $fromMaster=false)
Given a target and the target's type, get an existing Block object if possible.
getUser()
Get the User object.
getContext()
Get the base IContextSource object.
static checkUnblockSelf( $user, User $performer)
bug 15810: blocked admins should not be able to block/unblock others, and probably shouldn't be able ...
static processUnblock(array $data, IContextSource $context)
Process the form.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getName()
Get the user name, or the IP of an anonymous user.
getId()
Get the user's ID.
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
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
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
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