155 $this->mReason = $reason;
175 $this->mHideName = $hideName;
201 return wfSetVar( $this->blockCreateAccount, $x );
214 return wfSetVar( $this->mBlockEmail, $x );
227 return wfSetVar( $this->allowUsertalk, $x );
242 $blockDisablesLogin =
$config->
get(
'BlockDisablesLogin' );
250 case 'createaccount':
267 if ( !
$res && $blockDisablesLogin ) {
271 $res = $anon->isAllowed( $right ) ?
$res :
true;
288 $blockDisablesLogin =
$config->
get(
'BlockDisablesLogin' );
289 $blockAllowsUTEdit =
$config->
get(
'BlockAllowsUTEdit' );
294 # For now... <evil laugh> 297 case 'createaccount':
307 case 'editownusertalk':
316 if ( !$blockAllowsUTEdit ) {
327 if ( !
$res && $blockDisablesLogin ) {
347 # We may have been through this before 350 return [
$target, self::TYPE_IP ];
352 return [
$target, self::TYPE_USER ];
361 # We can still create a User if it's an IP address, but we need to turn 362 # off validation checking (which would exclude IP addresses) 369 # Can't create a User from an IP range 373 # Consider the possibility that this is not a username at all 374 # but actually an old subpage (T31797) 375 if ( strpos(
$target,
'/' ) !==
false ) {
376 # An old subpage, drill down to the user behind it 381 if ( $userObj instanceof User ) {
382 # Note that since numbers are valid usernames, a $target of "12345" will be 383 # considered a User. If you want to pass a block ID, prepend a hash "#12345", 384 # since hash characters are not valid in usernames or titles generally. 385 return [ $userObj, self::TYPE_USER ];
387 } elseif ( preg_match(
'/^#\d+$/',
$target ) ) {
388 # Autoblock reference in the form "#12345" 389 return [ substr(
$target, 1 ), self::TYPE_AUTO ];
442 $this->mExpiry = $expiry;
462 $this->mTimestamp = $timestamp;
486 if ( is_string(
$user ) ) {
492 'Blocker must be a local user or a name that cannot be a local user' 496 $this->blocker =
$user;
521 $blockerText =
$lang->embedBidi( $blockerUserpage->getText() );
522 $link =
"[[{$blockerUserpage->getPrefixedText()}|{$blockerText}]]";
528 if ( $reason ==
'' ) {
529 $reason = $context->
msg(
'blockednoreason' )->text();
545 $lang->embedBidi( $intended ),
579 if ( $this->target instanceof
User ) {
580 $usertalk = $this->target->getTalkPage();
583 '$usertalk must be provided if block target is not a user/IP' 590 '$usertalk must be a user talk page'
static isValidRange( $ipRange)
Validate an IP range (valid address with a valid CIDR prefix).
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
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
if(!isset( $args[0])) $lang
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
static sanitizeRange( $range)
Gets rid of unneeded numbers in quad-dotted/octet IP strings For example, 127.111.113.151/24 -> 127.111.113.0/24.
get( $name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
getName()
Get the user name, or the IP of an anonymous user.
usually copyright or history_copyright This message must be in HTML not wikitext & $link
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static getMain()
Get the RequestContext object associated with the main request.
static sanitizeIP( $ip)
Convert an IP into a verbose, uppercase, normalized form.
static isValid( $ip)
Validate an IP address.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
static isUsableName( $name)
Usernames which fail to pass this function will be blocked from user login and new account registrati...
namespace and then decline to actually register it file or subcat img or subcat $title
msg( $key)
This is the method for getting translated interface messages.
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
wfSetVar(&$dest, $source, $force=false)
Sets dest to source and returns the original value of dest If source is NULL, it just returns the val...
static newFromId( $id)
Static factory method for creation from a given user ID.
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
getUserPage()
Get this user's personal page title.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
return true to allow those checks to and false if checking is done & $user