Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2014-05-03 14:07:55

zervis
New member
Registered: 2014-05-03
Posts: 2

How to authenticate user login with session from my site to FluxBB?

Hey, I've found how to integrate session to login via FluxBB:

define('PUN_ROOT', './forum');
require PUN_ROOT.'include/common.php';
print_r($pun_user);

But how to login to FluxBB using session from my site?
Users are added to FluxBB table so I need only session working right.

Thanks!

Last edited by zervis (2014-05-03 14:21:44)

Offline

#2 2014-05-03 15:07:07

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: How to authenticate user login with session from my site to FluxBB?

You already have one with FluxBB - just copy the code from login.php and make your own login pages. That's what I do.

Offline

#3 2014-05-03 22:31:02

zervis
New member
Registered: 2014-05-03
Posts: 2

Re: How to authenticate user login with session from my site to FluxBB?

It's not that easy. My site is in root directory, forum is at /forum directory. I'm using session (session cookies?) while FluxBB is using cookies (as far as I know). I've also integrated facebook connect to my site.

I wanted to point FluxBB to use session from my site, but the problem is - FluxBB is using cookies.

Maybe I'm wrong and it's not hard to do?

edit:

And FluxBB is using sha1 password, and my site md5.

Last edited by zervis (2014-05-03 22:34:20)

Offline

#4 2014-05-03 23:28:40

Mpok
Member
From: France
Registered: 2008-05-12
Posts: 389

Re: How to authenticate user login with session from my site to FluxBB?

zervis wrote:

I wanted to point FluxBB to use session from my site, but the problem is - FluxBB is using cookies.

You found the pbm (apart from the sha1 one).
There is NO WAY for FluxBB to use sessions (or a LOT of modifs).

The best (imo) is to separate the two sides : site and forum. Then, u could develop a script to "mix" the two 'users' tables, for accurency. BUT the users would have to identify of each side independently.

Offline

#5 2014-05-04 05:18:32

Different55
Member
Registered: 2011-11-18
Posts: 178

Re: How to authenticate user login with session from my site to FluxBB?

Remind me, why can't he just edit functions.php and common.php to use sessions instead? Isn't that all that's needed, or is there something I'm forgetting?

Offline

#6 2014-05-04 07:26:44

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: How to authenticate user login with session from my site to FluxBB?

And FluxBB is using sha1 password, and my site md5.

I'm not sure what you are planning on keeping and getting rid of, but MD5 is just as bad as not hashing the password in the first place really - it's proven itself insecure many, many times.

why can't he just edit functions.php and common.php to use sessions instead?

It would be much more complex than that, he would have to edit all the included files and the files such as viewtopic.php, index.php, viewforum.php.etc. This is most certainly not a simple job. And on top of that, you then have things like PUN_ADMIN and PUN_MOD defined to the FluxBB usergroups. You would have to make sure that at the bear minimum, you have the exact same stuff from the FluxBB tables in your own user tables. This is certainly not going to be simple, and would be much easier if we could see what you have or post some of your code so far.

We'll need definite answers to these questions before we can help more:

1.) Which hashing do you intend to use - md5 or sha-1? Updating to sha-1 is easy, but we need to know which hashing format you want to use first.

2.) Which users table are you using? FluxBB's or your own?

3.) Is FluxBB is a different database altogether?

4.) Are there any major differences between the database tables?

5.) Are there any major differences between the user groups tables you have?

Last edited by chris98 (2014-05-04 07:28:58)

Offline

#7 2014-05-04 19:28:48

Different55
Member
Registered: 2011-11-18
Posts: 178

Re: How to authenticate user login with session from my site to FluxBB?

chris98 wrote:

And FluxBB is using sha1 password, and my site md5.

I'm not sure what you are planning on keeping and getting rid of, but MD5 is just as bad as not hashing the password in the first place really - it's proven itself insecure many, many times.

why can't he just edit functions.php and common.php to use sessions instead?

It would be much more complex than that, he would have to edit all the included files and the files such as viewtopic.php, index.php, viewforum.php.etc. This is most certainly not a simple job. And on top of that, you then have things like PUN_ADMIN and PUN_MOD defined to the FluxBB usergroups. You would have to make sure that at the bear minimum, you have the exact same stuff from the FluxBB tables in your own user tables. This is certainly not going to be simple, and would be much easier if we could see what you have or post some of your code so far.

We'll need definite answers to these questions before we can help more:

1.) Which hashing do you intend to use - md5 or sha-1? Updating to sha-1 is easy, but we need to know which hashing format you want to use first.

2.) Which users table are you using? FluxBB's or your own?

3.) Is FluxBB is a different database altogether?

4.) Are there any major differences between the database tables?

5.) Are there any major differences between the user groups tables you have?

Correct me if I'm wrong (and please understand that I fully expect you to do so), but doesn't common.php handle all the authentication stuff by itself? What needs to be edited in all those other files?

In any case, it's looking like it'd probably be easier for you to scrap your own login system and use FluxBB to authenticate. You can always add additional fields to FluxBB's user table.

Last edited by Different55 (2014-05-04 19:30:15)

Offline

#8 2014-05-04 19:33:59

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,744
Website

Re: How to authenticate user login with session from my site to FluxBB?

Different55 wrote:

Correct me if I'm wrong (and please understand that I fully expect you to do so), but doesn't common.php handle all the authentication stuff by itself? What needs to be edited in all those other files?

The authentication code is in include/functions.php, mostly.

Different55 wrote:

In any case, it's looking like it'd probably be easier for you to scrap your own login system and use FluxBB to authenticate. You can always add additional fields to FluxBB's user table.

That. If that's still possible, this will be the easiest way for you to integrate the two authentication systems - just use FluxBB's.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#9 2014-05-04 19:36:43

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: How to authenticate user login with session from my site to FluxBB?

There are many functions to start with, some of the stuff is in the common.php and functions.php file, but some is also in login.php so it's not going to be simple to change it all.

And if he's planning on using the forum as well, then he needs to edit all the $pun_user to $_SESSION stuff in all those files which would be a nightmare.

There is stuff defined all over the place that are used in all the files, so it would require a lot of editing to achieve it. In my opinion, it would be simpler to use FluxBB's login.

Last edited by chris98 (2014-05-04 19:38:57)

Offline

#10 2014-05-04 20:35:08

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,744
Website

Re: How to authenticate user login with session from my site to FluxBB?

Well, it's not that hard to put the contents of $_SESSION into $pun_user...


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#11 2014-05-04 21:37:55

Different55
Member
Registered: 2011-11-18
Posts: 178

Re: How to authenticate user login with session from my site to FluxBB?

chris98 wrote:

There are many functions to start with, some of the stuff is in the common.php and functions.php file, but some is also in login.php so it's not going to be simple to change it all.

And if he's planning on using the forum as well, then he needs to edit all the $pun_user to $_SESSION stuff in all those files which would be a nightmare.

There is stuff defined all over the place that are used in all the files, so it would require a lot of editing to achieve it. In my opinion, it would be simpler to use FluxBB's login.

Still not seeing where you're coming from. What needs to be edited in login.php? It seems hard, but I don't get this whole nightmare thing you're talking about.

Offline

#12 2014-05-05 07:44:43

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: How to authenticate user login with session from my site to FluxBB?

Well, it's not that hard to put the contents of $_SESSION into $pun_user...

No, but it would be very long and tedious.

Still not seeing where you're coming from. What needs to be edited in login.php? It seems hard, but I don't get this whole nightmare thing you're talking about.

The $pun_user stuff, the default user that gets set would have to be changed to a session, possibly the hash, along with loads of other stuff.

I don't know, maybe it's just me imagining there would be more work involved?

Offline

#13 2014-05-05 15:39:51

Different55
Member
Registered: 2011-11-18
Posts: 178

Re: How to authenticate user login with session from my site to FluxBB?

Taking a look at the code, it looks like all you'd have to do is edit functions.php. The cookie functions are at the very top, and they'd need to be changed to use sessions instead. I can't actually find anything else that would need to be modified.

Offline

#14 2014-05-06 04:39:41

Mpok
Member
From: France
Registered: 2008-05-12
Posts: 389

Re: How to authenticate user login with session from my site to FluxBB?

Different55 wrote:

Taking a look at the code, it looks like all you'd have to do is edit functions.php. The cookie functions are at the very top, and they'd need to be changed to use sessions instead. I can't actually find anything else that would need to be modified.

Right, BUT u have to modify it 'A LOT'. And it should be working with login.php and common.php and all the way, which  is not so easy.
It's "still possible" as Franz said. Publish a 'mod' when u did it, we all will thank u…

Offline

#15 2014-05-06 20:31:10

Different55
Member
Registered: 2011-11-18
Posts: 178

Re: How to authenticate user login with session from my site to FluxBB?

Am I the only one who thinks sessions and cookies aren't all that different? There's only a few functions that would need to be rewritten, right? When I find the free time I'll give it a try and see if it really is as easy as I seem to think it is.

Offline

Board footer

Powered by FluxBB