diff --git a/README.md b/README.md index 3d230b1..6fed825 100644 --- a/README.md +++ b/README.md @@ -17,24 +17,24 @@ To use, the contents of the ForumSsoProvider directory need to be placed into ex All settings should be defined prior to calling `wfLoadExtension('ForumSsoProvider');` in your LocalSettings.php ### Path to Forum Software - $wgFSPath = '/path/to/smf/root/'; + $wgFSPPath = '/path/to/smf/root/'; ### Forum software. Supports smf2.0, smf2.1, elk1.0, elk1.1 $wgFSPSoftware = 'smf2.1'; # Optional LocalSettings -### Login Groups - Users in this group are signed into MediaWiki. Group 2 in SMF is a fake group relating to all users. +### Login Groups - Users in this group are signed into MediaWiki. SMF does not have a real group for "Regular" members, it is a pseudo group. Additionally, Local Moderators (Group ID 3) is a special group. Users are only in this group when they are on a board they have been granted moderator permissions on. If you do not specify this, users are granted permission to the wiki by default. If you specify this, users must be in the associated groups to have access to the wiki. $wgFSPAllowGroups = array(5); -### Deny Groups - Prevent users in these groups from being signed into MediaWiki, this is a deny group and takes over the login group. In SMF group 4 is the Newbie group. +### Deny Groups - Prevent users in these groups from being signed into MediaWiki, this is a deny group and takes over the login group. $wgFSPDenyGroups = array(4); ### Admin Groups - Users in these groups are granted sysop access in MediaWiki. - $wgFSPAdminGroups = array(1, 3); + $wgFSPAdminGroups = array(1, 2); ### Super Groups - Users in these groups are granted bureaucrat access in MediaWiki. @@ -44,10 +44,10 @@ All settings should be defined prior to calling `wfLoadExtension('ForumSsoProvid $wgFSPInterfaceGroups = array(1); -### Special Groups - An key-valued array of smf_group_id => mediawiki_group_name +### Special Groups - An key-valued array of {SMF Group ID} => {MediaWiki Group Name} $wgFSPSpecialGroups = array( - 3 => 'special', + 11 => 'Custom_Wiki_group', ); ### Ban checks - Enable checking against bans in SMF. If found it prevents access to MediaWiki. @@ -79,39 +79,85 @@ These settings are used by the legacy Auth_SMF.php. define('SMF_IN_WIKI', true); $wgSMFLogin = true; -### Login Groups - Users in this group are signed into MediaWiki. Group 2 in SMF is a fake group relating to all users. +### Login Groups - Users in this group are signed into MediaWiki. $wgSMFGroupID = array(2); -### Deny Groups - Prevent users in these groups from being signed into MediaWiki, this is a deny group and takes over the login group. In SMF group 4 is the Newbie group. +### Deny Groups - Prevent users in these groups from being signed into MediaWiki, this is a deny group and takes over the login group. $wgSMFDenyGroupID = array(4); ### Admin Groups - Users in these groups are granted sysop access in MediaWiki. - $wgSMFAdminGroupID = array(1, 3); + $wgSMFAdminGroupID = array(1, 2); -### Special Groups - An key-valued array of smf_group_id => mediawiki_group_name +### Special Groups - An key-valued array of {SMF Group ID} => {MediaWiki Group Name} $wgSMFSpecialGroups = array( - 3 => 'special', + 11 => 'Custom_Wiki_group', ); ### Forum Software Cookie. $wgCookieDomain = 'domain.tld'; -Troubleshooting +SMF Default Groups +--------------- +| Group ID | Group Name | Post Group | +| ---- | --------- | --- | +| 1 | Administrator | No | +| 2 | Global Moderator | No | +| 4 | Newbie | Yes | +| 5 | Jr. Member | Yes | +| 6 | Full Member | Yes | +| 7 | Sr. Member | Yes | +| 8 | Hero Member | Yes | + +Finding your SMF Group ID +--------------- +1. Navigate to the Admin Control Panel +2. Click on Membergroups +3. Click Modify on the group you are looking for. +4. In the address bar, you will see `group=####`, this number is the group id. + +Working with Arrays +--------------- +The configuration file uses basic PHP code. + +When you have a single member for the array, you simply just wrap it in the array statement + $code = array(1); + + +If you have 2 members that need to go into the array, use a comma to separate them. + $code = array(1,2); + +For strings, wrap them in quotes. SMF coding style recommends using single quotes unless necessary. Double quotes signal the PHP parser to use special handling, which might interpret variables and other logic inside the string. This is typically not necessary in the configuration. + $code = array('my string'); + +You may also see the shorthand square brackets to refer to arrays. This is valid as well, but not used in the configuration for simplificy. + $code = ['my string']; + +Extension Troubleshooting --------------- Set $wgDebugLogFile in your LocalSettings.php: - $wgDebugLogFile = "/some/private/path/mediawiki.log"; - + $wgDebugLogFile = "/some/private/path/MediaWiki.log"; + Search for ForumSessionProvider and it will tell you what it is thinking. This bloats pretty quickly, so you'll want to comment it out after you have resolved your problem. +Wiki Troubleshooting +--------------- +MediaWiki has built in methods for debugging it. If the extension is acting up and the debugging log is not providing information. Add the following to your LocalSettings.php. This should not be run in a production forum as it may expose sensitive details + + $wgShowExceptionDetails = true; + $wgShowSQLErrors = true; + $wgDebugDumpSql = true; + $wgShowDBErrorBacktrace = true; +Remove when you are done debugging. + ---- Getting New SMF Forks In ------------------------ @@ -120,3 +166,4 @@ If you are familiar with how your fork's authentication works, feel free to subm Issues or changes ------------------------ If an issue has occurred, please open a new issue. If you have a change, please submit a pull request. +