* Do not force a password for account creation by email
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 19 Nov 2007 22:38:11 +0000 (22:38 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 19 Nov 2007 22:38:11 +0000 (22:38 +0000)
 set pseudo password, it will be replaced later by a random generated password

RELEASE-NOTES
includes/SpecialUserlogin.php

index e91ac11..c839013 100644 (file)
@@ -166,6 +166,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Check for if IP is blocked as part of a range when unblocking (see above bug-
   fix) was faulty. Now fixed.
 * Fixed wpReason URL parameter to action=delete.
+* Do not force a password for account creation by email
 
 === API changes in 1.12 ===
 
index 7094547..92f06ab 100644 (file)
@@ -264,22 +264,29 @@ class LoginForm {
                        return false;
                }
 
+               # check for minimal password length
                if ( !$u->isValidPassword( $this->mPassword ) ) {
-                       $this->mainLoginForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) );
-                       return false;
+                       if ( !$this->mCreateaccountMail ) {
+                               $this->mainLoginForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) );
+                               return false;
+                       } else {
+                               # do not force a password for account creation by email
+                               # set pseudo password, it will be replaced later by a random generated password
+                               $this->mPassword = '-';
+                       }
                }
-               
+
                # if you need a confirmed email address to edit, then obviously you need an email address.
                if ( $wgEmailConfirmToEdit && empty( $this->mEmail ) ) {
                        $this->mainLoginForm( wfMsg( 'noemailtitle' ) );
                        return false;
                }
-               
+
                if( !empty( $this->mEmail ) && !User::isValidEmailAddr( $this->mEmail ) ) {
                        $this->mainLoginForm( wfMsg( 'invalidemailaddress' ) );
                        return false;
                }
-               
+
                # Set some additional data so the AbortNewAccount hook can be
                # used for more than just username validation
                $u->setEmail( $this->mEmail );