Forum Moderators: phranque

Message Too Old, No Replies

htaccess issues

remote_user variable

         

eperdeme

12:01 am on Sep 8, 2006 (gmt 0)

10+ Year Member


Hello chaps,

I have tried for 4 hours now reading site after site and I still am unable to do this very simple thing.

What I want to do is allow X.X.X/24 to view a site without needing to login, but I also want a way when coming from that range of allowed IP's to change the REMOTE_USER (the thing nagios/drraw look for) variable.

Basically if I come from the range of IP's I am logged in as guest, but I can find no way to force the webserver to prompt me to login so I can change the REMOTE_USER setting to "admin" so I have modify access to the apps. Idea's? I looked at the php ways of doing this but seem unable to set this variable when I try

htaccess file;

order deny,allow
deny from all
allow from X.X.X.

AuthName "graph"
AuthType basic
AuthUserFile /home/status/config/status.users
Require valid-user

satisfy any

jdMorgan

1:19 am on Sep 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You cannot modify the Remote_User. That is set by your browser in response to an 401 Auth Required response from the server, and persists until you close the browser completely -- including any other instances of the browser that are running on your machine.

You say you get logged in as "Guest" and I would guess that means you've got some other login mechanism on your site. If so, you will find life much easier if you use one or the other, and not both.

Jim

[edited by: jdMorgan at 1:21 am (utc) on Sep. 8, 2006]