473,416 Members | 1,660 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,416 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 1980

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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.