dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Change 1.26 to 1.27, mostly in doc comments"
[lhc/web/wiklou.git]
/
includes
/
htmlform
/
HTMLUserTextField.php
diff --git
a/includes/htmlform/HTMLUserTextField.php
b/includes/htmlform/HTMLUserTextField.php
index
949fefd
..
9617c0a
100644
(file)
--- a/
includes/htmlform/HTMLUserTextField.php
+++ b/
includes/htmlform/HTMLUserTextField.php
@@
-17,6
+17,7
@@
class HTMLUserTextField extends HTMLTextField {
public function __construct( $params ) {
$params += array(
'exists' => false,
public function __construct( $params ) {
$params += array(
'exists' => false,
+ 'ipallowed' => false,
);
parent::__construct( $params );
);
parent::__construct( $params );
@@
-24,11
+25,14
@@
class HTMLUserTextField extends HTMLTextField {
public function validate( $value, $alldata ) {
// check, if a user exists with the given username
public function validate( $value, $alldata ) {
// check, if a user exists with the given username
- $user = User::newFromName( $value );
+ $user = User::newFromName( $value
, false
);
if ( !$user ) {
return $this->msg( 'htmlform-user-not-valid', $value )->parse();
if ( !$user ) {
return $this->msg( 'htmlform-user-not-valid', $value )->parse();
- } elseif ( $this->mParams['exists'] && $user->getId() === 0 ) {
+ } elseif (
+ ( $this->mParams['exists'] && $user->getId() === 0 ) &&
+ !( $this->mParams['ipallowed'] && User::isIP( $value ) )
+ ) {
return $this->msg( 'htmlform-user-not-exists', $user->getName() )->parse();
}
return $this->msg( 'htmlform-user-not-exists', $user->getName() )->parse();
}
@@
-36,7
+40,7
@@
class HTMLUserTextField extends HTMLTextField {
}
protected function getInputWidget( $params ) {
}
protected function getInputWidget( $params ) {
- $this->mParent->getOutput()->addModules( 'mediawiki.widgets' );
+ $this->mParent->getOutput()->addModules( 'mediawiki.widgets
.UserInputWidget
' );
return new UserInputWidget( $params );
}
return new UserInputWidget( $params );
}