Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/167633

Change subject: [WIP] Added "CentralAuthGlobalUserMerged" hook for OAuth merge 
updates
......................................................................

[WIP] Added "CentralAuthGlobalUserMerged" hook for OAuth merge updates

Change-Id: I0010197a7b271578f18abe72646571abd821cbd5
---
M includes/GlobalRename/GlobalUserMerge.php
M includes/GlobalRename/GlobalUserMergeDatabaseUpdates.php
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/33/167633/1

diff --git a/includes/GlobalRename/GlobalUserMerge.php 
b/includes/GlobalRename/GlobalUserMerge.php
index 5e7bc83..d71e6c6 100644
--- a/includes/GlobalRename/GlobalUserMerge.php
+++ b/includes/GlobalRename/GlobalUserMerge.php
@@ -102,7 +102,10 @@
 
                // Now that we know all users are locked, update globaluser & 
localuser tables
                foreach ( $this->oldCAUsers as $oldCAUser ) {
-                       $this->databaseUpdates->merge( $oldCAUser->getName(), 
$this->newCAUser->getName() );
+                       $this->databaseUpdates->merge(
+                               $oldCAUser->getName(), 
$this->newCAUser->getName(),
+                               $oldCAUser->getId(), $this->newCAUser->getId()
+                       );
                }
 
                $this->clearCaches();
diff --git a/includes/GlobalRename/GlobalUserMergeDatabaseUpdates.php 
b/includes/GlobalRename/GlobalUserMergeDatabaseUpdates.php
index 3c0164e..2e8f7fb 100644
--- a/includes/GlobalRename/GlobalUserMergeDatabaseUpdates.php
+++ b/includes/GlobalRename/GlobalUserMergeDatabaseUpdates.php
@@ -21,8 +21,10 @@
         *
         * @param string $oldname
         * @param string $newname
+        * @param int $oldid
+        * @param int $newid
         */
-       public function merge( $oldname, $newname ) {
+       public function merge( $oldname, $newname, $oldid, $newid ) {
                $dbw = $this->getDB();
 
                $dbw->begin( __METHOD__ );
@@ -54,5 +56,7 @@
                );
 
                $dbw->commit( __METHOD__ );
+
+               wfRunHooks( 'CentralAuthGlobalUserMerged', array( $oldname, 
$newname, $oldid, $newid ) );
        }
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/167633
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0010197a7b271578f18abe72646571abd821cbd5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to