jenkins-bot has submitted this change and it was merged.

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


Add localization to whitelisted page.

Change-Id: I32d45063bb7ac27eefd4a62ff195658e2a12d8c7
(cherry picked from commit b8242eaca2ead0a59ac32a72eb5b4b2f6b430c73)
---
M OpenIDConnect.php
M extension.json
2 files changed, 12 insertions(+), 32 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/OpenIDConnect.php b/OpenIDConnect.php
index f300719..b874f41 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,11 @@
                }
        }
 
-       /**
-        * Implements extension registration callback.
-        * See 
https://www.mediawiki.org/wiki/Manual:Extension_registration#Customizing_registration
-        *
-        * @since 2.3
-        *
-        */
-       public static function onRegistration() {
-               if ( !$GLOBALS['wgWhitelistRead'] ) {
-                       $GLOBALS['wgWhitelistRead'] = [];
-               }
-               $GLOBALS['wgWhitelistRead'][] = 
'Special:SelectOpenIDConnectIssuer';
+       public static function loadExtensionSchemaUpdates( $updater ) {
+               $updater->addExtensionField( 'user', 'subject',
+                       __DIR__ . '/AddSubject.sql' );
+               $updater->addExtensionField( 'user', 'issuer',
+                       __DIR__ . '/AddIssuer.sql' );
+               return true;
        }
 }
diff --git a/extension.json b/extension.json
index d1cf213..f0791b4 100644
--- a/extension.json
+++ b/extension.json
@@ -7,6 +7,9 @@
        "url": "https://www.mediawiki.org/wiki/Extension:OpenID_Connect";,
        "descriptionmsg": "openidconnect-desc",
        "type": "other",
+       "requires": {
+               "PluggableAuth": ">= 2.0"
+       },
        "SpecialPages": {
                "SelectOpenIDConnectIssuer": "SelectOpenIDConnectIssuer"
        },
@@ -22,7 +25,6 @@
                "OpenIDConnect": "OpenIDConnect.php",
                "SelectOpenIDConnectIssuer": "SelectOpenIDConnectIssuer.php"
        },
-       "callback": "OpenIDConnect::onRegistration",
        "Hooks": {
                "LoadExtensionSchemaUpdates": 
"OpenIDConnect::loadExtensionSchemaUpdates"
        },
@@ -34,6 +36,9 @@
                "OpenIDConnect_UseEmailNameAsUserName": false,
                "PluggableAuth_Class": "OpenIDConnect"
        },
+       "PluggableAuthLoginSpecialPages": [
+               "SelectOpenIDConnectIssuer"
+       ],
        "load_composer_autoloader": true,
        "manifest_version": 1
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I32d45063bb7ac27eefd4a62ff195658e2a12d8c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenIDConnect
Gerrit-Branch: REL1_27
Gerrit-Owner: Cicalese <cical...@mitre.org>
Gerrit-Reviewer: Cicalese <cical...@mitre.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to