News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF and MediaWiki Bridge

Started by rsw686, February 08, 2008, 08:28:51 PM

Previous topic - Next topic

rsw686

Quote from: ecpcorran on February 24, 2008, 10:32:37 AM
Well, to an extent it seems..  It successfully logs out, but sometimes the wiki has the appearance that I'm still logged in until I refresh the page or click a few links.


..I'm not sure how to duplicate the issue reliably, but it seems to happen primarily if I log out immediately after logging in.   Sometimes it happens, sometimes it doesn't.  I'm thinking it may be browser cache related.


Edit:  Yep, it seems to be the cache.  Setting $wgCachePages = false; in LocalSettings.php fixes my problem.  : )

I'll look into it. I have

$wgEnableParserCache = false;
$wgCachePages = false;

set on the wiki that I've been working on the extension with. I'll disable those lines and test. It would be nice to have the cache enabled on a live site as I think it would speed things up.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

rsw686

What browser are you using? I logged in and out multiple times, going to different pages, and making edits. Each time when logging out the top menu bar went back to what it looks like for a guest. What do you do to cause it to happen?
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

ecpcorran

It doesn't seem to happen with IE7.

I'm using Firefox 2.0.0.12 on 64-bit Vista.  The website is running on a (mostly) default install of Apache2. 

These are the other cache related parameters in my config file:
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();

I've created a test account and set $wgCachePages back to its default.  You can test it in Firefox if you wish:

Login info has been sent via PM


All I'm doing is logging in and immediately logging right out.  You might need to do it a couple of time for it to occur.

Aside from randomly altering the link with a random variable (i.e. ?title=Main_Page&board=redirect&rand=Af25 )  I'm not sure what else the extension itself could do fix this unless you have some ability to pass cache related header information to/through smf's logout...


I'm personally fine with setting $wgCachePages to false though I could see why a large site might want this problem resolved without that parameter.  It is mostly an annoyance rather than a security risk as I am logged out, it just doesn't immediately reflect it.

rsw686

Interesting, happened the first time I logged in and back out. I have never seen that before. I'm using Firefox 3 Beta 3 on XP. I'm assuming this is hosted on linux? If so which distro, apache, and php version? Feel free to PM me the info. I'll send you a PM with what I'm using. I have a VMware box so if I have free time I'll probably test it out.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

rsw686

I released version 1.9 that included those changes. When the wgSMFLogin is disabled it uses the first registered user when there is a conflict with underscores and spaces. However I wasn't doing the same thing when wgSMFLogin was enabled. It would allow both users to post. Since is was storing data in the tables with the _ in the username certain wiki features (like contribs) wouldn't show any revisions for that user. I fixed this by applying the same logic and only allowing the first registered user to be auto logged in. Then I format the username to the wiki standards.

Anyway if you had wgSMFLogin set to enabled and a user with an underscore posted you can fix the database by running the following SQL statements. Be sure to fill in your username and set the correct prefix for the tables. By default media wiki uses no prefix.

UPDATE mw_user SET user_name = 'john smith' WHERE user_name = 'john_smith'
UPDATE mw_revision SET rev_user_text = 'john smith' WHERE rev_user_text = 'john_smith'
UPDATE mw_recentchanges SET rc_user_text = 'john smith' WHERE rc_user_text = 'john_smith'
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Slack

Hi Ryan,  nice bridge!   :)

Does it work for Post Count based groups?  I'm trying to allow forum users who have a minimum number of posts to automatically become Wiki Editors and cannot seem to get it to work if I use post count based groups to do it..... ??

Thanks!
Slack


rsw686

Quote from: Slack on March 05, 2008, 06:51:51 PM
Does it work for Post Count based groups?  I'm trying to allow forum users who have a minimum number of posts to automatically become Wiki Editors and cannot seem to get it to work if I use post count based groups to do it..... ??

Nice catch. Yeah this would be useful. It just took a small change to make it work for post based groups. You can download version 1.10 from http://wgnrs.dynalias.com/smf/Auth_SMF.php

Change Log
- Enable the register redirection hook when wgSMFLogin is enabled.
- Enable support for post based groups. Reported by Slack on SMF.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Slack


rsw686

Let me know how that works for you. The one thing to keep in mind is that it allows only that post group. For example consider the default SMF post groups

Newbie 0
Jr. Member 50
Full Member 100
Sr. Member 250
Hero Member 500

If I wanted people with 100 posts or above to be able to log in to the wiki you would have to define the following

$wgSMFGroupName = array('Full Member', 'Sr. Member', 'Hero Member');
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Slack

Right, not a problem for me since I wasn't using Post Groups -- until now that is, it works perfectly.

Thanks again,
Slack

Paracelsus

rsw686,

Can you explain me what are the differences between your bridge and this one - http://www.simplemachines.org/community/index.php?topic=195978.0

Because I would like to choose one of them and I can't figure out what's different between them.

Slack

Not to answer for Ryan, but he explains the difference at the very top of this topic.

I tried Snakehits, which I'm sure is a very good bridge, but it is more complicated as it involves installing a number of files.  I couldn't get it to work on first installation, so I un-installed.  I'm sure with patience I could have gotten it going.  It was just easier to install Ryan's bridge and the support - if you read through this thread - has been excellent.

Paracelsus

Quote from: Slack on March 06, 2008, 10:10:43 AM
Not to answer for Ryan, but he explains the difference at the very top of this topic.

I tried Snakehits, which I'm sure is a very good bridge, but it is more complicated as it involves installing a number of files.  I couldn't get it to work on first installation, so I un-installed.  I'm sure with patience I could have gotten it going.  It was just easier to install Ryan's bridge and the support - if you read through this thread - has been excellent.

You're absolutely right... stupid me :P

rsw686

Slack, thanks for the compliments. This reminded me that I should update the first post in this thread.

Paracelsus, if you already gave it a read through take note that I fixed the login/logout redirection issue. I also added the following

"The bridge also supports SMF user names with underscores. MediaWiki converts underscores to spaces which causes authentication problems with almost all other bridges. I developed a work around by checking for the first registered SMF user name with spaces or underscores. It is very unlikely that two SMF users will have the same name like john_smith and john smith. If they do you'll need to change the username of the later registered SMF user."

That is one of the main features which sets my bridge apart. I can guarantee a number of your users have underscores in their user names.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

mynewusername

Can we get a simplified 'dummy' version of this

Download X, X...

Put X, X...

Do X, X...

Make Tab X, X...

Thanks

Slack

There are no tabs, have you installed MediaWiki?

To install:

Copy and paste from Ryans link above and name the file Auth_SMF.php

Upload that file to your extensions folder.

Copy and paste the LocalSettings options portion of the above file to your LocalSettings.php located in your root wiki folder.

Change those settings to your preferences... which includes a call to the file in your extensions folder.

Upload the updated LocalSettings.php file.

You're in business.


rsw686

1. Install SMF
2. Install MediaWiki.
3. Place the file in the wiki/extensions directory.
4. Copy/paste the configuration for the top of the extension file into the wiki configuration file.

The comments in the extension configuration are fairly explanatory. If you don't understand a specific part ask.

You will now have a working integration. However, like other integrations, this only deals with the authentication part. It is up to you to modify the themes on the forum ad wiki to add links/style as needed.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts


rsw686

Quote from: JoshieDaMan on March 23, 2008, 12:28:56 AM
It's showing all text? Not a file to download.

http://wgnrs.dynalias.com/smf/Auth_SMF.php

You just have to right-click and select Save Link As (Firefox). I'm sure IE has a similar option. PHP files are text anyway.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

JoshieDaMan

Do I need to download the software for wiki? Or just upload Auth_SMF to a certain folder?

Advertisement: