Advertisement:

Author Topic: SMF MediaWiki integration released  (Read 189230 times)

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,963
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
SMF MediaWiki integration released
« on: December 05, 2011, 11:40:48 PM »
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
G+

Offline wilowterra

  • Semi-Newbie
  • *
  • Posts: 44
    • BLURAYTEAM.COM
Re: SMF MediaWiki integration released
« Reply #1 on: December 06, 2011, 12:11:17 AM »
Great!!!

Offline Kryzen

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,683
  • Gender: Male
Re: SMF MediaWiki integration released
« Reply #2 on: December 06, 2011, 04:48:56 AM »
Good news :) Still need to find out how it works though :P

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,589
Re: SMF MediaWiki integration released
« Reply #3 on: December 06, 2011, 12:17:03 PM »
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

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 781
  • Gender: Male
Re: SMF MediaWiki integration released
« Reply #4 on: December 07, 2011, 05:10:07 AM »
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:
Code: [Select]
// 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)

Offline Joshua Dickerson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,669
  • Gender: Male
    • joshuaadickerson on LinkedIn
Re: SMF MediaWiki integration released
« Reply #5 on: December 08, 2011, 09:01:51 AM »
It doesn't work with 1.1 AFAIK and we won't be making it work with it.

Thanks for the advice.

Nope.
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?

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,963
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: SMF MediaWiki integration released
« Reply #6 on: December 08, 2011, 12:27:50 PM »
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.

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:
Code: [Select]
// 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.

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
G+

Offline taniss

  • Newbie
  • *
  • Posts: 1
Re: SMF MediaWiki integration released
« Reply #7 on: December 08, 2011, 01:00:04 PM »
Excellent news! Thanks for this  ;D
« Last Edit: December 22, 2011, 09:14:10 PM by taniss »

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 781
  • Gender: Male
Re: SMF MediaWiki integration released
« Reply #8 on: December 08, 2011, 01:11:13 PM »
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.

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,963
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: SMF MediaWiki integration released
« Reply #9 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:
Code: [Select]
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
G+

Offline GravuTrad

  • Senior Translator
  • SMF Hero
  • *
  • Posts: 8,490
  • Gender: Male
  • One of the french SMF translators
Re: SMF MediaWiki integration released
« Reply #10 on: December 08, 2011, 05:32:44 PM »
Supercool! Thanks!
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.

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 781
  • Gender: Male
Re: SMF MediaWiki integration released
« Reply #11 on: December 09, 2011, 03:30:30 AM »
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:
Code: [Select]
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?).

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 781
  • Gender: Male
Re: SMF MediaWiki integration released
« Reply #12 on: December 09, 2011, 04:00:10 AM »
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:
Code: [Select]
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! ;)

Offline Shuban

  • SMF Hero
  • ******
  • Posts: 2,553
    • Free Homework Help
Re: SMF MediaWiki integration released
« Reply #13 on: December 10, 2011, 01:15:00 AM »
Had been waiting for this for ages, but now that I have bridged my own (and am quite satisfied), thanks anyways!

Excellent work.

Offline Kraken

  • Semi-Newbie
  • *
  • Posts: 47
Re: SMF MediaWiki integration released
« Reply #14 on: December 27, 2011, 03:49:01 PM »
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)
« Last Edit: December 27, 2011, 03:53:24 PM by Kraken »

Offline live627

  • Developer
  • SMF Hero
  • *
  • Posts: 4,225
  • Gender: Male
  • Cat: Destroy!
    • live627 on Facebook
    • @live627 on Twitter
    • livemods
Re: SMF MediaWiki integration released
« Reply #15 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
I'm a morning person. I stay up until the morning.


Offline Eudemon

  • Sr. Member
  • ****
  • Posts: 802
  • An Anime Fan
    • KumaKuni
Re: SMF MediaWiki integration released
« Reply #17 on: January 01, 2012, 12:03:32 AM »
amazing!

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 781
  • Gender: Male
Re: SMF MediaWiki integration released
« Reply #18 on: January 03, 2012, 10:24:12 AM »
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.

Offline SebaS

  • Jr. Member
  • **
  • Posts: 300
  • Gender: Male
  • SMF Friend :P
Re: SMF MediaWiki integration released
« Reply #19 on: January 08, 2012, 08:25:46 PM »
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)