• Welcome to Simple Machines Community Forum. Please login or sign up.
September 22, 2021, 11:23:53 PM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


SMF MediaWiki integration released

Started by SleePy, December 05, 2011, 11:40:48 PM

Previous topic - Next topic

SleePy

Simple Machines is proud to announce that we are releasing the integration used for the Simple Machines Wiki.  This integration has been adapted from the original by Ryan Wagoner.  Ryan's original work specified no license;  however he has been kind enough to give us permission to redistribute his work.  We have released this work under the BSD 3 clause license in hopes others may continue to improve this integration.

Our reasons for modification were quite simple.  First and most importantly, we wanted to reduce the required resources to make the integration compatible with a large, active forum. Secondly we attempted to improve the user integration to ensure protection of the accounts.

By protecting the account, we hope to avoid duplicate names by ensuring that they are not possible. As well we hope to be able to match wiki names to SMF user accounts using their account id from our SMF community forum.

The most important part was ensuring that the authentication would not demand too many resources.  We have improved the authentication to cache queries that the auth uses to communicate with SMF.  So far this has proved successful and kept our servers happy.

In addition, we have have improved the ability of the integration to add users to groups based on their access on SMF.  This has allowed users such as our translators to be automatically added to the appropriate translators group,  which greatly reduces work loads and reduces human error.

By releasing this authentication file, we hope to encourage others to use and improve our work and give back to the community.  We have chosen github because it makes it simple to allow anyone to fork the work, develop their own improvements and features, and submit pull requests for their changes.


You can find the SMF MediaWiki authentication at https://github.com/SimpleMachines/smf-mw-auth
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf


Robert.

Good news :) Still need to find out how it works though :P

Angelina Belle

The README file tells you where to put the files, and which settings to use.
Just follow the instructions, and you'll be bridging your SMF and wikimedia immediately.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Paracelsus

Nice!

Questions and Issues:

1. Does it work with SMF 1.1.x? I couldn't find any indication on this.

2. I doubt this bridge will be able to work with MW 1.18, since they've changed the hook $user->setupSession(); to wfSetupSession();. Maybe you'll want tho change this piece of code:
// Go ahead and log 'em in
$user->setupSession();
$user->setCookies();


3. Does this bridge accepts "strange characters" like á à § ç ã on the username? (the last bridge didn't accept them)

Joshua Dickerson

It doesn't work with 1.1 AFAIK and we won't be making it work with it.

Thanks for the advice.

Nope.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

SleePy

Quote from: Paracelsus on December 07, 2011, 05:10:07 AM
1. Does it work with SMF 1.1.x? I couldn't find any indication on this.
It does not, I removed all support for SMF 1.1 in the code.  You are welcome to fork it and provide backwards capabilities though.  SMF 2.0 is the stable line while 1.1 is the obsolete.  We are still patching SMF 1.1 for security issues, but otherwise 2.0 is the main stable branch.

Quote from: Paracelsus on December 07, 2011, 05:10:07 AM
2. I doubt this bridge will be able to work with MW 1.18, since they've changed the hook $user->setupSession(); to wfSetupSession();. Maybe you'll want tho change this piece of code:
// Go ahead and log 'em in
$user->setupSession();
$user->setCookies();

Ok, I opened up an issue report on it.  When I get time, I will look into this: https://github.com/SimpleMachines/smf-mw-auth/issues/1
I think thats one of my notes I had wrote down though for upgrading our wiki to the new release.

Quote from: Paracelsus on December 07, 2011, 05:10:07 AM
3. Does this bridge accepts "strange characters" like á à § ç ã on the username? (the last bridge didn't accept them)
If MW supports it, the bridge should.  My memory from the time of setting up the wiki here, says that by default MediaWiki is using latin1 tables and not utf8.  So to support them you should just have to convert the wiki to utf8.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

taniss

December 08, 2011, 01:00:04 PM #7 Last Edit: December 22, 2011, 09:14:10 PM by taniss
Excellent news! Thanks for this  ;D

Paracelsus

I don't think it's as simple as "just converting the wiki to utf8", since my wiki is 100% utf8 and it sitll doesn't accept those characters in the username (though I'm using the "old" bridge, so I don't know if it's a bridge or MW thing).

It's a pity that the bridge doesn't work for 1.1.x but I understand your point.

SleePy

There shouldn't be to much work in getting to work on the older version.  Mostly if not all should be just changing the database fields to match SMF 1.1 fields.  I think all the other code should support 1.1 just fine.

I haven't heard any complaints from our international users about this.  However SMF I know makes sure to set the character settings when it first starts up.  So if it isn't working, its most likely because the connection to the SMF database is using latin and needs the query to tell it to read as utf8.  Something such as:

SET NAMES utf8


Would need to be ran after the connection to the SMF database is made.  I am not 100% sure though, my expertise in character sets is not the best :D
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

GravuTrad

On a toujours besoin d'un plus petit que soi! (Petit!Petit!)


Think about Search function before posting.
Pensez à la fonction Recherche avant de poster.

Paracelsus

Quote from: SleePy on December 08, 2011, 04:21:41 PM
There shouldn't be to much work in getting to work on the older version.  Mostly if not all should be just changing the database fields to match SMF 1.1 fields.  I think all the other code should support 1.1 just fine.

I haven't heard any complaints from our international users about this.  However SMF I know makes sure to set the character settings when it first starts up.  So if it isn't working, its most likely because the connection to the SMF database is using latin and needs the query to tell it to read as utf8.  Something such as:

SET NAMES utf8


Would need to be ran after the connection to the SMF database is made.  I am not 100% sure though, my expertise in character sets is not the best :D

This might seem a stupid question to you but... how do you change the database fields to match SMF 1.1? I mean, in a pratical way, since I don't know which ones were changed from 1.1 to 2.0 (do you guys happen to have any tool for this?).

Paracelsus

Nevermind Sleepy, I suceeded with your tip about the "set names" to uft8 in the 1.1 compatible SMF_Auth. ;D

I used an example of a Wordpress + Mediawiki bridge where they used this:
mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER_SET utf8");


and it worked quite ok when placing it after the query that does the connection to SMF.

Problem solved, many thanks! ;)

Biology Forums

Had been waiting for this for ages, but now that I have bridged my own (and am quite satisfied), thanks anyways!

Excellent work.

Kraken

December 27, 2011, 03:49:01 PM #14 Last Edit: December 27, 2011, 03:53:24 PM by Kraken
I tried this bridge, but i am getting "password error" message every time i am trying to login from MW (the password is correct everytime btw, MW: 1.18, SMF:2.0.1)

live627



Eudemon


Paracelsus

Quote from: live627 on December 27, 2011, 11:04:44 PM
I created a new fork for SMF 1.1 compatibility: https://github.com/live627/smf-mw-auth

Can't make it work... I get a: "Unable to view external table." error.

SebaS

don't work :(

Deprecated:  Call-time pass-by-reference has been deprecated in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\wiki\extensions\Auth_SMF.php on line 265

i can't login in mediawiki. (the user don't exist)

Advertisement: