Comments (18)
Part of the problem was fixed by changing constructor of ForumAuthManager
to
public function __construct( $params = [] ) {
$loadBalancer = \MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancer();
parent::__construct( $loadBalancer, $params );
}
Now there are no more fatal errors but auth does not work.
from smf-mw-auth.
The set of errors I've got after the fix for ForumAuthManager
:
[error] [YudeZR7klsZtlQCu63XC_wAAABY] /index.php?title=Special:UserLogin&returnto=Main+Page PHP Notice: Undefined index: boardurl
#0 /home/path1/public_html/site1/extensions/ForumSsoProvider/ForumProvider/smf2.1.php(43): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /home/path1/public_html/site1/extensions/ForumSsoProvider/ForumSsoProvider.php(161): ForumSoftwareProvidersmf21->getRedirectURL(string, string, boolean)
#2 /home/path1/public_html/site1/extensions/ForumSsoProvider/ForumSsoProvider.php(140): ForumSsoProvider->doRedirect(string, boolean)
#3 /home/path1/public_html/site1/includes/HookContainer/HookContainer.php(338): ForumSsoProvider::onSpecialPageBeforeExecute(SpecialUserLogin, NULL)
#4 /home/path1/public_html/site1/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#5 /home/path1/public_html/site1/includes/HookContainer/HookRunner.php(3638): MediaWiki\HookContainer\HookContainer->run(string, array)
#6 /home/path1/public_html/site1/includes/specialpage/SpecialPage.php(664): MediaWiki\HookContainer\HookRunner->onSpecialPageBeforeExecute(SpecialUserLogin, NULL)
#7 /home/path1/public_html/site1/includes/specialpage/SpecialPageFactory.php(1378): SpecialPage->run(NULL)
#8 /home/path1/public_html/site1/includes/MediaWiki.php(315): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#9 /home/path1/public_html/site1/includes/MediaWiki.php(912): MediaWiki->performRequest()
#10 /home/path1/public_html/site1/includes/MediaWiki.php(563): MediaWiki->main()
#11 /home/path1/public_html/site1/index.php(53): MediaWiki->run()
#12 /home/path1/public_html/site1/index.php(46): wfIndexMain()
#13 {main}
[error] [YudeZR7klsZtlQCu63XC_wAAABY] /index.php?title=Special:UserLogin&returnto=Main+Page PHP Notice: Undefined index: auth_secret
#0 /home/path1/public_html/site1/extensions/ForumSsoProvider/ForumProvider/smf2.1.php(45): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /home/path1/public_html/site1/extensions/ForumSsoProvider/ForumSsoProvider.php(161): ForumSoftwareProvidersmf21->getRedirectURL(string, string, boolean)
#2 /home/path1/public_html/site1/extensions/ForumSsoProvider/ForumSsoProvider.php(140): ForumSsoProvider->doRedirect(string, boolean)
#3 /home/path1/public_html/site1/includes/HookContainer/HookContainer.php(338): ForumSsoProvider::onSpecialPageBeforeExecute(SpecialUserLogin, NULL)
#4 /home/path1/public_html/site1/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#5 /home/path1/public_html/site1/includes/HookContainer/HookRunner.php(3638): MediaWiki\HookContainer\HookContainer->run(string, array)
#6 /home/path1/public_html/site1/includes/specialpage/SpecialPage.php(664): MediaWiki\HookContainer\HookRunner->onSpecialPageBeforeExecute(SpecialUserLogin, NULL)
#7 /home/path1/public_html/site1/includes/specialpage/SpecialPageFactory.php(1378): SpecialPage->run(NULL)
#8 /home/path1/public_html/site1/includes/MediaWiki.php(315): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#9 /home/path1/public_html/site1/includes/MediaWiki.php(912): MediaWiki->performRequest()
#10 /home/path1/public_html/site1/includes/MediaWiki.php(563): MediaWiki->main()
#11 /home/path1/public_html/site1/index.php(53): MediaWiki->run()
#12 /home/path1/public_html/site1/index.php(46): wfIndexMain()
#13 {main}
from smf-mw-auth.
I haven't tested at all with 1.38. The later error looks like it isn't including the SMF Settings.php file properly or a global issue. Is your path to the SMF settings.php correct?
from smf-mw-auth.
I think I've got it.
Doc says that path to forum have to be put into $wgFSPath
but the script actually looks into $wgFSPPath
.
from smf-mw-auth.
Ok, just a typo in the documentation. I will get it updated when I can. I will have to branch the repo because I suspect the changes for 1.38 are not compatible with the current LTS, which is what this is targeting.
from smf-mw-auth.
Ok. I've got it.
After the fix for $wgFSPPath
I've started to get new exception:
[exception] [YunnygFuDDxUnc8-Nd_bbAAAAAQ] /index.php?title=Main_Page Error: Call to undefined method User::isLoggedIn()
#0 /home/path1/public_html/site1/includes/session/SessionManager.php(525): ForumSsoProvider->provideSessionInfo(WebRequest)
#1 /home/path1/public_html/site1/includes/session/SessionManager.php(247): MediaWiki\Session\SessionManager->getSessionInfoForRequest(WebRequest)
#2 /home/path1/public_html/site1/includes/WebRequest.php(837): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
#3 /home/path1/public_html/site1/includes/session/SessionManager.php(168): WebRequest->getSession()
#4 /home/path1/public_html/site1/includes/Setup.php(878): MediaWiki\Session\SessionManager::getGlobalSession()
#5 /home/path1/public_html/site1/includes/WebStart.php(93): require_once(string)
#6 /home/path1/public_html/site1/index.php(44): require(string)
#7 {main}
[session] User::loadFromSession called before the end of Setup.php
#0 /home/path1/public_html/site1/includes/user/User.php(1891): User->load()
#1 /home/path1/public_html/site1/includes/user/User.php(2529): User->getId()
#2 /home/path1/public_html/site1/includes/user/UserOptionsManager.php(644): User->isRegistered()
#3 /home/path1/public_html/site1/includes/user/UserOptionsManager.php(496): MediaWiki\User\UserOptionsManager->getCacheKey(User)
#4 /home/path1/public_html/site1/includes/user/UserOptionsManager.php(147): MediaWiki\User\UserOptionsManager->loadUserOptions(User, integer)
#5 /home/path1/public_html/site1/includes/user/User.php(2355): MediaWiki\User\UserOptionsManager->getOption(User, string, NULL, boolean)
#6 /home/path1/public_html/site1/includes/context/RequestContext.php(450): User->getOption(string)
#7 /home/path1/public_html/site1/includes/language/Message.php(384): RequestContext->getLanguage()
#8 /home/path1/public_html/site1/includes/language/Message.php(1491): Message->getLanguage()
#9 /home/path1/public_html/site1/includes/language/Message.php(968): Message->fetchMessage()
#10 /home/path1/public_html/site1/includes/language/Message.php(1071): Message->format(string)
#11 /home/path1/public_html/site1/includes/exception/MWExceptionRenderer.php(228): Message->text()
#12 /home/path1/public_html/site1/includes/exception/MWExceptionRenderer.php(160): MWExceptionRenderer::msg(string, string)
#13 /home/path1/public_html/site1/includes/exception/MWExceptionRenderer.php(76): MWExceptionRenderer::reportHTML(Error)
#14 /home/path1/public_html/site1/includes/exception/MWExceptionHandler.php(107): MWExceptionRenderer::output(Error, integer)
#15 /home/path1/public_html/site1/includes/exception/MWExceptionHandler.php(202): MWExceptionHandler::report(Error)
#16 /home/path1/public_html/site1/includes/exception/MWExceptionHandler.php(170): MWExceptionHandler::handleException(Error, string)
#17 [internal function]: MWExceptionHandler::handleUncaughtException(Error)
#18 {main}
[ForumSessionProvider] Database loaded, attempting to load forum member.
[ForumSessionProvider] Querying Forum Provider for member data
[ForumSessionProvider] Forum member found, verifying cookie of 1
[ForumSessionProvider] Member found and verified, verifying access.
[ForumSessionProvider] Cleanup name "MyUsername" using method smf
[ForumSessionProvider] Cleanuped name "MyUsername"
[ForumSessionProvider] Attempting to locate a valid user in MediaWiki or create one if it does not exist
Any clue on what is the cause?
from smf-mw-auth.
It seems that User::isLoggedIn()
method was removed in Mediawiki 1.37:
* User->isLoggedIn(), deprecated since 1.36, now emits deprecation warnings. Use
the method it wraps, User->isRegistered(), instead.
The last content for isLoggedIn
was this:
public function isLoggedIn() {
return $this->isRegistered();
}
So isLoggedIn
just have to be replaced by isRegistered
from smf-mw-auth.
Next missing method is User::getUserEffectiveGroups()
/**
* Get the list of implicit group memberships this user has.
* This includes all explicit groups, plus 'user' if logged in,
* '*' for all accounts, and autopromoted groups
*
* @deprecated since 1.35 Use UserGroupManager::getUserEffectiveGroups instead
*
* @param bool $recache Whether to avoid the cache
* @return string[] internal group names
*/
public function getEffectiveGroups( $recache = false ) {
return MediaWikiServices::getInstance()
->getUserGroupManager()
->getUserEffectiveGroups( $this, $this->queryFlagsUsed, $recache );
}
from smf-mw-auth.
Missing method User::setOption()
:
/**
* Set the given option for a user.
*
* You need to call saveSettings() to actually write to the database.
*
* @param string $oname The option to set
* @param mixed $val New value to set
* @deprecated since 1.35 Use UserOptionsManager::setOption instead
*/
public function setOption( $oname, $val ) {
MediaWikiServices::getInstance()
->getUserOptionsManager()
->setOption( $this, $oname, $val );
}
from smf-mw-auth.
I'm not sure if that's directly useful but there is modified versions of extension files. With them things run fine on MediaWiki 1.38.2. It's likely that you may want to re-format changes to provide better match for your code style.
ForumSsoProvider_patch_for_1.38.zip
I assume these changes are needed for any from 1.35 and newer
from smf-mw-auth.
The recent PR #21 should resolve these up. It works on 1.38, but I'm targeting it at 1.39 as I've only been targeting LTS releases.
from smf-mw-auth.
from smf-mw-auth.
I put 1.38+ in the readme. I will bump it to say 1.39 when they release it. Assuming that 1.39 will have no significant changes, it should work.
from smf-mw-auth.
from smf-mw-auth.
WIll do. I don't mind master following the non LTS, but I think it makes sense to branch out for any LTS. If somebody has time to follow the non LTS versions and update the extension, then great.
from smf-mw-auth.
@jdarwood007 I've tried #21 with MediaWiki 1.39.1 (LTS) and SMF 2.1.3 and it gives me the following errors:
MediaWiki internal error.
Original exception: [b2d045ac594ebc0db0634074] /wiki/Main_Page TypeError: MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::__construct(): Argument #2 ($userOptionsLookup) must be of type MediaWiki\User\UserOptionsLookup, array given, called in /var/www/MY_FOLDER/public_html/w/extensions/ForumSsoProvider/ForumAuthManager.php on line 35
Backtrace:
from /var/www/MY_FOLDER/public_html/w/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php(73)
#0 /var/www/MY_FOLDER/public_html/w/extensions/ForumSsoProvider/ForumAuthManager.php(35): MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider->__construct()
#1 /var/www/MY_FOLDER/public_html/w/vendor/wikimedia/object-factory/src/ObjectFactory.php(247): ForumAuthManager->__construct()
#2 /var/www/MY_FOLDER/public_html/w/vendor/wikimedia/object-factory/src/ObjectFactory.php(152): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec()
#3 /var/www/MY_FOLDER/public_html/w/includes/auth/AuthManager.php(2487): Wikimedia\ObjectFactory\ObjectFactory->createObject()
#4 /var/www/MY_FOLDER/public_html/w/includes/auth/AuthManager.php(2533): MediaWiki\Auth\AuthManager->providerArrayFromSpecs()
#5 /var/www/MY_FOLDER/public_html/w/includes/auth/AuthManager.php(1026): MediaWiki\Auth\AuthManager->getPrimaryAuthenticationProviders()
#6 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(631): MediaWiki\Auth\AuthManager->canCreateAccounts()
#7 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(561): SkinTemplate->useCombinedLoginLink()
#8 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(1262): SkinTemplate->buildPersonalUrls()
#9 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(790): SkinTemplate->buildContentNavigationUrlsInternal()
#10 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(229): SkinTemplate->getPortletsTemplateData()
#11 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinMustache.php(88): SkinTemplate->getTemplateData()
#12 /var/www/MY_FOLDER/public_html/w/skins/Vector/includes/SkinVector.php(450): SkinMustache->getTemplateData()
#13 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinMustache.php(58): MediaWiki\Skins\Vector\SkinVector->getTemplateData()
#14 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(177): SkinMustache->generateHTML()
#15 /var/www/MY_FOLDER/public_html/w/includes/OutputPage.php(2874): SkinTemplate->outputPage()
#16 /var/www/MY_FOLDER/public_html/w/includes/MediaWiki.php(922): OutputPage->output()
#17 /var/www/MY_FOLDER/public_html/w/includes/MediaWiki.php(562): MediaWiki->main()
#18 /var/www/MY_FOLDER/public_html/w/index.php(50): MediaWiki->run()
#19 /var/www/MY_FOLDER/public_html/w/index.php(46): wfIndexMain()
#20 {main}
Exception caught inside exception handler: [b2d045ac594ebc0db0634074] /wiki/Main_Page RuntimeException: Duplicate specifications for id MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider (classes MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider and MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider)
Backtrace:
from /var/www/MY_FOLDER/public_html/w/includes/auth/AuthManager.php(2491)
#0 /var/www/MY_FOLDER/public_html/w/includes/auth/AuthManager.php(2533): MediaWiki\Auth\AuthManager->providerArrayFromSpecs()
#1 /var/www/MY_FOLDER/public_html/w/includes/auth/AuthManager.php(1026): MediaWiki\Auth\AuthManager->getPrimaryAuthenticationProviders()
#2 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(631): MediaWiki\Auth\AuthManager->canCreateAccounts()
#3 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(561): SkinTemplate->useCombinedLoginLink()
#4 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(1262): SkinTemplate->buildPersonalUrls()
#5 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(790): SkinTemplate->buildContentNavigationUrlsInternal()
#6 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(229): SkinTemplate->getPortletsTemplateData()
#7 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinMustache.php(88): SkinTemplate->getTemplateData()
#8 /var/www/MY_FOLDER/public_html/w/skins/Vector/includes/SkinVector.php(450): SkinMustache->getTemplateData()
#9 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinMustache.php(58): MediaWiki\Skins\Vector\SkinVector->getTemplateData()
#10 /var/www/MY_FOLDER/public_html/w/includes/skins/SkinTemplate.php(177): SkinMustache->generateHTML()
#11 /var/www/MY_FOLDER/public_html/w/includes/OutputPage.php(2874): SkinTemplate->outputPage()
#12 /var/www/MY_FOLDER/public_html/w/includes/exception/MWExceptionRenderer.php(183): OutputPage->output()
#13 /var/www/MY_FOLDER/public_html/w/includes/exception/MWExceptionRenderer.php(102): MWExceptionRenderer::reportHTML()
#14 /var/www/MY_FOLDER/public_html/w/includes/exception/MWExceptionHandler.php(131): MWExceptionRenderer::output()
#15 /var/www/MY_FOLDER/public_html/w/includes/exception/MWExceptionHandler.php(248): MWExceptionHandler::report()
#16 /var/www/MY_FOLDER/public_html/w/includes/MediaWiki.php(584): MWExceptionHandler::handleException()
#17 /var/www/MY_FOLDER/public_html/w/index.php(50): MediaWiki->run()
#18 /var/www/MY_FOLDER/public_html/w/index.php(46): wfIndexMain()
#19 {main}
Any ideas?
from smf-mw-auth.
Seems like they did a few more changes. They both sound like it should be simple to fix. Will try when I get time.
from smf-mw-auth.
@berianwilliams
I can't reproduce the second one. But the first one looks like it can be fixed in ForumAuthManager.php
Find:
public function __construct( /*array*/ $params = [] ) {
$loadBalancer = \MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancer();
parent::__construct( $loadBalancer, $params );
}
Replace:
public function __construct( /*array*/ $params = [] ) {
$loadBalancer = \MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancer();
$userOptionsLookup = \MediaWiki\MediaWikiServices::getInstance()->getUserOptionsLookup();
parent::__construct( $loadBalancer, $userOptionsLookup, $params );
}
from smf-mw-auth.
Related Issues (16)
- $user->setupSession(); to wfSetupSession(); HOT 2
- Public View on MW 1.27.1 HOT 5
- $wgAuth is deprecated in 1.27 HOT 5
- Error with smcFunc in latest version HOT 1
- MW login not working HOT 3
- Errors in MW 1.31.1 HOT 2
- SMF 2.1 | Mediawiki 1.35.1 HOT 5
- Login trouble with Mediwiki 1.36.1 HOT 5
- compat auth not working HOT 4
- Problem Authenticating to MW 1.40.0 from SMF 2.1.4 HOT 15
- People not being removed from Wiki groups HOT 3
- can't assign bureaucrat role anyhow HOT 3
- Cannot login? HOT 2
- 500 Internal Server Error with v1.24.0 HOT 5
- User not being logged in proper HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smf-mw-auth.