r79072 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79071‎ | r79072 | r79073 >
Date:17:17, 27 December 2010
Author:platonides
Status:ok
Tags:
Comment:
(Bug 26434) - Generated password from "Create account by email" does not work.
Another consequence of the $ts === 0 from r71751.
Fixed in a more verbose way. Behavior documented in tables.sql
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tables.sql
@@ -76,7 +76,10 @@
7777 user_newpassword tinyblob NOT NULL,
7878
7979 -- Timestamp of the last time when a new password was
80 - -- sent, for throttling purposes
 80+ -- sent, for throttling and expiring purposes
 81+ -- Emailed passwords will expire $wgNewPasswordExpiry
 82+ -- (a week) after being set. If user_newpass_time is NULL
 83+ -- (eg. created by mail) it doesn't expire.
8184 user_newpass_time binary(14),
8285
8386 -- Note: email should be restricted, not public info.
Index: trunk/phase3/includes/User.php
@@ -2820,7 +2820,9 @@
28212821 function checkTemporaryPassword( $plaintext ) {
28222822 global $wgNewPasswordExpiry;
28232823 if( self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() ) ) {
2824 - $this->load();
 2824+ if ( is_null( $this->mNewpassTime ) ) {
 2825+ return true;
 2826+ }
28252827 $expiry = wfTimestamp( TS_UNIX, $this->mNewpassTime ) + $wgNewPasswordExpiry;
28262828 return ( time() < $expiry );
28272829 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r79129MFT r78011 r78014 r78015 r78016 r78099 r78117 r78161 r78170 r78172 r78199 r78......platonides19:58, 28 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71751Merge r71750 to trunk: let wfTimestamp() accept TS_RFC2822 as an input format...catrope21:02, 26 August 2010

Status & tagging log