整合phpbb3和mediawiki

mediawiki是1.11.0版本,phpbb3 rc7,整合起来也还是比较简单的。
下载整合插件,解开到extension目录下,然后修改LocalSettings.php文件,在最后添加一下内容,也可以参考其readme。

/*—————–[ Everything below this line. ]—————–*/

// 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)

$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’] = true; // This tells the plugin that the phpBB tables
// are in a different database then the wiki.
// The default settings is false.

/*-[NOTE: You only need the next four settings if you set $wgAuth_Config[‘UseExtDatabase’] to true.]-*/
// $wgAuth_Config[‘MySQL_Host’] = ‘host’; // 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_name’; // phpBB MySQL Database Name.

$wgAuth_Config[‘UserTB’] = ‘phpbb_users’; // Name of your PHPBB user table. (i.e. phpbb_users)
$wgAuth_Config[‘GroupsTB’] = ‘phpbb_groups’; // Name of your PHPBB groups table. (i.e. phpbb_groups)
$wgAuth_Config[‘User_GroupTB’] = ‘phpbb_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’] = ‘You need a phpBB account to login.‘; // 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.

然后还需要修改Auth_phpbb.php,查找

if (md5($password) == $faryMySQLResult[‘user_password’] && $this->isMemberOfWikiGroup($username))

替换为:

require_once $this->_PathToPHPBB . ‘includes/functions.php’;
if (phpbb_check_hash($password, $faryMySQLResult[‘user_password’]) && $this->isMemberOfWikiGroup($username))

最后要到论坛上建立对应的用户组,并添加用户。

参考:
1 http://www.mediawiki.org/wiki/Extension:PHPBB/Users_Integration


已发布

分类

来自

标签:

评论

《“整合phpbb3和mediawiki”》 有 1 条评论

  1. 美国主机 的头像

    那个mediawiki插件只能做到用phpbb的用户名登陆,要实现phpbb登陆后,mediawiki免登陆(one sign on)怎么做呢?博主有什么方法吗?

回复 美国主机 取消回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注