473,287 Members | 3,228 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

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 1972

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Walter Huf | last post by:
Okay, I'm writing a cgi program, and I can send files and stuff, but how do I send text files with word wrap enabled? If a line of text is wider than the browser, and unsightly scrollbar appears on...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
2
by: Aaron | last post by:
I have some existing code that accepts a filename, opens that file, and then processes it line-by-line. What I want to do is modify this routine so that instead I can simply pass a huge char*...
4
by: Stefan Bellon | last post by:
Hi all! I want to parse the contents of an .htaccess file from within PHP. The contents of the .htaccess file looks like this: <Files foobar.tar.gz> AuthType Basic AuthUserFile /foobar...
1
by: Zark3 | last post by:
Hi all, Probably not the best place to ask this, but considering I'm more of a ..NET-guy thinking in .NET-patterns, here goes anyway. I was handed an ASP-project to internationalize (read:...
3
by: Klaus Herzberg | last post by:
Hi, I come from the "dark side" php/mysql and there often problems with character sets (utf-8, latin...) and storing data in datebase. Exists in the world of dot.net and ms-sql-server similiar...
4
by: python | last post by:
Is there an official list of all Python's __<special-methods>__? I'm learning Python and trying to get an idea of what __<special-methods>__ are available and specifically, what...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.