CodeIgniter Forums
myBB and CI logins - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: Lounge (https://forum.codeigniter.com/forumdisplay.php?fid=3)
+--- Thread: myBB and CI logins (/showthread.php?tid=69207)



myBB and CI logins - PaulD - 10-19-2017

Hi,

I have a CI website with a login system, that recognises users and admin_users nicely. Admin users can access the admin pages as expected etc.

What I want is to add to the backend for admins only, a myBB forum for internal communication (specifically the exploring of ideas and issues, not chit chat). However I do not want the users to have to log in again.

On a post in the myBB forums it says something like

Quote:If you have an authentication system already in place and want MyBB to authenticate against that, probably the easiest method is to forge a cookie to trick MyBB into thinking a particular use is logged in, via cookies. (set $_COOKIES['mybbuser'] before the session is loaded, example:
PHP Code:
PHP Code:
// assume $uid contains the userid of the user
$user = get_user($uid);
$_COOKIES['mybbuser'] = $user['uid'].'_'.$user['loginkey'];  
Last post in https://community.mybb.com/post-231194.html

Has anyone done this with CI and myBB?

I think I should just install it and try it out. Just thought I would ask for any advice, code snippets or experiences of others before doing it.

Thanks in advance,

Paul

PS If it is too painful I might just do a simple thing myself, but if it is going to be used seriously, I thought why not use myBB as it seems to do an excellent job on the CI site.


RE: myBB and CI logins - InsiteFX - 10-20-2017

I would be looking at if there are any security issues with doing it that way Paul.


RE: myBB and CI logins - PaulD - 10-20-2017

I am going to try it this weekend and see what happens. Will bear the security issue in mind of course, but I cannot see another way of doing it. Perhaps tomorrow I will research this again with other forum alternatives too to see if there is a better option.

Thanks for raising the concern though.

Paul.