Go to the documentation of this file.
47 return $this->
msg(
'htmlform-user-not-valid',
$value );
50 ( $this->mParams[
'exists'] &&
$user->getId() === 0 ) &&
56 if ( is_string( $rangeError ) ) {
59 return $this->
msg(
'htmlform-user-not-exists',
$user->getName() );
62 return parent::validate(
$value, $alldata );
66 $cidrIPRanges = $this->mParams[
'iprangelimits'];
72 list( $ip, $range ) = explode(
'/',
$value, 2 );
75 (
IP::isIPv4( $ip ) && $cidrIPRanges[
'IPv4'] == 32 ) ||
76 (
IP::isIPv6( $ip ) && $cidrIPRanges[
'IPv6'] == 128 )
79 return $this->
msg(
'ip_range_toolow' )->parse();
87 return $this->
msg(
'ip_range_invalid' )->parse();
90 if (
IP::isIPv4( $ip ) && $range < $cidrIPRanges[
'IPv4'] ) {
91 return $this->
msg(
'ip_range_exceeded', $cidrIPRanges[
'IPv4'] )->parse();
94 if (
IP::isIPv6( $ip ) && $range < $cidrIPRanges[
'IPv6'] ) {
95 return $this->
msg(
'ip_range_exceeded', $cidrIPRanges[
'IPv6'] )->parse();
110 return [
'mediawiki.widgets.UserInputWidget' ];
115 $this->mParent->getOutput()->addModules(
'mediawiki.userSuggest' );
116 $this->mClass .=
' mw-autocomplete-user';
119 return parent::getInputHTML(
$value );
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
shouldInfuseOOUI()
Whether the field should be automatically infused.
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 account $user
wfArrayPlus2d(array $baseArray, array $newValues)
Merges two (possibly) 2 dimensional arrays into the target array ($baseArray).
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static isIPv6( $ip)
Given a string, determine if it as valid IP in IPv6 only.
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
Implements a text input field for user names.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static isValidBlock( $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
static isValid( $ip)
Validate an IP address.
static isIPv4( $ip)
Given a string, determine if it as valid IP in IPv4 only.
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 noclasses just before the function returns a value If you return true
validate( $value, $alldata)
Override this function to add specific validation checks on the field input.