From: Brion Vibber Date: Wed, 7 Jan 2009 03:54:29 +0000 (+0000) Subject: Revert r45450, r45451 "(bug 2242) Introduce expiry time for temporary passwords." X-Git-Tag: 1.31.0-rc.0~43529 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=c6a91a002dae685f8c9dbfe510ec47c0d8e5e104;p=lhc%2Fweb%2Fwiklou.git Revert r45450, r45451 "(bug 2242) Introduce expiry time for temporary passwords." Notice: Undefined variable: wgNewPasswordExpiry in /Library/WebServer/Documents/trunk/includes/User.php on line 2710
--- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b6ccbed93f..c8f3fd7cda 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -71,8 +71,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * The 'BeforeWatchlist' hook has been removed due to internal changes in Special:Watchlist. 'SpecialWatchlistQuery' should now be used by extensions to customize the watchlist database query. -* Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to - tempoary passwords + === Migrated extensions === The following extensions are migrated into MediaWiki 1.14: @@ -258,7 +257,6 @@ The following extensions are migrated into MediaWiki 1.14: move log * Image moving is now enabled for sysops by default * Make "Did you mean" search feature more noticeable -* (bug 2242) Add an expiry time to temporary passwords * (bug 16720) Transcluded Special:NewPages processes "/username=" === Bug fixes in 1.14 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 18e7b65e63..f7157b279b 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -520,11 +520,6 @@ $wgUserEmailUseReplyTo = false; */ $wgPasswordReminderResendTime = 24; -/** - * The time, in seconds, when an emailed temporary password expires. - */ -$wgNewPasswordExpiry = 3600 * 24 * 7; - /** * SMTP Mode * For using a direct (authenticated) SMTP server connection. diff --git a/includes/User.php b/includes/User.php index 80318a9be9..9fee089c4c 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2705,13 +2705,7 @@ class User { * @return \bool True if matches, false otherwise */ function checkTemporaryPassword( $plaintext ) { - if( self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() ) ) { - $this->load(); - $expiry = wfTimestamp( TS_UNIX, $this->mNewpassTime ) + $wgNewPasswordExpiry; - return ( time() < $expiry ); - } else { - return false; - } + return self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() ); } /** diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 1bb54ed62f..6a4da7a4ab 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -654,7 +654,7 @@ class LoginForm { * @private */ function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) { - global $wgServer, $wgScript, $wgUser, $wgNewPasswordExpiry; + global $wgServer, $wgScript, $wgUser; if ( '' == $u->getEmail() ) { return new WikiError( wfMsg( 'noemail', $u->getName() ) ); @@ -670,8 +670,7 @@ class LoginForm { $u->setNewpassword( $np, $throttle ); $u->saveSettings(); - $m = wfMsgExt( $emailText, array( 'parsemag' ), $ip, $u->getName(), $np, - $wgServer . $wgScript, round( $wgNewPasswordExpiry / 86400 ) ); + $m = wfMsg( $emailText, $ip, $u->getName(), $np, $wgServer . $wgScript ); $result = $u->sendMail( wfMsg( $emailTitle ), $m ); return $result; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index bbd6ce4a73..b52aebee45 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -937,7 +937,6 @@ It must have at least {{PLURAL:$1|1 character|$1 characters}} and be different f password for {{SITENAME}} ($4). A temporary password for user "$2" has been created and was set to "$3". If this was your intent, you will need to log in and choose a new password now. -Your temporary password will expire in {{PLURAL:$5|one day|$5 days}}. If someone else made this request, or if you have remembered your password, and you no longer wish to change it, you may ignore this message and