username (r21640, bug 3348).
return false;
}
+ # Check anonymous user ($wgUser) limitations :
if (!$wgUser->isAllowedToCreateAccount()) {
$this->userNotPrivilegedMessage();
return false;
return;
}
+ # Now create a dummy user ($u) and check if it is valid
$name = trim( $this->mName );
$u = User::newFromName( $name, 'creatable' );
if ( is_null( $u ) ) {
return false;
}
- if ( !$wgUser->isValidPassword( $this->mPassword ) ) {
+ if ( !$u->isValidPassword( $this->mPassword ) ) {
$this->mainLoginForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) );
return false;
}