Kunena / com_kunenaimporter

Import component for Kunena on Joomla
https://www.kunena.org
10 stars 14 forks source link

phpBB3 support #5

Closed fxstein closed 13 years ago

fxstein commented 13 years ago

Initial support for phpBB 3.x based forums.

Convert:

mahagr commented 13 years ago

Next thing is to find out if all BBCode gets converted and is working in Kunena. I think I saw some issues in inline attachments, for example..

What is still totally missing is user creation for Joomla. It's a tricky part as there's a lot to consider. It's not needed if user has had rokBridge for long time as all users should already be in Joomla. Unfortunately passwords can also be stored into phpBB3, so switching off rokBridge authentication plugin may not be a good idea, depending on where user has registered/changed his password...

Currently I store user mapping into jos_kunenaimporter_users, which also contains phpBB3 password.

Password hash check is described in phpBB3/includes/functions.php: phpbb_check_hash(), _hash_crypt_private() and _hash_encode64() if we want to add plugin for phpBB3 authentication. It works for all phpBB3 passwords, but phpBB2 passwords may need some extra work, which is described in phpBB3/includes/auth/auth_db.php. Basically phpBB2 passwords are encoded by using md5(utf8_to_cp1252(addslashes($password))).

fxstein commented 13 years ago

I got an idea for that: We should create all the Joomla users but assign a random secret password to them. Basically create users that cannot be logged in through Joomla.

Next we add an authentication plugin with the migrator that we install as part of the migrator and set its position to -1000 - or check that is is the very first.

In there we can check on login, whether the users is a new user coming from a phpBB migration (against our jos_kunenaimporter_users table). If so we can run the phpBB3 algorithm to check the password, also the phpBB2 algorithm. If we get a matching password, we redirect to a change password page, let the user enter the new password twice and remove the user from our migration table (jos_kunenaimporter_users) and be done with it.

That way we can have a complete end2end migration without the need for rokBridge or similar solutions.

fxstein commented 13 years ago

... or this could go into the login module we provide ...

fxstein commented 13 years ago

Took a look at the Joomla authentication plugin. This is the easiest way: fork the Joomla authentication plugin and create a Kunena authentication plugin.

IF a user comes in that is in the jos_kunenaimporter_users table, we check against the phpBB password string (first phpBB3, if fail then phpBB2). If either of them matches, we store the provided password through the Joomla encryption in jos_users, delete the user from the jos_kunenaimporter_users table (might be a soft delete - e.g. flag) and report back a successful login.

That way all passwords would automatically convert with every first login of a user that comes in.

mahagr commented 13 years ago

Yes, to get passwords to work, we should do just that. With one exception: I would just remove password from the jos_kunenaimporter_users table and keep rest of the information as it could be useful later on. For example that map can be used to change mapped joomla user if there have been wrong guesses.

fxstein commented 13 years ago

New Issue to track the plugin work: https://github.com/Kunena/com_kunenaimporter-1.6/issues/8