Wednesday, September 23, 2009

phpBB forums -> Joomla's ccboard & auth integration

I've been working with LanOC ( http://www.lanoc.org ), a large gamer group from Van Wert, to help them convert their present website which runs mainly off of phpBB with several items like Wordpress integrated. Lately they've decided to migrate to the Joomla CMS ( preview of new site at ( http://test.lanocreviews.com/ ) ), and after looking at that for a while, I am giving serious consideration to moving FWGamers as well. LanOC's admin has been extremely fun to work with, he's getting a migration for free and I've been getting advice on running larger parties.

That aside, anyone who has used phpBB before knows that the only headache along the way is converting the users. LanOC had over 400 user accounts (only 370ish active from what I can see), and you can bet at that size, they didn't want to tell everyone to just go enroll again or come up with a password migration scheme.

I proposed developing a sort of bridge, but one they could eventually move off of, not something they would need to keep installed forever. Mostly the reason for that was I didn't want to have to change my code every time Joomla decided to update their core authentication. What I came up with is something that will first check and see when someone goes to log in if the user already has a Joomla password set up, if they do, it just skips my code & runs like normal. However, if the Joomla password field is blank, I take the password supplied (it's in clear text at this point since the user just typed it) and compute the phpBB hash using some functions I cobbled together and modified from the phpBB source code. I then connect to the old phpBB database and attempt to find the user record there. Assuming it exists, I just compare the computed hash with the database. If they match, I take the cleartext password and run it through the standard Joomla encrypter and update the Joomla user record. At that point I just re-read the Joomla user record & then fall through to the existing Joomla logic.

Other bridges out there for phpBB -> Joomla seem to go in a direction that doesn't really make sense to me, other than if you were trying to supply multiple UI choices to access your CMS environment (which still makes no sense... just choose 1 and provide good themes). Basically they disregard authenticating against the Joomla database and just go straight to phpBB. Any user updates that happen occur in phpBB, not Joomla (unless phpBB doesn't have the appropritate field being updated). Those integration packages are very nicely done, but I just feel it's better to do as close as possible to a 100% migration.

The result is, over the next 6 months or so, LanOC's users can seamlessly migrate themselves to their new site and then totally remove my custom modification as well as delete the phpbb_users table (that's the only table I need access to). Anyone who hasn't logged in for 6 months (password in Joomla user's table would be empty) could be given a random password and the next time they try to log in could go through the password reset procedure.

Additionally I helped with some UI enhancements to their new site. It looks & functions 100% like what they want it to, now. There are a few things I would change up personally but think overall it is worlds better than what they have now.

If anyone needs a phpBB -> Joomla conversion and is looking at using the ccboard forums, I can send you my conversion package. It converts users, categories, forums, topics, posts, attachments, private messages (assuming you have the "community" Joomla extension). It does not convert the groups currently because it's quick and easy to convert those manually. The conversion itself is database agnostic, just change the DSN string to whatever database you're using and it will work. The authentication piece I custom coded, however, is coded for MySQL. With only one query being done, though, it could easily be changed.

Now 1 more project to complete, then back to working on my game .... :-)

No comments:

Post a Comment