From: Raimond Spekking Date: Mon, 19 Nov 2007 22:38:11 +0000 (+0000) Subject: * Do not force a password for account creation by email X-Git-Tag: 1.31.0-rc.0~50795 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=9bb3545c76848aab70de49dad856cb8648b3aed8;p=lhc%2Fweb%2Fwiklou.git * Do not force a password for account creation by email set pseudo password, it will be replaced later by a random generated password --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e91ac11b82..c839013de3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 7094547b79..92f06abaff 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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 );