I have a security.conf file that requires users to login whenever they visit my site.
Now I want the php pages to only show certain links to the users that are in the admins group in my .htgroup file. So the question is how do I get the group(s) that a user, that was authenticated by apache, is in, for use in my php scripts.
my .htgroup file looks like this
admins: user1 user2
users: user1 user2 user3 user4 user 5….
so it IS possible that a user is part of multiple groups because for certain parts of the site I only require that the person is a user. Other parts of the site I require that he/she is an admin, and for some parts I require a specific user.
If you have any ideas I would really appreciate it.
Thanks, Tom
$_SERVER['REMOTE_USER']will contain the Apache-authenticated username.You can parse the
.htgroupfile to determine to which groups that corresponds, or connect to (and query) the original source of the group information. So far as I know, it’s not handed from Apache to PHP.