MyBB Community Forums
Integrating Login Form Using Jquery - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Third Party Integration (https://community.mybb.com/forum-132.html)
+--- Thread: Integrating Login Form Using Jquery (/thread-154707.html)

Pages: 1 2


Integrating Login Form Using Jquery - Spudster - 2014-06-10

Hello,

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
http://spudgaming.com/signin.php

How could I archive this?

Thanks!

7,466 and no answer Sad

I am hoping to receive a answer soon


RE: Integrating Login Form Using Jquery - dragonexpert - 2014-06-10

You might look into using the validate_password_from_username function in the inc/functions_user.php file.


RE: Integrating Login Form Using Jquery - Spudster - 2014-06-11

Ok Thanks Wink

Would modifying any code there turn the board in to using session/cookies instead of the default authentication cookies.


RE: Integrating Login Form Using Jquery - dragonexpert - 2014-06-11

I don't believe it'd work that way, but I'm not certain. Also if you start a PHP page off with

<?php
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.


RE: Integrating Login Form Using Jquery - Spudster - 2014-06-11

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..

Thanks


RE: Integrating Login Form Using Jquery - Spudster - 2014-06-12

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.


RE: Integrating Login Form Using Jquery - dragonexpert - 2014-06-12

Why not just use one of the hooks in member.php?

http://docs.mybb.com/MyBB_Plugin_Hooks.html

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.


RE: Integrating Login Form Using Jquery - Spudster - 2014-06-13

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


RE: Integrating Login Form Using Jquery - dragonexpert - 2014-06-13

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";


RE: Integrating Login Form Using Jquery - Spudster - 2014-06-13

I managed to work it out yesterday I forgot to modify the cookie settings to work with the entire domain.