MyBB Community Forums

Full Version: loggedIn Function in member.php + Multiple Site Login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In member.php in the 'else if($mybb->input['action'] == "do_login" ' sectioon around line 918 there are the following lines:

	if(function_exists("loggedIn"))
	{
		loggedIn($user['uid']);
	}

What's that for and is it possible for us to use that as some sort of SDK to login to external apps or something? Where does that function have to be defined? I tried defining it in a plugin but it wasn't called.

I am trying to make multiple sites validate a login against a main site, eg

MainSite.com
MiniSite1.com
MiniSite2.com

The users are all on MainSite.com and so are the forums.

MiniSite1.com and MiniSite2.com contain no MyBB code, but I want them to be able to login via mainsite.com/member.php so that all three sites use the same login, how could I do this?
Since cookies are based on domains, they can't be shared among MainSite.com, MainSite1.com and MainSite2.com .

However, they can be shared among domains with a common parent domain:
site1.MainSite.com
site2.MainSite.com
site3.MainSite.com
Yeah the loggedIn() is part of an old SDK (I think before version 1.0, etc). Its use is deprecated now, as the plugin system replaces and extends its functionality. If you really want to use it, you just need to define loggedIn($uid) anywhere before that function is called. i.e. you could stick it in a file called integration.php and include it in global.php.

loggedIn() and a bunch of similar functions have been removed in 1.4. It's recommended that you use the plugin system instead.