Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383741 )
Change subject: Remove pre-authmanager code ...................................................................... Remove pre-authmanager code Bug: T178034 Change-Id: I2bb89e897951ffefc32eb09faee2243964a73284 --- D CreateAccountTestWiki.php M WikimediaIncubator.class.php M extension.json 3 files changed, 8 insertions(+), 65 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaIncubator refs/changes/41/383741/1 diff --git a/CreateAccountTestWiki.php b/CreateAccountTestWiki.php deleted file mode 100644 index aa4b2d7..0000000 --- a/CreateAccountTestWiki.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * If URL parameters "testwikiproject" and "testwikicode" are set - * on account creation form, set them as user preference. - * This can be used to work with links on other sites - * referring to the account creation form so users don't *have* to - * change their preferences (automatically is always better :p) - * - * @file - * @ingroup Extensions - * @author Robin Pepermans (SPQRobin) - */ - -class AutoTestWiki { - - /** - * @param UsercreateTemplate|UserloginTemplate &$template - * @return bool - */ - public static function onUserCreateForm( &$template ) { - global $wgRequest, $wmincProjects; - $projectvalue = strtolower( $wgRequest->getVal( 'testwikiproject', '' ) ); - $codevalue = strtolower( $wgRequest->getVal( 'testwikicode', '' ) ); - if ( WikimediaIncubator::validateLanguageCode( $codevalue ) - && isset( $wmincProjects[$projectvalue] ) - ) { - $template->set( 'header', - Html::hidden( 'testwiki-project', $projectvalue ) . - Html::hidden( 'testwiki-code', $codevalue ) - ); - } - return true; - } - - /** - * @param User $user - * @return bool - */ - public static function onAddNewAccount( $user ) { - global $wgRequest, $wmincProjects, $wmincPref; - $projectvalue = $wgRequest->getVal( 'testwiki-project' ); - $codevalue = $wgRequest->getVal( 'testwiki-code' ); - if ( WikimediaIncubator::validateLanguageCode( $codevalue ) - && isset( $wmincProjects[$projectvalue] ) - ) { - $user->setOption( $wmincPref . '-project', $projectvalue ); - $user->setOption( $wmincPref . '-code', $codevalue ); - $user->saveSettings(); - } - return true; - } -} diff --git a/WikimediaIncubator.class.php b/WikimediaIncubator.class.php index f785102..5fe3e8f 100644 --- a/WikimediaIncubator.class.php +++ b/WikimediaIncubator.class.php @@ -21,18 +21,6 @@ if ( $wmincExistingWikis === null ) { $wmincExistingWikis = $wgLocalDatabases; } - - if ( class_exists( MediaWiki\Auth\AuthManager::class ) && empty( $wgDisableAuthManager ) ) { - $wgAuthManagerAutoConfig['secondaryauth'] += [ - WikimediaIncubatorSecondaryAuthenticationProvider::class => [ - 'class' => WikimediaIncubatorSecondaryAuthenticationProvider::class, - 'sort' => 0, // non-UI secondaries should run early - ] - ]; - } else { - $wgHooks['UserCreateForm'][] = 'AutoTestWiki::onUserCreateForm'; - $wgHooks['AddNewAccount'][] = 'AutoTestWiki::onAddNewAccount'; - } } /** diff --git a/extension.json b/extension.json index edc9eb0..eb213ba 100644 --- a/extension.json +++ b/extension.json @@ -121,7 +121,6 @@ "WikimediaIncubator": "WikimediaIncubator.class.php", "SpecialMyMainPage": "SpecialMyMainPage.php", "TestWikiRC": "TestWikiRC.php", - "AutoTestWiki": "CreateAccountTestWiki.php", "SpecialRandomByTest": "SpecialRandomByTest.php", "InfoPage": "InfoPage.php", "ListUsersTestWiki": "ListUsersTestWiki.php", @@ -140,6 +139,14 @@ "localBasePath": "", "remoteExtPath": "WikimediaIncubator" }, + "AuthManagerAutoConfig": { + "primaryauth": { + "WikimediaIncubatorSecondaryAuthenticationProvider": { + "class": "WikimediaIncubatorSecondaryAuthenticationProvider", + "sort": 0 + } + } + }, "callback": "WikimediaIncubator::onRegistration", "Hooks": { "ContributionsToolLinks": "WikimediaIncubator::efLoadViewUserLangLink", -- To view, visit https://gerrit.wikimedia.org/r/383741 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bb89e897951ffefc32eb09faee2243964a73284 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaIncubator Gerrit-Branch: master Gerrit-Owner: Reedy <re...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits