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

Home » FUDforum » How To » login name
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
login name [message #30492] Tue, 28 February 2006 04:18 Go to next message
peregil is currently offline  peregil   Norway
Messages: 9
Registered: February 2006
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 09:23 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
add to buddy list
ignore all messages by this user
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 14:38 Go to previous messageGo to next message
peregil is currently offline  peregil   Norway
Messages: 9
Registered: February 2006
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 13:11 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
add to buddy list
ignore all messages by this user
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 #30595 is a reply to message #30526] Fri, 03 March 2006 16:25 Go to previous messageGo to next message
peregil is currently offline  peregil   Norway
Messages: 9
Registered: February 2006
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Thanks a lot. It helped me tremendously... Smile

Another problem (hopefully the last).

Im trying to import my old users into the fud26_users database.

Ive imported the following fields:
id(auto_incr), login, alias (=login), passwd(md5hash),email

However the users seems to be automatically deleted. I guess this is an internal check of some kind. Are there other required fields that must be set?
Re: login name [message #30624 is a reply to message #30595] Sun, 05 March 2006 11:56 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: How to re-skin a working forum
Next Topic: How to get messages from a particular forum
Goto Forum:
  

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

Current Time: Sun Oct 22 17:14:51 EDT 2017

Total time taken to generate the page: 0.00665 seconds