469,913 Members | 1,947 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,913 developers. It's quick & easy.

parse .htaccess incl. .htgroups and <Files special*.htm> ...

Hi,

I'm searching for a php script that can find out whether the current
user (I know _SERVER["PHP_AUTH_USER"] will give me the name for
non-cgi php) has the right to view a specific file.

My dream is that I just need a short php script that just asks the
webserver what the rights are. That seems a reasonable wish to me.

If this is however not possible than I'd like a script that can
interpret a .htaccess and .htgroups file. For this I would like to give
to the script a filename or a directory (filename should be possible),
the script would then search the folder and (if nessecary) the higher
folders to find out which .htaccess file applies. It then checks which
rule in the .htaccess file applies (i.e. it should understand both
plain
"
Require user Werner Dieter Heidi
Require group Servicetechniker
"
and
"
<Files *.htm>
Require user Werner Dieter Heidi
Require group Servicetechniker
</Files>
"
It shall than find the groups file and resolve the groups.
Then it should either give me the list of all users that are allowed to
see the picture, or it should tell me whether the current user has the
right to read the file.

It would be great if a script would already exist. I've never
programmed any php so I'm unsure how long it would take me to write the
..htaccess-parser.

There is
http://pear.php.net/manual/en/packag...e-htaccess.php
but as far as I see it'll just read the users and groups out of a give
..htaccess file. But it won't understand the <Files xyz.html> tag and it
won't resolve groups.
But then again it can write new .htaccess. (However I don't need this
right now.)

Very many thanks,
Jack

Jan 30 '06 #1
0 1817

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Walter Huf | last post: by
1 post views Thread by Christian Schmidbauer | last post: by
11 posts views Thread by Les Paul | last post: by
2 posts views Thread by Aaron | last post: by
4 posts views Thread by Stefan Bellon | last post: by
1 post views Thread by Zark3 | last post: by
4 posts views Thread by python | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.