* Implements a text input field for user names.
* Automatically auto-completes if using the OOUI display format.
*
* Implements a text input field for user names.
* Automatically auto-completes if using the OOUI display format.
*
* Optional parameters:
* 'exists' - Whether to validate that the user already exists
* 'ipallowed' - Whether an IP adress is interpreted as "valid"
* Optional parameters:
* 'exists' - Whether to validate that the user already exists
* 'ipallowed' - Whether an IP adress is interpreted as "valid"
// check, if a user exists with the given username
$user = User::newFromName( $value, false );
$rangeError = null;
// check, if a user exists with the given username
$user = User::newFromName( $value, false );
$rangeError = null;
} elseif (
// check, if the user exists, if requested
( $this->mParams['exists'] && $user->getId() === 0 ) &&
} elseif (
// check, if the user exists, if requested
( $this->mParams['exists'] && $user->getId() === 0 ) &&
!( $this->mParams['ipallowed'] && IP::isValid( $value ) ) &&
// check, if the username is a valid IP range, otherwise save the error message
!( $this->mParams['iprange'] && ( $rangeError = $this->isValidIPRange( $value ) ) === true )
!( $this->mParams['ipallowed'] && IP::isValid( $value ) ) &&
// check, if the username is a valid IP range, otherwise save the error message
!( $this->mParams['iprange'] && ( $rangeError = $this->isValidIPRange( $value ) ) === true )