Cicalese has uploaded a new change for review.

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

Change subject: Add localization to whitelisted page.
......................................................................

Add localization to whitelisted page.

Change-Id: I32d45063bb7ac27eefd4a62ff195658e2a12d8c7
---
M OpenIDConnect.php
M extension.json
2 files changed, 19 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenIDConnect 
refs/changes/72/315572/1

diff --git a/OpenIDConnect.php b/OpenIDConnect.php
index f300719..1df19df 100644
--- a/OpenIDConnect.php
+++ b/OpenIDConnect.php
@@ -22,12 +22,6 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-$wgExtensionFunctions[] = function () {
-       if ( !class_exists( 'PluggableAuth' ) ) {
-               die( '<b>Error:</b> This extension requires the PluggableAuth 
extension to be included first' );
-       }
-};
-
 use \MediaWiki\Session\SessionManager;
 use \MediaWiki\Auth\AuthManager;
 
@@ -345,19 +339,6 @@
                return $name . $count;
        }
 
-       public static function loadExtensionSchemaUpdates( $updater ) {
-               $updater->addExtensionField( 'user', 'subject',
-                       __DIR__ . '/AddSubject.sql' );
-               $updater->addExtensionField( 'user', 'issuer',
-                       __DIR__ . '/AddIssuer.sql' );
-               return true;
-       }
-
-       /**
-        *
-        * @param $page
-        * @param $params
-        */
        private static function redirect( $page, $params = null, $doExit = 
false ) {
                $title = Title::newFromText( $page );
                if ( is_null( $title ) ) {
@@ -375,17 +356,26 @@
                }
        }
 
+       public static function loadExtensionSchemaUpdates( $updater ) {
+               $updater->addExtensionField( 'user', 'subject',
+                       __DIR__ . '/AddSubject.sql' );
+               $updater->addExtensionField( 'user', 'issuer',
+                       __DIR__ . '/AddIssuer.sql' );
+               return true;
+       }
+
        /**
-        * Implements extension registration callback.
-        * See 
https://www.mediawiki.org/wiki/Manual:Extension_registration#Customizing_registration
+        * Implements extension function.
+        * See https://www.mediawiki.org/wiki/Manual:$wgExtensionFunctions
         *
-        * @since 2.3
+        * @since 2.0
         *
         */
-       public static function onRegistration() {
-               if ( !$GLOBALS['wgWhitelistRead'] ) {
-                       $GLOBALS['wgWhitelistRead'] = [];
+       public static function extensionFunction() {
+               if ( !class_exists( 'PluggableAuth' ) ) {
+                       die( '<b>Error:</b> This extension requires the 
PluggableAuth extension to be included first' );
                }
-               $GLOBALS['wgWhitelistRead'][] = 
'Special:SelectOpenIDConnectIssuer';
+               $title = Title::newFromText( 'SelectOpenIDConnectIssuer', 
NS_SPECIAL );
+               $GLOBALS['wgWhitelistRead'][] = $title->getPrefixedText();
        }
 }
diff --git a/extension.json b/extension.json
index d1cf213..e327e5a 100644
--- a/extension.json
+++ b/extension.json
@@ -22,10 +22,12 @@
                "OpenIDConnect": "OpenIDConnect.php",
                "SelectOpenIDConnectIssuer": "SelectOpenIDConnectIssuer.php"
        },
-       "callback": "OpenIDConnect::onRegistration",
        "Hooks": {
                "LoadExtensionSchemaUpdates": 
"OpenIDConnect::loadExtensionSchemaUpdates"
        },
+       "ExtensionFunctions": [
+               "OpenIDConnect::extensionFunction"
+       ],
        "config": {
                "OpenIDConnect_MigrateUsersByEmail": false,
                "OpenIDConnect_MigrateUsersByUserName": false,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32d45063bb7ac27eefd4a62ff195658e2a12d8c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenIDConnect
Gerrit-Branch: master
Gerrit-Owner: Cicalese <cical...@mitre.org>

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

Reply via email to