From: Aaron Schulz Date: Sun, 28 Aug 2016 19:10:14 +0000 (-0700) Subject: Use DB_SLAVE in TemporaryPasswordPrimaryAuthenticationProvider X-Git-Tag: 1.31.0-rc.0~5846^2 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=9b273e8e4976c516c9ba61af992445820e45501f;p=lhc%2Fweb%2Fwiklou.git Use DB_SLAVE in TemporaryPasswordPrimaryAuthenticationProvider Barring ChronologyProtector failure (which itself falls back to waitForReplication) on account creation, this should be fine. Change-Id: I94be86c8f56e9e98a9d06814b33a9f08a9228db6 --- diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php index ed94c1ad2b..c3382847b5 100644 --- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php @@ -126,8 +126,8 @@ class TemporaryPasswordPrimaryAuthenticationProvider return AuthenticationResponse::newAbstain(); } - $dbw = wfGetDB( DB_MASTER ); - $row = $dbw->selectRow( + $dbr = wfGetDB( DB_SLAVE ); + $row = $dbr->selectRow( 'user', [ 'user_id', 'user_newpassword', 'user_newpass_time', @@ -165,8 +165,8 @@ class TemporaryPasswordPrimaryAuthenticationProvider return false; } - $dbw = wfGetDB( DB_MASTER ); - $row = $dbw->selectRow( + $dbr = wfGetDB( DB_SLAVE ); + $row = $dbr->selectRow( 'user', [ 'user_newpassword', 'user_newpass_time' ], [ 'user_name' => $username ],