Louperivois has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370973 )

Change subject: Replacing deprecated AddNewAccount Hook
......................................................................

Replacing deprecated AddNewAccount Hook

Bug: T135274
Change-Id: I283185bb4acf6fdf41ef71413c392e8cc0d67f84
---
M NewUserNotif.class.php
M NewUserNotif.php
2 files changed, 5 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NewUserNotif 
refs/changes/73/370973/1

diff --git a/NewUserNotif.class.php b/NewUserNotif.class.php
index 975af8c..ada88b0 100644
--- a/NewUserNotif.class.php
+++ b/NewUserNotif.class.php
@@ -16,7 +16,7 @@
        /**
         * Constructor
         */
-       public function NewUserNotifier() {
+       public function __construct() {
                global $wgNewUserNotifSender;
                $this->sender = $wgNewUserNotifSender;
        }
@@ -120,9 +120,10 @@
         * Hook account creation
         *
         * @param User $user User that was created
+        * @param Boolean $autocreated, whether this was an auto-creation
         * @return bool
         */
-       public static function hook( $user ) {
+       public static function hook( $user, $autocreated ) {
                $notifier = new self();
                $notifier->execute( $user );
                return true;
diff --git a/NewUserNotif.php b/NewUserNotif.php
index f80dd9e..9d55ae8 100644
--- a/NewUserNotif.php
+++ b/NewUserNotif.php
@@ -15,7 +15,7 @@
 $wgExtensionCredits['other'][] = array(
        'path' => __FILE__,
        'name'           => 'New User Email Notification',
-       'version'        => '1.6.0',
+       'version'        => '1.7.0',
        'author'         => 'Rob Church',
        'url'            => 
'https://www.mediawiki.org/wiki/Extension:New_User_Email_Notification',
        'descriptionmsg' => 'newusernotif-desc',
@@ -47,15 +47,5 @@
  */
 function efNewUserNotifSetup() {
        global $wgHooks;
-       $wgHooks['AddNewAccount'][] = 'efNewUserNotif';
-}
-
-/**
- * Hook account creation
- *
- * @param User $user User account that was created
- * @return bool
- */
-function efNewUserNotif( $user ) {
-       return NewUserNotifier::hook( $user );
+       $wgHooks['LocalUserCreated'][] = 'NewUserNotifier::hook';
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I283185bb4acf6fdf41ef71413c392e8cc0d67f84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NewUserNotif
Gerrit-Branch: master
Gerrit-Owner: Louperivois <plmo...@hotmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to