MyBB Community Forums

Full Version: How do I integrate site login with mybb login?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When a user joins my site, I want them to be registered to the forum automatically. How would I achieve this?

On my site I currently use a different password hashing than mybb's.
I create a random salt and then hash it. I'm assuming that is going to cause a problem?

I want to avoid storing redundant data, so having both a mybb user table and a site user table is not an option.
When a use signs up to your site get them to use then mybb registration page. Look in the user submitted tutorials forum I am sure there is a past somewhere saying how to have a login box for mybb but in a different dir.
You can't not have a mybb_users table. MyBB queries it directly in several places and expects to get results back. Same is true for any other software usually, that's why the common solution is a bridging system, something that synchronizes user accounts across the various softwares used on your site.

So for example you could simply create an entry in the mybb_users table when someone joins up your site. In addition to your own hashing mechanism you could just hash the password for MyBB also. Or you could write a plugin for MyBB which authenticates the password against your user site entry (the mybb merge system has a plugin which supports other forums hashing, you could probably use that as an example).

Bridges start to get complicated when, for example, you want someone logged into your site to be automatically logged into the forum as well (you have to synchronize cookies), or when someone changes their password in the forum it should change the password on the site as well (or vice versa, you have to synchronize passwords), if people change their usernames, et cetera.

You'll have to choose whether to keep things simple (just skip the additional registration process) which can be done easily enough I guess or go for the full solution (sync everything in both directions) which is a whole lot of work...

A lot of people avoid this problem altogether by making MyBB their site in the first place Wink
What if I added all the rows in my sites existing user table into the mybb_user and just query that when I need data for the site? Would I be take a performance hit?