FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » How to use FUDforum authentication from other scripts?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How to use FUDforum authentication from other scripts? [message #32539] Fri, 07 July 2006 21:54 Go to next message
Mreimer is currently offline  Mreimer   Germany
Messages: 5
Registered: July 2006
Karma: 0
Junior Member
Hello,

I have a huge database of users in a FUDforum based forum.

Now I want to allow all those users (if they aren't banned or something like that) to use a database application I've created. To be able to do this, I need the following:

- A way to read the FUDforum cookie. If a users logs in to FUDforum and stores a cookie, then my database application should read this cookie, too, to auto-login the user (I just need the login name of the user which has been logged in using the cookie information).

- A way to allow the user to login into the system, if not already done (user specifies username/password on my database application). This way should also set the cookie to login the user into both systems again.

The second thing should be possible with forum_login.php (external_get_user_by_auth followed by external_fud_login) but I don't know how I could do the first one.

Thank you very much in advance
Re: How to use FUDforum authentication from other scripts? [message #32550 is a reply to message #32539] Sat, 08 July 2006 17:46 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
FUDforum cookie stores the user's session id and that's all. To resolve this value to a user id you would need to query the forum's session database table and fetch the user_id field.

To login the user into other parts of the system when they login to the forum you need to modify the "login" code insiders users_reg.inc.t, the function user_login() ,


FUDforum Core Developer
Re: How to use FUDforum authentication from other scripts? [message #32564 is a reply to message #32550] Sun, 09 July 2006 08:49 Go to previous messageGo to next message
Mreimer is currently offline  Mreimer   Germany
Messages: 5
Registered: July 2006
Karma: 0
Junior Member
Ilia wrote on Sat, 08 July 2006 13:46

FUDforum cookie stores the user's session id and that's all. To resolve this value to a user id you would need to query the forum's session database table and fetch the user_id field.


I did so and it works well. I just wanted to know if there is an official API function to do this.

What about banned users? Does banning a user in the administration GUI also kill all it's sessions? How can I ignore session IDs which come from banned users?

Quote:

To login the user into other parts of the system when they login to the forum you need to modify the "login" code insiders users_reg.inc.t, the function user_login() ,


The "other parts" are also PHP scripts. I just modify them to be able to work with the FUDforum session cookie so I don't have to edit anything in the forum source.
Re: How to use FUDforum authentication from other scripts? [message #32576 is a reply to message #32564] Mon, 10 July 2006 00:59 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Banning a user sets a "banned" flag on their account. Sessions of banned users are removed when the user is being banned.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to use forum_login.php?
Next Topic: Use a shortcut icon ?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 21:54:31 GMT 2024

Total time taken to generate the page: 0.02238 seconds