login name [message #30492] |
Tue, 28 February 2006 09:18  |
peregil
 Messages: 9 Registered: February 2006
Karma: 0
|
Junior Member |
|
|
If a user is logged into the forum, I would like to check for that other places on my site. I would also like to retrieve the users username.
Is there a way of doing this? Preferrably without altering the FUDforum code (for upgrade/compability issues).
|
|
|
Re: login name [message #30496 is a reply to message #30492] |
Tue, 28 February 2006 14:23   |
Ilia
 Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You can use FUDAPI to fetch this information, it can be found inside the scripts/ directory.
FUDforum Core Developer
|
|
|
Re: login name [message #30512 is a reply to message #30496] |
Tue, 28 February 2006 19:38   |
peregil
 Messages: 9 Registered: February 2006
Karma: 0
|
Junior Member |
|
|
Thanks. I found the fudapi, and is able to retrieve stats and info about logged in users.
Im however not able to find functions that can help me - to find out the current user.
Let me explain what Im looking for (I guess this is pretty basic, and maybe Im just searching in the wrong places):
I have a website, where one of the subpages is the fudforum. I have 50.000 registered users, and I have decided to move all these users into the fudforum-database. Im planning on using the forum login/register-form in the future.
However I need the login-info alse outside the forum. When the users arrive at my site (not at the /forum-pages), I need to check if they have a valid cookie, and if they do, get their loginname. If they have logged into the forum, and have a valid session, I also need to retrieve their username if they go outside the forum.
Does this make sense?
|
|
|
Re: login name [message #30526 is a reply to message #30512] |
Wed, 01 March 2006 18:11   |
Ilia
 Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
forum_login.php inside the scripts/ directory gives you login/logout functinality. To fetch a user id based on the session, you simply query the fud26_ses table and fetch the user_id field.
FUDforum Core Developer
|
|
|
|
Re: login name [message #30624 is a reply to message #30595] |
Sun, 05 March 2006 16:56  |
Ilia
 Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You need to mark the users as "approved" and "confirmed". Look at the bitmasks you need to set for users_opt inside fud_users.sql table defenition.
FUDforum Core Developer
|
|
|