Interrogate ID of logged in user?

J

Janis Papanagnou

Access to one of my web pages is htaccess protected, and I want
to control some HTML attributes depending on the logged in user.

Is there a way to interrogate the user ID at client-side which
has been typed in by a user on that htaccess protected page?

Thanks for any hint.

Janis
 
T

Thomas 'PointedEars' Lahn

Janis said:
Is there a way to interrogate the user ID at client-side which
has been typed in by a user on that htaccess protected page?

Yes.


PointedEars
 
R

RobG

Access to one of my web pages is htaccess protected, and I want
to control some HTML attributes depending on the logged in user.

Is there a way to interrogate the user ID at client-side which
has been typed in by a user on that htaccess protected page?

A typical strategy is to allocate a role to the user, then a program
can make decisions based on that role without any need to know user ID
or keep a list of them. In your case, when the user logs in you could
set a cookie with their role. Client-side script can then access the
role as required.

Note that this should not be used for any kind of security.
 
J

Janis Papanagnou

Am 30.08.2010 03:37, schrieb RobG:
A typical strategy is to allocate a role to the user, then a program
can make decisions based on that role without any need to know user ID
or keep a list of them. In your case, when the user logs in you could
set a cookie with their role. Client-side script can then access the
role as required.

I'm not sure that works for my application.

I have htaccess-users, say, "u1", "u2", "u3", etc. I need to match
those users to some "security" groups individually, say u1, u2, u3
belong to user-group "g1", while u4, u5, u6, u7 belong to "g2", etc.

That's exactly why I want to access the htaccess users-IDs, to
determine the respective (statically fixed associated) group.

Janis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top