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

Home » FUDforum » How To » How Do I find the user that is clicking a page/link ?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How Do I find the user that is clicking a page/link ? [message #34323] Fri, 20 October 2006 14:16 Go to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Hard to explain in the topic.

Basically I need to know what user is accessing a page/hyperlink.

I am trying to integrate Gallery2 into FudForum, for authentication and thus having one user base to work from and maintain.

To do this you have to create an "Entry Point" to Gallery which is basically a php file that allows an already authenticated user to be acknowledged by Gallery as that user and auto logged in as such so the user doesn't have to login again.

But to do this I need to pass to Gallery [in the php code] what user is trying to access the Gallery.

I can't seem to see a way to do this in the API. Closes thing is the function to return who is online, but that's not specific enough for whats needed here.

Anyone got any ideas ?

[Updated on: Fri, 20 October 2006 23:54]

Report message to a moderator

Re: How Do I find the user that clicking a page/link ? [message #34326 is a reply to message #34323] Fri, 20 October 2006 14:41 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
The idea is that you store user id inside something like a cookie, with a validation token and use the fud_fetch_user() to fetch user based on this ID.

FUDforum Core Developer
Re: How Do I find the user that clicking a page/link ? [message #34331 is a reply to message #34323] Fri, 20 October 2006 23:43 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Hmmmmm ok I am lost.


FudForum uses a cookie currently ?

How would you tackle this problem Ilia ?
Re: How Do I find the user that is clicking a page/link ? [message #34333 is a reply to message #34323] Fri, 20 October 2006 23:59 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Canada
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

I guess this can be answered by asking .... how does FudForum know, after a user has logged in, that it is indeed that same user clicking on different links, visiting different forums and giving that user the permissions all along.

Sounds fundamental to a forum and many other online software, but an area I have never dealt with before.

There must be a variable, global [?], that holds this information ?
Re: How Do I find the user that clicking a page/link ? [message #34351 is a reply to message #34331] Sun, 22 October 2006 21:54 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 uses either a cookie or a URL session to keep track of the user.

FUDforum stores the session id inside the cookie and then uses database to validate this session id.


FUDforum Core Developer
Re: How Do I find the user that is clicking a page/link ? [message #34358 is a reply to message #34323] Sun, 22 October 2006 23:07 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

So I can compare with a session ID in the Database ? But how would I find out what users is clicking on a URL ? Say to a private forum that only certain users have access to ?

I can't see how to access this info using the API. Am I missing something ?

Re: How Do I find the user that is clicking a page/link ? [message #34366 is a reply to message #34358] Mon, 23 October 2006 15:01 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
The permission in FUDforum are enforced by group permissions system that queries the group_cache table using the user's id and performs checks on the users_opt bitmask

FUDforum Core Developer
Re: How Do I find the user that is clicking a page/link ? [message #34369 is a reply to message #34323] Mon, 23 October 2006 21:21 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

So how do I pass onto Gallery2 what user is trying to access the gallery, if the user trying to go to the Gallery is logged on currently ?

[Updated on: Mon, 23 October 2006 21:22]

Report message to a moderator

Re: How Do I find the user that is clicking a page/link ? [message #34375 is a reply to message #34369] Tue, 24 October 2006 14:38 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, you use FUDAPI to fetch the user credentials based on the user's sessions. In fact you can do so via a simple query select * from fud26_ses where ses_id=[session_id]; without even using fudapi. To fetch the user details simply add INNER JOIN users u ON u.id=fud26_ses.user_id

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to create category
Next Topic: spam - how do you deal with it?
Goto Forum:
  

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

Current Time: Fri Nov 22 02:26:26 GMT 2024

Total time taken to generate the page: 0.02820 seconds