News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

SMF and MediaWiki Bridge

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

Previous topic - Next topic

rsw686

Quote from: drhamad on September 30, 2008, 04:00:44 PM
The only thing I'd comment on, and this is minor, is that if a permissions group specified in LocalSettings.php for edit access doesn't exist in SMF, the whole thing ceases to function.  It'd be nice if that wasn't true, but not a big deal since you can just create the group or delete it from LocalSettings

This was actually done on purpose. Otherwise you might not notice that the group name is invalid. I figured the group permissions weren't changed that often.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

surra

#141
hoi!

i had a working mediawiki 1.13 in http://tarbatu.org [nofollow] (with some users), installed smf 1.1.4 http://tarbatu.org/koda [nofollow] , upgraded it to 1.1.6 and added bridge files to wiki/smf and to mediawiki's localsettings.php
Quote#### SMF Authentication
#Snakehit (snakehit (at) gmail.com [nofollow])

# For all non-logged in users
$wgGroupPermissions['*']['createaccount']   = false; # This requires a user be logged into the wiki to make changes.
$wgGroupPermissions['*']['edit']            = false; # Specify who may create new accounts: 0 means no, 1 means yes

# Disable everything of caching, caching is boe for the login system.
$wgEnableParserCache = false;
$wgCachePages = false;

# Users can use the login function inside of the wiki to login.
$wgUseWikiLogin = false;

# This requires the link to SMF API.
$wgSMFPathAPI= "http://tarbatu.org/koda/smf_api.php [nofollow]";    # The smf_api.php file can be download from SMF website and must be placed in rootdir of your forum)
$wgSMFPathIndex= "http://tarbatu.org/koda/index.php [nofollow]";  # Full path to index.php file of SMF

// require the Auth_SMF.php
require_once 'http://tarbatu.org/extensions/Auth_SMF.php'; [nofollow]

$wgAuth = new Auth_SMF();
?>

now i have working smf in http://tarbatu.org/koda [nofollow] but mediawiki gives blank screen in http://tarbatu.org [nofollow] - where did i mistake?

ps when i try to logout from smf, i get error:
QuoteFatal error: Class 'User' not found in /home/tarbatuo/public_html/koda/Sources/LogInOut.php on line 452
world is mushroom forest

rsw686

Your quoted mediawiki settings are not the ones for my bridge. I think you have mine confused with another smf mediawiki bridge. Also my bridge links mediawiki to smf's user table, not the other way around like you want to do.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

surra

#143
is it impossible to use mediawiki-s users on smf?
so could mediawiki users have their userpages on mediawiki.
world is mushroom forest

drhamad

I'm having a problem where people (other than admins) cannot create a new mediawiki page.  What permission controls this?

Thanks!
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Paracelsus

Quote from: rsw686 on August 19, 2008, 09:12:37 AM
Quote from: Paracelsus on August 19, 2008, 08:11:27 AM
@ rsw686,

I've just updated mediawiki to 1.13 and the "AutoAuthenticate" hook stopped working.

Reading mediawiki's manual I found out that this hook is no longer supported in 1.13, being replaced by "UserLoadFromSession" instead. I then replaced the above expression by this one in Auth_SMF.php and the workaround seem to have solved the problem, but I'd like to know if further changes need to be made.

I will have to look into this. 1.13 must have been just released.

Hi rsw686,

Can you try to address this question once more? I've made our wiki public and would like to know if the changes I did are good enough.

BTW, the wiki is in: www.forumscp.com/wiki and working perfectly so far. ;)

rsw686

Quote from: Paracelsus on October 08, 2008, 02:34:17 PM
Hi rsw686,

Can you try to address this question once more? I've made our wiki public and would like to know if the changes I did are good enough.

BTW, the wiki is in: www.forumscp.com/wiki and working perfectly so far. ;)

I looked into this and actually updated my forum's wiki to the 1.13 version. The only change required is the one you suggested.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Paracelsus

Quote from: rsw686 on October 08, 2008, 06:25:36 PM
Quote from: Paracelsus on October 08, 2008, 02:34:17 PM
Hi rsw686,

Can you try to address this question once more? I've made our wiki public and would like to know if the changes I did are good enough.

BTW, the wiki is in: www.forumscp.com/wiki and working perfectly so far. ;)

I looked into this and actually updated my forum's wiki to the 1.13 version. The only change required is the one you suggested.

Thanks. ;)

drhamad

Quote from: drhamad on October 08, 2008, 12:15:02 AM
I'm having a problem where people (other than admins) cannot create a new mediawiki page.  What permission controls this?

Thanks!

In addition to this, I was also wondering about a Deny permission.  In other words, like in SMF, is there a permission that no matter if they have permission to edit in another group, they still won't be able to if they're in a Deny group?
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Paracelsus

Quote from: drhamad on October 10, 2008, 02:57:35 PM
Quote from: drhamad on October 08, 2008, 12:15:02 AM
I'm having a problem where people (other than admins) cannot create a new mediawiki page.  What permission controls this?

Thanks!

In addition to this, I was also wondering about a Deny permission.  In other words, like in SMF, is there a permission that no matter if they have permission to edit in another group, they still won't be able to if they're in a Deny group?

I think you can block the user using mediawiki's interface.

Abavagada

I installed Mediawiki 1.6 before, along with this bridge, to SMF 1.1.6. It worked fine. Today, I totally removed that version of mediawiki, and installed the most recent version, 1.13, and reinstalled this bridge. For some reason, I can't get the bridge to work. It will go to the login page of the forum correctly, but it isn't seeing any logins coming from the SMF, not even the admin. The only login it is accepting is the admin that was set up with the media wiki.

As far as I can tell, I made all the proper changes.. uploading the SMF_Auth file and copying the part of that into LocalSettings.php, and setting the paths.

Any idea on what I could be missing?


Paracelsus

Quote from: Paracelsus on September 15, 2008, 10:41:08 AM
- Put the talk/discussion pages directing to a new topic with the page name as subject and in a specified board. I've seen this integration in several wikis from "wikidot".

I managed to do a part of it with this code in SkinTemplate.php. Basically, it creates a tab that links directly to a new topic with the wikipage title as the topic subject:

global $wgTitle ;
$content_actions['forum_section'] = array(
'class' => $section == 'new'?'selected':false,
'text' => "Discussão no Fórum",
'href' => 'http://www.xxxx.com/index.php?action=post;board=xxxx;subject='. str_replace("_", " ", $wgTitle->getDBkey())
);


The problem with this is that one can't see if the topic already exists (so that one would post a reply instead of a new topic). Any ideas to improve this?

Abavagada

Quote from: Abavagada on October 19, 2008, 05:58:22 PM
I installed Mediawiki 1.6 before, along with this bridge, to SMF 1.1.6. It worked fine. Today, I totally removed that version of mediawiki, and installed the most recent version, 1.13, and reinstalled this bridge. For some reason, I can't get the bridge to work. It will go to the login page of the forum correctly, but it isn't seeing any logins coming from the SMF, not even the admin. The only login it is accepting is the admin that was set up with the media wiki.

As far as I can tell, I made all the proper changes.. uploading the SMF_Auth file and copying the part of that into LocalSettings.php, and setting the paths.

Any idea on what I could be missing?

Never mind.. I just read Paracelsus's post on the previous page about the hook change, and that did the trick. Thanks.


Oldiesmann

Can someone running 1.13 explain exactly what they did to make the auto login thing work? I've replaced two instances of AutoAuthenticate with UserLoadFromSession and the wiki still treats me as a guest.

rsw686

Quote from: Oldiesmann on October 27, 2008, 10:12:45 PM
Can someone running 1.13 explain exactly what they did to make the auto login thing work? I've replaced two instances of AutoAuthenticate with UserLoadFromSession and the wiki still treats me as a guest.

You only need to replace one instance of AuthAuthenticate in the Auth_SMF function.

Find this block of code
function Auth_SMF()
{
global $wgSMFLogin, $wgHooks;

// Integrate with SMF login / logout?
if(isset($wgSMFLogin) && $wgSMFLogin)
{
$wgHooks['AutoAuthenticateSMF'][] = 'AutoAuthenticateSMF';
$wgHooks['UserLoginForm'][] = 'UserLoginFormSMF';
$wgHooks['UserLogout'][] = 'UserLogoutSMF';
}

// Always redirect registration to SMF.
$wgHooks['UserCreateForm'][] = 'UserRegisterSMF';

// Connect to the database.
$this->connect();
}


Replace
$wgHooks['AutoAuthenticateSMF'][] = 'AutoAuthenticateSMF';

With
$wgHooks['UserLoadFromSession'][] = 'AutoAuthenticateSMF';
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Oldiesmann

Ok. I must not have uploaded the file after I made the change. I fixed it now.

The other file I was editing was from a different SMF bridge.

Gamez

I am getting a "Check to make sure $wgSMFPath is correctly set in LocalSettings.php!" What do I set it to when..
/public_html/forum and /public_html/folder1/wiki ?

Piggie

Hi,

I was thinking about the issue of underscores in usernames. I could contact members with an underscore, and change their name to something else, and stop underscore being used in future signups. However, what about allowing underscore in usernames in Mediawiki? Can Mediawiki be addapted to allow underscores in user names without causing other problems? Or is this issue caused by something else?

rsw686

My bridge deals with underscores in user names. Have a read through the comments in the bridge file for more information.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Piggie

Maybe I've misunderstood something, but if Mediawiki was adapted to allow underscores in usernames, then wouldn't this resolve this issue, without any searching of the SMF username table for occurences of the same name with and without underscore? I'd prefer a solution that did not rely upon SMF usernames being changed. As it stands, it seems just a little untidy, and might be a pain for very large forums (not really an issue for me).

Advertisement: