|
Cookbook /
AuthPhpBB2Summary: Use phpBB2 user authentication for PmWiki page edit protection and author name
Version: 1.0 (05 March 2007)
Prerequisites:
Status: Stable
Maintainer: Smc
Discussion: AuthPhpBB2-Talk
Questions answered by this recipe
DescriptionAuthPhpBB2 permits user authentication via phpBB2 forum software to be used to edit protect PmWiki pages. Additionally your phpBB2 username is used as the PmWiki edit author name. Additionally, you can augment page permissions with PmWiki's in-built page attributes e.g. add a second level page edit and/or read protection e.g. perhaps edit protect the site sidebar and readonly protect the site blocklist from normal forum users. It is anticipated that this recipe will work on any 2.x version of PmWiki or phpBB2 however the author has only specifically tested this on pmwiki-2.2.0-beta19 and phpBB2 2.0.22. This recipe consists of two changes; firstly a cookbook plugin called auth_phpbb2.php for PmWiki and secondly a variant of the session.php file from the phpBB2 distribution. Please follow the procedure below to install this recipe. Additionally see the notes section below for design information and recommended future enhancements (should someone want to extend this). An example of PmWiki and phpBB2 integration in action is over at Enginuity (http://www.enginuity.org). Note that page edit actions are not shown unless you have a user account or know the PmWiki administration password to override. Please feel free to request a forum login. Once you login for the forum, a page edit icon will appear on each Wiki page. Additionally the Author field will be set to your phpBB2 username. InstallationThe following instructions assume you have installed PmWiki and phpBB2 under the same web root e.g. /pmwiki and /forums. Also please pay attention to the phpBB cookie path setting below - with out it the cookie will not be presented to pmwiki.
Configuration - phpBB2 forum
Configuration - PmWiki
Design NotesThe idea is to extend the existing phpBB2 session cookie set during the authentication stage. I basically add the username to this cookies' serialised information. I use the existance of the cookie to set an authentication flag. This flag is used within this recipe to check if we have edit permission. Additionally PmWiki's $Author variable is set to your username extracted from extended the phpBB2 cookie. session.php is from the phpBB-2.0.22 distribution. I'm adding a new 'username' element to the existing cookie array which gets serialised. auth_phpbb2.php is based on PmWiki's core authuser.php. I basically override PmWiki's '$AuthFunction' with my own variant. It checks for the phpBB2 authentication cookie which is configured via the '$phpBB2cookie' variable. If the cookie is found and we can extract the username set from above then we set PmWiki's '$Author' variable accordingly. Future Enhancements
Release Notes
See Also
ContributorsCommentsSee discussion at AuthPhpBB2-Talk User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |