News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF MediaWiki integration released

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

Previous topic - Next topic

JohnMcCreedy

Seems like he hadn't applied the fix. Just did it and it works like a charm. Thanks for the help :)

donkenoji

$wgSMFSpecialGroups = array(
  // SMF Group ID => Wiki group name,
1 => 'bureaucrat';
85 => 'administrator';
84 => 'editor';
);


I'm not a coder; anyone know the proper syntax for this? By default it was one line; what's the proper way to string multiple groups?

donkenoji

Quote from: donkenoji on March 29, 2013, 09:13:31 AM
$wgSMFSpecialGroups = array(
  // SMF Group ID => Wiki group name,
1 => 'bureaucrat';
85 => 'administrator';
84 => 'editor';
);


I'm not a coder; anyone know the proper syntax for this? By default it was one line; what's the proper way to string multiple groups?

NVM!  Answered my question, it's commas!
$wgSMFSpecialGroups = array(
  // SMF Group ID => Wiki group name,
1 => 'bureaucrat',
85 => 'administrator',
84 => 'editor',
);

donkenoji

#103
Quote from: donkenoji on March 29, 2013, 09:16:48 AM
NVM!  Answered my question, it's commas!
$wgSMFSpecialGroups = array(
  // SMF Group ID => Wiki group name,
1 => 'bureaucrat',
85 => 'administrator',
84 => 'editor',
);


Oddly enough; none of my permissions are transferring over.  They are getting authenticated; but even sysop isn't being given (with the native change in the LocalSettings.php).

Any thoughts?

Warning: in_array() expects parameter 2 to be array, null given in /var/zpanel/hostdata/zadmin/public_html/the-bwc_com/wiki/extensions/Auth_SMF.php on line 879

emanuele

#104
# Grant members of this SMF group(s) wiki sysop privileges
# NOTE: These members must be able to login to the wiki
#$wgSMFAdminGroupID = array(1, 3);

So, most likely you didn't initialize $wgSMFAdminGroupID in localSettings.php

ETA: groups are updated every 900 seconds (15 minutes), so if you visited a wiki page and then changed something (e.g. member group of the user), you will not see anything for some time.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

donkenoji

Quote from: emanuele on March 29, 2013, 11:24:08 AM
# Grant members of this SMF group(s) wiki sysop privileges
# NOTE: These members must be able to login to the wiki
#$wgSMFAdminGroupID = array(1, 3);

So, most likely you didn't initialize $wgSMFAdminGroupID in localSettings.php

ETA: groups are updated every 900 seconds (15 minutes), so if you visited a wiki page and then changed something (e.g. member group of the user), you will not see anything for some time.

You were right, that was the issue.  My final problem then is, I've created a custom group in the wiki called 'Editor'. 
$wgSMFSpecialGroups = array(
  // SMF Group ID => Wiki group name,
   1 => 'bureaucrat',
   85 => 'sysop',
   86 => 'Editor',
);

When users sign in and are in the 'Editor' group on the forums; they show up as 'editor' without a link (aka no group) on the wiki.  Is my syntax proper?

emanuele

Is "Editor" or "editor" the MW group name? (not sure if it is important)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

donkenoji

#107
Integration:
$wgSMFSpecialGroups = array(
  // SMF Group ID => Wiki group name,
1 => 'bureaucrat',
85 => 'sysop',
86 => 'Editor',
);


Perms:
# Editors #
$wgGroupPermissions['Editor']['edit'] = true;
$wgGroupPermissions['Editor']['read'] = true;
$wgGroupPermissions['Editor']['import']           = true;
$wgGroupPermissions['Editor']['importupload']     = true;
$wgGroupPermissions['Editor']['move']             = true;
$wgGroupPermissions['Editor']['move-subpages']    = true;
$wgGroupPermissions['Editor']['move-rootuserpages'] = true;
$wgGroupPermissions['Editor']['protect']          = true;
$wgGroupPermissions['Editor']['upload']           = true;
$wgGroupPermissions['Editor']['reupload']         = true;
$wgGroupPermissions['Editor']['reupload-shared']  = true;
$wgGroupPermissions['Editor']['upload_by_url']    = true;
$wgGroupPermissions['Editor']['browsearchive']    = true;
$wgGroupPermissions['Editor']['noratelimit']      = true;
$wgGroupPermissions['Editor']['movefile']         = true;


Case is matching.

Update: now editor isn't showing at all; like that group can't be seen.  sysop and Admin are both porting fine however.
Update 2: Now it is showing, just not as a link.

Image for reference:

emanuele

Well, that's the same here too:
http://wiki.simplemachines.org/smf/Special:ActiveUsers
it is probably related to how MW handle groups...dunno...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

donkenoji

Quote from: emanuele on March 30, 2013, 11:13:49 AM
Well, that's the same here too:
http://wiki.simplemachines.org/smf/Special:ActiveUsers
it is probably related to how MW handle groups...dunno...

Okay, I've realized that I can force the permission update by having the users update their preferences.  Is the update for all users not working automatically?
// $wgHooks['UserSaveOptions'][] = 'wfProfileSMFID';


I'm not sure it's related, but for some reason, the only way I can get perms on users is to have them update their preferences on their individual account.

Biology Forums

Quote from: emanuele on March 15, 2013, 02:23:32 PM
I *think* two things are not that difficult to fix:
Code (find) Select
public function modifyUITemplate(&$template)
Code (replace with) Select
public function modifyUITemplate( &$template, &$type )
and:
Code (find) Select
public function initUser( $user, $autocreate = false)
Code (replace with) Select
public function initUser( &$user, $autocreate = false)
you can start with that and see if it at least remove those two errors.

This appeared to fix the problem I was having on mediawiki 1.16 and SMF 1.1.18.

Thanks :D

Biology Forums

By the way, was the issue with the underscore ever fixed?

I had a member name: member__ (with two underscores)... and when they tried to edit something, mediawiki went crazy lol

In addition, if a member has the name: member_name, their name shows: member name.

Arantor

The whole underscore-to-space thing is how MediaWiki works with everything since spaces don't work properly in URLs but underscores do - and everything in MediaWiki revolves around that.
Holder of controversial views, all of which my own.

donkenoji

Warning: session destroy(): trying to destroy unitialized session in /path_to_wiki/extensions/auth_smf.php on line 311

A few users are reporting this error and are being told they must login.  They have active sessions with the SMF boards; however, still can't login.  The extension is creating accounts and they're being listed on the userlist.  Any thoughts on this one?

emanuele

Do they have by chance similar *username* (not real names)? (and with similar I mean spaces/underscores, "strange" letters, etc.)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Biology Forums

Yes, the same usernames but, where there is an underscore in the SMF registered name, it becomes a space in mediawiki.

donkenoji

#116
Warning: session_destroy(): Trying to destroy uninitialized session in /path_to_wiki/extensions/Auth_SMF.php on line 311

Any thoughts on this one?  Users report that they won't get logged in.

From the auth file:
// Destory their session.
$wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________");
$old_session = session_name(isset($wgSessionName) ? $wgSessionName : $wgCookiePrefix . '_session');
session_destroy();

emanuele

Quote from: emanuele on April 01, 2013, 12:43:02 PM
Do they have by chance similar *username* (not real names)? (and with similar I mean spaces/underscores, "strange" letters, etc.)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

donkenoji

Quote from: emanuele on April 02, 2013, 02:23:18 PM
Quote from: emanuele on April 01, 2013, 12:43:02 PM
Do they have by chance similar *username* (not real names)? (and with similar I mean spaces/underscores, "strange" letters, etc.)
Negative, I'm one of the individuals effected today and it's a simple name (no non alpha characters and no spaces).  It appears to be limited to those with Admin rights (though don't quote me on that).

donkenoji

Update; not just administrators; just a coincidence that the two first effected were admins.

Warning: session_destroy(): Trying to destroy uninitialized session in /path_to_wiki/extensions/Auth_SMF.php on line 311

Advertisement: