SMF and MediaWiki Bridge

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

Previous topic - Next topic

Goss

So, I am so relieved to say that I finally got this working.  It ended up being a lot simpler than I thought it was.  >.>

Anyway, I now have a new issue I am trying to solve.  The bridge is working great.  However, I am trying to set it up so that only two specific usergroups can actually edit the wiki. 

I created a new usergroup for mediawiki called "Wiki Editor":
# This creates a new wiki user group called "Wiki Editor".
$wgGroupPermissions['Wiki Editor'] = $wgGroupPermissions['user'];


Then turned on the following code in LocalSettings.php:
# Require members to be a part of this SMF group(s) to login
# NOTE: Members of the SMF Administrator group are always able to login
$wgSMFGroupName = 'Wiki Editor';
$wgSMFGroupName = array('OOC', 'Moderator');


When this is active, I can log in just fine with my forum Admin account.  However, if I try and log in with any other account (including the groups above), then I get the following error:
QuoteUnable to find SMF group(s) set in LocalSettings.php!

Any ideas?

Goss

Oh, I figured it out.  I had multiple SMF membergroups called "Moderator", so it was getting confused.  I just renamed the one I needed and it's working now.

Arekay

I get this error when ever I go to the wiki:


Warning: Parameter 1 to AutoAuthenticateSMF() expected to be a reference, value given in /home/arekay/public_html/wiki/includes/Hooks.php on line 133


what does this mean and how can I fix it?

Paracelsus

Let me guess, you have PHP 5.3.x, right?

Arekay

Yes I have PHP 5.3.4, is that a problem?

Paracelsus

Quote from: Arekay on February 15, 2011, 07:38:53 PM
Yes I have PHP 5.3.4, is that a problem?

When I upgraded PHP 5.2.x to 5.3.4 that error came up. Found the solution in this post: http://www.simplemachines.org/community/index.php?topic=221622.msg2689257#msg2689257
(even if you don't have the line exactly as it says there, make sure you change it to function AutoAuthenticateSMF($user, &$result) ).

This simple edit worked for me. I've found out later that there are also other mediawiki extensions including mediawiki itself v1.13 -> v1.15 with compatibility problems with PHP 5.4.3 and I could fix some of them by just changing one or two characters like the ampersand "&").

Arekay


Arekay

Yea! I got a new error!


Fatal error: Call to undefined method User::setupSession() in /home/arekay/public_html/w/extensions/Auth_SMF.php on line 308

I've got 2.0RC5 and MediaWiki 18

Paracelsus

Quote from: Arekay on February 21, 2011, 03:41:29 PM
Yea! I got a new error!


Fatal error: Call to undefined method User::setupSession() in /home/arekay/public_html/w/extensions/Auth_SMF.php on line 308

I've got 2.0RC5 and MediaWiki 18

I use SMF 1.1.x and Mediawiki 1.13 so can't help you with that.

henrik1782

Quote from: Arekay on February 21, 2011, 03:41:29 PM
Yea! I got a new error!


Fatal error: Call to undefined method User::setupSession() in /home/arekay/public_html/w/extensions/Auth_SMF.php on line 308

I've got 2.0RC5 and MediaWiki 18

It seems that your path in Local Settings is not correct... If your forum is in /arekay and your Wiki in /arekay/w you have to set it like this

# Relative path to the forum directory from the wiki
# Do not put a trailing /
# Example: /public_html/forum and /public_html/wiki -> ../forum
$wgSMFPath = "..";
My favorite mods: Forum Firewall, httBL, MessagePreviewOnHover, BoardHover Mod, VB Style Board Index, Separate Replies and Views Column, Realtime clock by Joker, ENotify, Topic Solved.

henrik1782

Quote from: Arekay on February 21, 2011, 03:41:29 PM
Yea! I got a new error!


Fatal error: Call to undefined method User::setupSession() in /home/arekay/public_html/w/extensions/Auth_SMF.php on line 308

I've got 2.0RC5 and MediaWiki 18

It seems odd that you in a former post have your wiki in  /arekay/public_html/wiki

Warning: Parameter 1 to AutoAuthenticateSMF() expected to be a reference, value given in /home/arekay/public_html/wiki/includes/Hooks.php on line 133
My favorite mods: Forum Firewall, httBL, MessagePreviewOnHover, BoardHover Mod, VB Style Board Index, Separate Replies and Views Column, Realtime clock by Joker, ENotify, Topic Solved.

Arekay

Quote from: henrik1782 on February 25, 2011, 05:13:56 AM
It seems that your path in Local Settings is not correct... If your forum is in /arekay and your Wiki in /arekay/w you have to set it like this

# Relative path to the forum directory from the wiki
# Do not put a trailing /
# Example: /public_html/forum and /public_html/wiki -> ../forum
$wgSMFPath = "..";

I did have this wrong, I had $wgSMFPath = "../";
I fixed this, yet I still get the same error... any ideas?

Quote from: henrik1782 on February 25, 2011, 05:17:00 AM
It seems odd that you in a former post have your wiki in  /arekay/public_html/wiki

I decided to delete the wiki and start over, this time I put it in /w

Biology Forums

Could someone tell me how I can add a module to my main forum of the newest topic (article) added to the wiki - Kind of like a feed?

spinus

Hello everybody! Problem: wiki 1.16.2 and smf 2.0rc4
wiki - wiki.domain.org [nofollow]
smf - domain.org [nofollow]
use different bases
If I try login onto wiki, goes redirect to forum login form, logins ok but does'nt come back to wiki. Reloading wiki I see that I am not logged in. Reloading forum shows I logged onto forum only.

#$wgEnableParserCache = false;
#$wgCachePages = false;
$wgSMFPath = "../";
$wgSMFVersion = "2.0";
$wgSMFLogin = true;
$wgCookieDomain = 'www.wiki.domain.org';
$wgCookiePath = '/';
$wgCookieSecure = false; 
$wgSMFGroupName = 'Wiki Editor';
$wgSMFGroupName = array('Wiki Editor', 'Global Moderator');
#$wgSMFAdminGroupName = 'Wiki Admin';
#$wgSMFAdminGroupName = array('Wiki Admin', 'Global Moderator');
$wgAuth = new Auth_SMF();

Thanks

spinus

#314
It is ok, I should use independent cookies for subdomains in SMF settings and clear cookies in browser. It works, thanks.

homer87

Hello excuse me for my english.
I have installed the bridge but i have this error:

"Wiki has a problem

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

Can't contact the database server: Unknown error"

When disable the bridge, the error disappear.

Can anyone help me please?

Thanks.

Biology Forums

I installed the wiki to my main address biology-forums.com/wiki/ and it takes a long time to load; somewhat slow.

If I change the location to wiki.biology-forums.com (sub-address), would it increase the loading speed?

poveyjo

Hi,

Is it possible to rung this brodge across different domains?

eg mydomain.org/wiki [nofollow]
and
mydomain.com/forum

?

if so, how?  At the moment it logs into the forum but not the wiki

Biology Forums

Quote from: poveyjo on December 03, 2011, 04:41:40 PM
Hi,

Is it possible to rung this brodge across different domains?

eg mydomain.org/wiki
and
mydomain.com/forum

?

if so, how?  At the moment it logs into the forum but not the wiki

I tried this, but there is an issue with the logging in. It doesn't work across different domains. :-\

poveyjo

#319
Thanks Shuban...

Ok, I thought so.

Although now I've tried it with a brand new forum installation (1.15) on the same domain, and I get the same problem.
That is, the MW links point to SMF logon, but it doesn't log the user into the wiki also...

I'm using MW1.17 (with semantic mediawiki) and SMF 1.15.

Does anyone have this working with MW 1.17?

My Config:
(in auth_smf.php):
$wgHooks['UserLoadFromSession'][] = 'AutoAuthenticateSMF'; //fixed line

IN localsettings:

# If you experience the issue where you appear to be logged in
# eventhough you are logged out then disable the page cache.
#$wgEnableParserCache = false;
#$wgCachePages = false;

# SMF Authentication
# To get started you only need to configure wgSMFPath and wgSMFVersion.
# The rest of the settings are optional for advanced features.

# Relative path to the forum directory from the wiki
# Do not put a trailing /
# Example: /public_html/forum and /public_html/wiki -> ../forum
$wgSMFPath = "/forums";

# Set to the version of SMF you are using.
$wgSMFVersion = "1.1";
#$wgSMFVersion = "2.0";

# Use SMF's login system to automatically log you in/out of the wiki
# This will only work if you are using SMF database sessions (default).
# Make sure "Use database driven sessions" is checked in the
# SMF Admin -> Server Settings -> Feature Configuration section
# NOTE: Make sure to configure the wgCookeDomain below
$wgSMFLogin = true;

# Make "Enable local storage of cookies" is unchecked in the
# SMF Admin -> Server Settings -> Feature Configuration section
# www.domain.org/wiki [nofollow] and www.domain.org/forums [nofollow] -> www.domain.org [nofollow]
# wiki.domain.org [nofollow] and forums.doman.org [nofollow] -> .domain.org
$wgCookieDomain = 'www.peakbagging.org.nz';
#$wgCookiePath = '/'; // Optional, defaults to '/'
#$wgCookieSecure = false;  // Optional, only change on scheme mismatch

# Require members to be a part of this SMF group(s) to login
# NOTE: Members of the SMF Administrator group are always able to login
#$wgSMFGroupName = 'Wiki Editor';
#$wgSMFGroupName = array('Wiki Editor', 'Global Moderator');

# Grant members of this SMF group(s) wiki sysop privileges
# NOTE: These members must be able to login to the wiki
#$wgSMFAdminGroupName = 'Wiki Admin';
#$wgSMFAdminGroupName = array('Wiki Admin', 'Global Moderator');

# Load up the extension
require_once "$IP/extensions/Auth_SMF.php";
$wgAuth = new Auth_SMF();

Thanks

Advertisement: