jenkins-bot has submitted this change and it was merged.
Change subject: If users match email with the global account winner, don't
rename them
......................................................................
If users match email with the global account winner, don't rename them
Change-Id: I352a32580c99a0ec5c5670cf99c15b6c6e98a803
---
M maintenance/populateListOfUsersToRename.php
1 file changed, 22 insertions(+), 4 deletions(-)
Approvals:
CSteipp: Looks good to me, approved
jenkins-bot: Verified
diff --git a/maintenance/populateListOfUsersToRename.php
b/maintenance/populateListOfUsersToRename.php
index 2dd99e9..7d025e7 100644
--- a/maintenance/populateListOfUsersToRename.php
+++ b/maintenance/populateListOfUsersToRename.php
@@ -71,19 +71,37 @@
$this->lName = $row->name;
$this->lWiki = $row->wiki;
if ( $cache->has( $row->name ) ) {
- $home = $cache->get( $row->name );
+ $attachableWikis = $cache->get(
$row->name );
} else {
$ca = new CentralAuthUser( $row->name );
+ $attachableWikis = array();
+ $unattached = $ca->queryUnattached();
if ( $ca->exists() ) {
$home = $ca->getHomeWiki();
+ $attachableWikis[] = $home;
+ foreach ( $unattached as $wiki
=> $info ) {
+ if (
$ca->getEmailAuthenticationTimestamp() &&
+ $info['email']
=== $ca->getEmail() && !is_null( $info['emailAuthenticated'] )
+ ) {
+
$attachableWikis[] = $wiki;
+ }
+ }
} else {
- $home = $ca->chooseHomeWiki(
$ca->queryUnattached() );
+ $home = $ca->chooseHomeWiki(
$unattached );
+ $attachableWikis[] = $home;
+ if (
$unattached[$home]['email'] && isset( $unattached[$home]['emailAuthenticated']
) ) {
+ foreach ( $unattached
as $wiki => $info ) {
+ if ( $wiki !==
$home && $unattached[$home]['email'] === $info['email'] && isset(
$info['emailAuthenticated'] ) ) {
+
$attachableWikis[] = $wiki;
+ }
+ }
+ }
}
$cache->set( $row->name, $home );
}
- if ( $home !== $row->wiki ) {
- // Unattached account which is not on
the home wiki,
+ if ( !in_array( $row->wiki, $attachableWikis )
) {
+ // Unattached account which is not
attachable,
// so they're getting renamed :(
$insertRows[] = (array)$row;
}
--
To view, visit https://gerrit.wikimedia.org/r/193497
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I352a32580c99a0ec5c5670cf99c15b6c6e98a803
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits