You are here: parse .htaccess incl. .htgroups and <Files special*.htm> ... « All PHP « IT news, forums, messages
parse .htaccess incl. .htgroups and <Files special*.htm> ...

Posted by Jack.Hambabo on 10/12/13 11:38

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/package.filesystem.file-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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация