Extension:PHPBB/Users Integration

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Auth_phpBB

Release status: stable

Implementation User identity, Database
Description Links MediaWiki's user table to phpBB's.
Author(s) Nicholas Dunnaway Talk
Version 3.0.3 (2008-03-03)
MediaWiki 1.11.x
License GPL
Download php|uber.leet
Read Me
Change log
Example Source
Hooks used

UserLoginForm
UserLoginComplete
UserLogout

Warning Warning:  This extension may not work with 1.12.x


This extension links MediaWiki to phpBB's user table for authentication, and disallows the creation of new accounts in MediaWiki. Users must then log in to the wiki with their phpBB account.

Contents

[edit] Installation

[edit] Extension

The extension requires PHP5, MySQL 4 or 5, MediaWiki 1.11.x and phpBB3. If you need help, log in at uber.leetphp.com and select 'Support' on the main menu.

  1. Download the extension (download, view source code).
  2. Add the code below to the bottom of LocalSettings.php.
  3. Make a new phpBB group called Wiki. If you set $wgPHPBB_UseWikiGroup to true, only users in the Wiki group can edit MediaWiki.
// PHPBB User Database Plugin. (Requires MySQL Database)
require_once './extensions/Auth_phpBB.php';
 
$wgAuth_Config = array(); // Clean.
 
$wgAuth_Config['WikiGroupName'] = 'Wiki';       // Name of your PHPBB group
                                                // users need to be a member
                                                // of to use the wiki. (i.e. wiki)
                                                // This can also be set to an array 
                                                // of group names to use more then 
                                                // one. (ie. 
                                                // $wgAuth_Config['WikiGroupName'][] = 'Wiki';
                                                // $wgAuth_Config['WikiGroupName'][] = 'Wiki2';
                                                // or
                                                // $wgAuth_Config['WikiGroupName'] = array('Wiki', 'Wiki2');
                                                // )
 
$wgAuth_Config['UseWikiGroup'] = true;          // This tells the Plugin to require
                                                // a user to be a member of the above
                                                // phpBB group. (ie. wiki) Setting
                                                // this to false will let any phpBB
                                                // user edit the wiki.
 
$wgAuth_Config['UseExtDatabase'] = false;       // This tells the plugin that the phpBB tables
                                                // are in a different database then the wiki.
                                                // The default settings is false.
 
//$wgAuth_Config['MySQL_Host']        = 'localhost';      // phpBB MySQL Host Name.
//$wgAuth_Config['MySQL_Username']    = 'username';       // phpBB MySQL Username.
//$wgAuth_Config['MySQL_Password']    = 'password';       // phpBB MySQL Password.
//$wgAuth_Config['MySQL_Database']    = 'database';       // phpBB MySQL Database Name.
 
$wgAuth_Config['UserTB']         = 'phpbb3_users';       // Name of your PHPBB user table. (i.e. phpbb_users)
$wgAuth_Config['GroupsTB']       = 'phpbb3_groups';      // Name of your PHPBB groups table. (i.e. phpbb_groups)
$wgAuth_Config['User_GroupTB']   = 'phpbb3_user_group';  // Name of your PHPBB user_group table. (i.e. phpbb_user_group)
$wgAuth_Config['PathToPHPBB']    = '../phpbb3/';         // Path from this file to your phpBB install.
 
// Local
$wgAuth_Config['LoginMessage']   = '<b>You need a phpBB account to login.</b><br /><a href="' . $wgAuth_Config['PathToPHPBB'] .
                                   'ucp.php?mode=register">Click here to create an account.</a>'; // Localize this message.
$wgAuth_Config['NoWikiError']    = 'You are not a member of the required phpBB group.'; // Localize this message.
 
$wgAuth = new Auth_phpBB($wgAuth_Config);     // Auth_phpBB Plugin.

[edit] Known issues

[edit] Usernames rules

MediaWiki does not follow the same user naming conventions as phpBB, so there may be problem if someone uses an invalid username. Although all MediaWiki usernames are valid in phpBB, some phpBB usernames are not valid in MediaWiki. For example, MediaWiki does not allow the '[]' bracket symbols.

The problem can be circumvented by installing a phpBB extension to restrict MediaWiki-incompatible characters in phpBB. The Restrict Username mod (beta) can do this.

Instead of installing the phpBB MOD, you can set Limit username chars to Alphanumeric only in the User registration settings of phpBB3.

[edit] Problems with not sharing a database

Some users experience an error when phpBB and MediaWiki are in different databases, while other users have no problem doing so. It's possible that this may be related to non-English software, which is common to users reporting the error. For more information, see the php|uber.leet forums.

[edit] Change log

  • Release 3.0.3
    • Fixed a potential SQL injection security hole.
    • Added support for multiple Wiki Groups.
  • Release 3.0.2
    • Now works with and requires phpBB3.
    • Now works with and requires MW 1.11.x
    • Now requires PHP5.
    • Uses phpBB3 username case folding methods.
    • Uses phpass for password hashing.
    • When the user is not in the "Wiki" group the user now sees a MediaWiki error that says so.
    • When the user is not found in the phpBB user database they now see a MediaWiki error asking them to register.
    • Added a link to phpBB's register page from the login screen.
    • Plug-in now uses MediaWiki Hooks.
  • Release 2.7
    • Fixed a potential SQL injection security hole.
  • Release 2.6
    • Fixed a login bug where MW was displaying an error the first time a user logged into it.
    • Now works with MW 9.2
  • Release 2.5
    • I made a change to the MySQL connection that might fix some of the issues people have been having .
  • Release 2.4
    • Better MySQL error reporting. More solid MySQL Query calls.
  • Release 2.3
    • phpBB usernames with an apostrophe in them will now work.
  • Release 2.2
    • Fixed a bug that was printing a SQL statment when called.
  • Release 2.1
    • Fixed a bug that was not letting preferences be saved.
  • Release 2.0
    • Works with MediaWiki 1.5.x
    • Fixed the dup name issues. The 1.5 release of MediaWiki added a new function to check for the correct casing of a name before adding it to the wiki database.
    • I test user names with a space in them and they seem to work fine too.
    • Added support for phpBB and the wiki being on two different servers/databases.
    • With the new release of MediaWiki 1.5, I was able to disable some template stuff.
  • Release 1.9
    • Now auto detects MySQL version and uses the correct query.
    • Ver 1.9 will work on both MySQL 4.0.x and 4.1.x
  • Release 1.7
    • Added the code to allow the admin to disable the phpBB wiki group requirement.
  • Release 1.5
    • MediaWiki forces all usernames into a first letter uppercase the rest lower case. (gotroot becomes Gotroot) This is ok until you have a user who has an uppercase letter in the middle of their name. (RetroFit becomes Retrofit) This can cause a problem when trying to Auth with the phpBB user table. I do not have a fix for this. (FIXED)

[edit] Community Contributions

Here are some contributions the community has made for this plug-in. They are custom changes that are not part of the plug-ins default code. If you have problems with the custom code below please contact the authors of those sections.

[edit] phpBB Version 3

Add stuff here.

Personal tools