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

Change subject: Register providers within extension.json instead of a callback
......................................................................

Register providers within extension.json instead of a callback

Follows-up I153e372615f573c5955cf7192f22ac0dd7cbb211

See:
* https://www.mediawiki.org/wiki/Manual:$wgAuthManagerAutoConfig
* 
https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#AuthManagerAutoConfig

Change-Id: Ic3438403f3756c3718bd49ed97c49b866f793322
---
M extension.json
M includes/NewSignupPage.class.php
2 files changed, 8 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NewSignupPage 
refs/changes/31/381531/1

diff --git a/extension.json b/extension.json
index ef54025..9af3222 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
        "name": "New Signup Page",
-       "version": "1.0.0",
+       "version": "1.1.0",
        "author": [
                "Jack Phoenix"
        ],
@@ -8,7 +8,6 @@
        "url": "https://www.mediawiki.org/wiki/Extension:NewSignupPage";,
        "descriptionmsg": "newsignuppage-desc",
        "type": "other",
-       "callback": "NewSignupPage::registerExtension",
        "config": {
                "RegisterTrack": false,
                "AutoAddFriendOnInvite": false,
@@ -24,6 +23,13 @@
                "NewSignupPageAuthenticationRequest": 
"includes/auth/NewSignupPageAuthenticationRequest.php",
                "NewSignupPageSecondaryAuthenticationProvider": 
"includes/auth/NewSignupPageSecondaryAuthenticationProvider.php"
        },
+       "AuthManagerAutoConfig": {
+               "secondaryauth": {
+                       "NewSignupPageSecondaryAuthenticationProvider": {
+                               "class": 
"NewSignupPageSecondaryAuthenticationProvider"
+                       }
+               }       
+       },
        "Hooks": {
                "BeforePageDisplay": [
                        "NewSignupPage::onBeforePageDisplay"
diff --git a/includes/NewSignupPage.class.php b/includes/NewSignupPage.class.php
index 4b34d2c..1931868 100644
--- a/includes/NewSignupPage.class.php
+++ b/includes/NewSignupPage.class.php
@@ -13,16 +13,6 @@
 class NewSignupPage {
 
        /**
-        * Automatically register our new preauth provider with AuthManager when
-        * this extension is enabled
-        */
-       public static function registerExtension() {
-               global $wgAuthManagerAutoConfig;
-               
$wgAuthManagerAutoConfig['secondaryauth'][NewSignupPageSecondaryAuthenticationProvider::class]
 =
-                               [ 'class' => 
NewSignupPageSecondaryAuthenticationProvider::class ];
-       }
-
-       /**
         * Add the JavaScript file to the page output on the signup page.
         *
         * @param OutputPage $out

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3438403f3756c3718bd49ed97c49b866f793322
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NewSignupPage
Gerrit-Branch: master
Gerrit-Owner: SamanthaNguyen <[email protected]>

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

Reply via email to