News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

MediaWiki SMF Bridge not working - No auth, portal removed...

Started by nyall, February 04, 2012, 08:43:36 AM

Previous topic - Next topic

Andre N

Try this out. Back up your other one first just in case
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

ups

I used this script and noticed a few quirks.

On my setup, it log in, but not with User data (it would just appear the IP). This was due two things:

I noticed that $smf_member_id = $user->getOption('smf_member_id'); would always return 0 even if the Option was set to something else. This made the code to fail the authentication.
By checking the source, Mediawiki will return the option default value if the option is set to Hidden (as it is in this extension).

Also, even if everything checked out, the user data from mediawiki user would never be loaded. I added.


if ($user->getID() == 0)
{
...
}
else
{
$user->loadFromDatabase();
$user->saveToCache();
}


andre nickatina version seems a bit different and I might try it out.

SleePy

I've updated the MediaWiki auth file.  The problem was I used $wgHiddenPrefs that apparently makes getOption always return 0 for the result.  I've removed those and the auth appears to work fine.

You can download the new one from the repo: https://github.com/SimpleMachines/smf-mw-auth
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Varsh

So far I've been reading through all of this quite a lot and I still unfortunately can't get this to work. So far these are the steps I've done:

  • Installed SMF v2.0.2
  • Installed MediaWiki v1.19
  • Downloaded the latest Auth_SMF and uploaded it to the extensions directory
  • Edited the LocalSettings by adding the extra code at the end
  • Uncommented $wgSMFLogin and $wgCookieDomain and set the $wgSMFPath
  • Uploaded the file and MediaWiki works, the forums works, but whatever I do MediaWiki just cannot see me logged in at all
Any steps I've missed or need to change? If I comment out $wgSMFLogin and $wgCookieDomain then my password isn't recognised.

Edit: Nevermind I didn't see the attachment Andre Nickatina had in his post till I posted, it works a treat. Only thing I noticed is that initially I got an error on top of the Wiki for line 873 but a forced refresh sorted that out and got rid of it. Also noticed that the only way to logout is via the forums, either way I'm happy now that it works. :)

pftq

Not sure what is different in the github version (1.14) but it wasn't letting mediawiki recognize I was logged into SMF.  Used the version Andre posted as well and it works fine here.

Edit: Tried the 1.14 version again and it's working fine now.  Just had a lot of logging in and out to get it working again.

Both versions seem to cause uncreated pages to throw 404 instead of the mediawiki message to create the page though.  Is anyone else getting this?

arthorg

Same as Varsh ans ptfq. The official repository version didn't work (SMF 2.0.2, MW 1.18), but the version posted by "Andre N" worked.

Advertisement: