Im in the process of setting up a Spree shopping cart on an existing site which uses a phpbb forum for storing all users and logging in etc. I wanted the existing users of the site to be able to purchase from the shopping cart area without having to go through another sign up process and have 2 sets of usernames and passwords so iv created a Spree extension called spree-phpbb-auth.
The extension looks for the phpbb session cookie and looks it up in the forum database, if the user is unknkown to the spree application, a user will be created within Spree in the background. The standard Spree authentication system is then used to set that users session up to declare them as being logged in. It overwrites the existing login /logout/register/edit my account actions so that they redirect to the phpbb equivalents.
Its not being used in Production yet but it all seems to work ok locally. There are a few issues that I can think of
- Won’t work accross different domains (should work on subdomains if you set the cookie domain to be ".site.com" instead of "forum.site.com")
- All users that get automatically added to the Spree users table get assigned to the group "users" so it doesn’t look at the phpbb permissions at all.
- If you allow your phpbb user to change email addressess then when they hit the cart after a change, they will be registed as a new user.
- script/extension install git://github.com/mattfawcett/spree-phpbb-auth.git
- Change the contents of config/phpbb_auth_settings.rb
- Add an entry to your database.yml file for "phpbb_database_production"