MyBB Community Forums

Full Version: Integrating Login Form Using Jquery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

I was going to choose a light forum system that is easy to customize but instead I thought I try with mybb first since I have developed a few mods with Mybb before and overall it is the best software for being "Free"

Now what I wan to do is link my custom login system with the mybb interface so when someone logs in via the script they will also be logged in to the forums. "Basically Linked"

Here is the login page link

How could I archive this?


7,466 and no answer Sad

I am hoping to receive a answer soon
You might look into using the validate_password_from_username function in the inc/functions_user.php file.
Ok Thanks Wink

Would modifying any code there turn the board in to using session/cookies instead of the default authentication cookies.
I don't believe it'd work that way, but I'm not certain. Also if you start a PHP page off with

define("IN_MYBB", 1);
require_once "global.php";

You will have access to all the global variables and objects such as $mybb and $db. It's an easy way to implement permissions for the rest of your site.
What I could do then is process the mybb session function if the user info is right that way i won't have to modi anything with in Mybb. Not sure what is was but it was the function that logs the user in to the forum.

I should work it out

What is the session/cookie code, The code that starts the mybb session/cookie? for example in php $_SESSION['start']=$value; would start the session etc..

I have decided to use some integration code that I found around the internet and modify member.php to add my session code and a few other things.
So it will use whatever the the mybb system uses to log a user in to the forum plus what i use which the PHP sessions.

I also modified the encryption method as mybb was different to the method that I use.

Only thing I really need to watch out for is when updates come through since the code could change but besides that it saves me building a system from scratch when there is already a lot better out there.

I might build my blog system myself though I am still debating on that.
Why not just use one of the hooks in member.php?

member_do_login_end I believe would be the best to use for handling logins because they are already logged into MyBB at that point iirc.
Actually when thinking about it this might not be the best option as it would be un-professional to start two sessions what is the point in that :/

Anyway I take your advice and build the site upon Mybb.

less hassle then

Thanks Wink

I already have enough mybb knowledge in editing the codes.

I am having issues echoing a username from mybb outside of the mybb directory :/

I can this be archived
You need to edit the require_once line when you are out of the mybb directory. If you're one level up you'd use this instead
require_once "../global.php";
I managed to work it out yesterday I forgot to modify the cookie settings to work with the entire domain.
Pages: 1 2