1 (edited by nwuese 2010-04-05 16:08)

Topic: How do I integrate PunBB into MY SITES EXISTING registration and login

Hello everyone, I'm new here. I have spent the last three days searching this forum over and over to find out how to integrate PunBB into the registration and login system that already exists on my site.

My site is run using eFiction which is basically another PHP application. eFiction uses a database and has tables for the users and passwords and everything.

I do NOT want to use PunBB's authentication system as the eFiction one is already in place. I would like for people to register or log in at the main site and be automatically registered and logged in for the forum which is just another link on the menu. I do not want users to have to login twice. I need them to just be able to move seamlessly through the site after their initial login.

I know there are a lot of threads out there addressing this but none of them are clear step by steps on how to do this. Also most people just say "oh here's my code" and they never even say what file this code is in, or they say "oh add this code or modify this" and they never even tell you which file you're supposed to be modifying.

I also checked the wiki but frankly the wiki page on integration is very unhelpful. It also doesn't really explain what files to modify or what to do in order to achieve this.

Could someone please tell me in a clear, step by step manner how to make it so that when a user registers on my site their information also enters punBB so that they can just click "forum" and find themselves already logged into the forum and not have to see another login page?

From what I have read on various threads out there I have the following questions although they are by no means a conclusive list:

Should I install punBB into the same database as my current eFiction install? (remember eFiction is a PHP script/application/thingy)

Should punBB use the same User table as my site (eFiction)? If so, how do I do this?

If my punBB and my site (eFiction) are using different databases, what code do I need to ensure that punBB draws its user information from my site's (eFiction's) user information? What file am I supposed to change, and where in particular in the file am I supposed to make changes?

The wiki says something about including common.php. Include it where? And how do I do this?


That's a few of my questions about this for now. Please help.

Also, please don't tell me to use PunBB's authentication system. That is NOT what I want/need and if it was an option for my site I would have already done so since the vast majority of the integration instructions out there are about how to do just that. The reason I decided to post a topic is because I need to do precisely the opposite: integrate PunBB into MY existing authentication system.

Thank you in advance for help and replies.

Re: How do I integrate PunBB into MY SITES EXISTING registration and login

nwuese wrote:

Should I install punBB into the same database as my current eFiction install? (remember eFiction is a PHP script/application/thingy)

It's not obligatory, but it would be a bit simpler for programming.

nwuese wrote:

Should punBB use the same User table as my site (eFiction)? If so, how do I do this?

I think they shouldn't. The Users tables must have different formats.

nwuese wrote:

If my punBB and my site (eFiction) are using different databases, what code do I need to ensure that punBB draws its user information from my site's (eFiction's) user information? What file am I supposed to change, and where in particular in the file am I supposed to make changes?

PunBB has two functions, add_user() and delete_user(). They add or delete the information about a user to PunBB Users table. I think the simplest way of integrating is to call these functions when a user registers or deletes himself in eFiction.

nwuese wrote:

The wiki says something about including common.php. Include it where? And how do I do this?

If you agree my suggestion, you have to find a place in eFiction code where a user info is added into the database and to insert to that place including common.php and calling add_user().

By doing that you deal with new registrations. Also you have to add the information about existing users to the PunBB Users table. The simplest way is to copy the eFiction Users table and to change its format via phpMyAdmin or another DB administrating tool.

The following part of integration is to deal with logins. The general idea is to set the PunBB cookie when a user is logging in eFiction. But let me explain it later. Maybe you have questions and it's better to discuss them first.

3

Re: How do I integrate PunBB into MY SITES EXISTING registration and login

Hello, I'm also new here and i'm one of the developers of the http://futurelost.net game
It's currently beta, and i'm trying to integrate registration process.

Using add_user function i was able to register the user, but i can't login after?
I had to manually hash the password, is that ok?

What's the correct format for user password?

I used this code:

$forumpass = forum_trim($password);
$salt = random_key(12);
$password_hash = mysql_escape_string(forum_hash($forumpass,$salt));

Thank you very much for any help.