Skip to content
Snippets Groups Projects
Commit 57043a9d authored by cicalese's avatar cicalese Committed by Cicalese
Browse files

Add localization to whitelisted page.

Change-Id: I32d45063bb7ac27eefd4a62ff195658e2a12d8c7
(cherry picked from commit b8242eac)
parent 087b69f2
Branches REL1_27
No related merge requests found
......@@ -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 @@ class OpenIDConnect extends PluggableAuth {
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 @@ class OpenIDConnect extends PluggableAuth {
}
}
/**
* 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;
}
}
......@@ -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
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment