Niharika29 has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/333563 )
Change subject: Update AddNewAccount->LocalUserCreated hook for LoginNotify
......................................................................
Update AddNewAccount->LocalUserCreated hook for LoginNotify
Bug: t135270
Change-Id: I0efbacac13807d802e5cc6e4d226d75050f01d2d
---
M LoginNotify.hooks.php
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LoginNotify
refs/changes/63/333563/1
diff --git a/LoginNotify.hooks.php b/LoginNotify.hooks.php
index ce1474f..00611c0 100644
--- a/LoginNotify.hooks.php
+++ b/LoginNotify.hooks.php
@@ -144,6 +144,8 @@
}
/**
+ * Deprecated since v1.27
+ *
* Set a cookie saying this is a known computer when creating an
account.
*
* @todo This still sets cookies if user creates account well logged in
as someone else.
@@ -158,6 +160,21 @@
}
/**
+ * Hook for new account creation since v1.27
+ *
+ * Called immediately after a local user has been created and saved to
the database
+ *
+ * @param User $user User created
+ * @param boolean $autocreated Whether this was an auto-created account
+ */
+ public static function onLocalUserCreated( $user, $autocreated ) {
+ if ( !$autocreated ) {
+ $loginNotify = new LoginNotify();
+ $loginNotify->setCurrentAddressAsKnown( $user );
+ }
+ }
+
+ /**
* Hook for loading options.
*
* This is a bit hacky. Used to be able to set a different
--
To view, visit https://gerrit.wikimedia.org/r/333563
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0efbacac13807d802e5cc6e4d226d75050f01d2d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LoginNotify
Gerrit-Branch: master
Gerrit-Owner: Niharika29 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits