Index: trunk/phase3/includes/SpecialUserlogin.php |
— | — | @@ -228,6 +228,7 @@ |
229 | 229 | return false; |
230 | 230 | } |
231 | 231 | |
| 232 | + # Check anonymous user ($wgUser) limitations : |
232 | 233 | if (!$wgUser->isAllowedToCreateAccount()) { |
233 | 234 | $this->userNotPrivilegedMessage(); |
234 | 235 | return false; |
— | — | @@ -241,6 +242,7 @@ |
242 | 243 | return; |
243 | 244 | } |
244 | 245 | |
| 246 | + # Now create a dummy user ($u) and check if it is valid |
245 | 247 | $name = trim( $this->mName ); |
246 | 248 | $u = User::newFromName( $name, 'creatable' ); |
247 | 249 | if ( is_null( $u ) ) { |
— | — | @@ -258,7 +260,7 @@ |
259 | 261 | return false; |
260 | 262 | } |
261 | 263 | |
262 | | - if ( !$wgUser->isValidPassword( $this->mPassword ) ) { |
| 264 | + if ( !$u->isValidPassword( $this->mPassword ) ) { |
263 | 265 | $this->mainLoginForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) ); |
264 | 266 | return false; |
265 | 267 | } |