35 parent::__construct(
'BlockList' );
48 $out->setPageTitle( $this->
msg(
'ipblocklist' ) );
49 $out->addModuleStyles( [
'mediawiki.special' ] );
52 $par =
$request->getVal(
'ip', $par );
53 $this->target = trim(
$request->getVal(
'wpTarget', $par ) );
57 $action =
$request->getText(
'action' );
59 if ( $action ==
'unblock' || $action ==
'submit' &&
$request->wasPosted() ) {
60 # B/C @since 1.18: Unblock interface is now at Special:Unblock
67 # setup BlockListPager here to get the actual default Limit
70 # Just show the block list
74 'label-message' =>
'ipaddressorusername',
80 'type' =>
'multiselect',
81 'options-messages' => [
82 'blocklist-userblocks' =>
'userblocks',
83 'blocklist-tempblocks' =>
'tempblocks',
84 'blocklist-addressblocks' =>
'addressblocks',
85 'blocklist-rangeblocks' =>
'rangeblocks',
90 'type' =>
'limitselect',
91 'label-message' =>
'table_pager_limit_label',
93 $lang->formatNum( 20 ) => 20,
94 $lang->formatNum( 50 ) => 50,
95 $lang->formatNum( 100 ) => 100,
96 $lang->formatNum( 250 ) => 250,
97 $lang->formatNum( 500 ) => 500,
100 'default' => $pager->getLimit(),
108 ->setWrapperLegendMsg(
'ipblocklist-legend' )
109 ->setSubmitTextMsg(
'ipblocklist-submit' )
110 ->setSubmitProgressive()
112 ->displayForm(
false );
123 # Is the user allowed to see hidden blocks?
124 if ( !$this->
getUser()->isAllowed(
'hideuser' ) ) {
125 $conds[
'ipb_deleted'] = 0;
128 if ( $this->target !==
'' ) {
147 $conds[
'ipb_auto'] = 0;
151 $conds[
'ipb_address'] =
$target->getName();
152 $conds[
'ipb_auto'] = 0;
158 if ( in_array(
'userblocks', $this->
options ) ) {
159 $conds[
'ipb_user'] = 0;
161 if ( in_array(
'tempblocks', $this->
options ) ) {
162 $conds[
'ipb_expiry'] =
'infinity';
164 if ( in_array(
'addressblocks', $this->
options ) ) {
165 $conds[] =
"ipb_user != 0 OR ipb_range_end > ipb_range_start";
167 if ( in_array(
'rangeblocks', $this->
options ) ) {
168 $conds[] =
"ipb_range_end = ipb_range_start";
181 # Check for other blocks, i.e. global/tor blocks
182 $otherBlockLink = [];
183 Hooks::run(
'OtherBlockLogLink', [ &$otherBlockLink, $this->target ] );
185 # Show additional header for the local block only when other blocks exists.
186 # Not necessary in a standard installation without such extensions enabled
187 if ( count( $otherBlockLink ) ) {
195 } elseif ( $this->target ) {
196 $out->addWikiMsg(
'ipblocklist-no-results' );
198 $out->addWikiMsg(
'ipblocklist-empty' );
201 if ( count( $otherBlockLink ) ) {
206 $this->
msg(
'ipblocklist-otherblocks', count( $otherBlockLink ) )->parse()
210 foreach ( $otherBlockLink
as $link ) {
215 [
'class' =>
'mw-ipblocklist-otherblocks' ],
static getRangeCond($start, $end=null)
Get a set of SQL conditions which will select rangeblocks encompassing a given range.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
getContext()
Gets the context this SpecialPage is executed in.
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name If you don't need a full Title object...
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
if(!isset($args[0])) $lang
An IContextSource implementation which will inherit context from another source but allow individual ...
msg()
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing options(say) and put it in one place.Instead of having little title-reversing if-blocks spread all over the codebase in showAnArticle
outputHeader($summaryMessageKey= '')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
usually copyright or history_copyright This message must be in HTML not wikitext & $link
showList(BlockListPager $pager)
Show the list of blocked accounts matching the actual filter.
Parent class for all special pages.
A special page that lists existing blocks.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes! ...
static parseTarget($target)
From an existing Block, get the target and the type of target.
namespace and then decline to actually register it file or subcat img or subcat $title
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
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
getBlockListPager()
Setup a new BlockListPager instance.
error also a ContextSource you ll probably need to make sure the header is varied on $request
static parseRange($range)
Given a string range in a number of formats, return the start and end of the range in hexadecimal...
getUser()
Shortcut to get the User executing this instance.
getLanguage()
Shortcut to get user's language.
getRequest()
Get the WebRequest being used for this instance.
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
execute($par)
Main execution point.
getPageTitle($subpage=false)
Get a self-referential title object.