jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/348658 )
Change subject: Avoid triggering master queries in ApiValidatePassword
......................................................................
Avoid triggering master queries in ApiValidatePassword
Bug: T92357
Change-Id: Ida56c6279a1deaefb9d19d3e450632de544e5f5a
---
M includes/CentralAuthHooks.php
1 file changed, 8 insertions(+), 3 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index d3e84ec..9c01859 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -781,6 +781,7 @@
if ( $ca->isAttached() ) {
$ca->saveSettings();
}
+
return true;
}
@@ -790,11 +791,15 @@
* @return bool
*/
static function onUserSetEmailAuthenticationTimestamp( $user,
&$timestamp ) {
- $ca = CentralAuthUser::getMasterInstance( $user );
+ $ca = CentralAuthUser::getInstance( $user );
if ( $ca->isAttached() ) {
- $ca->setEmailAuthenticationTimestamp( $timestamp );
- $ca->saveSettings();
+ $latestCa = CentralAuthUser::newMasterInstanceById(
$ca->getId() );
+ if ( $latestCa->isAttached() ) {
+ $latestCa->setEmailAuthenticationTimestamp(
$timestamp );
+ $latestCa->saveSettings();
+ }
}
+
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/348658
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ida56c6279a1deaefb9d19d3e450632de544e5f5a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MarcoAurelio <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits