You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Brooklyn Linux Solutions CEO <ru...@mrbrklyn.com> on 2001/06/24 05:10:07 UTC

Directory Restrictions

Hello

I've been working on a mod_perl implimentation which 
does the following.

New users gain access to a directory, but can not get access to
two directories underneath it.

After logging in and receiving a cookie, they are automatically
shunted to one of the two low directories.

I've had some unexpected difficulty with the images of the html
files.

I have something like this running on the top directory:


sub handler{
	my $r = shift;
	return DECLINED if ($r->uri() =~ /top/home.html);
	return DECLINED if ($r->uri() =~ /top/login.html);
	return DECLINED if ($r->uri() =~ /top/lower_dir1);
	return DECLINED if ($r->uri() =~ /top/lower_dir2);
	return DECLINED if (!$r->content_type('text/html));
	return DECLINED if ($r->content_type('images/gif));

My problem is that they can still see the directory index.  I need
It's doing an internal redirect when they are autorized for on of the
lower directories, but the graphics are still now getting through
to the top if I remove the DECLINED content_type 'text/html'.  But when
I leave it in, they seem to have access to the directory access.

Ruben

		



Re: Directory Restrictions

Posted by will trillich <wi...@serensoft.com>.
On Sat, Jun 23, 2001 at 11:10:07PM -0400, Brooklyn Linux Solutions CEO wrote:
> 
> I've been working on a mod_perl implimentation which 
> does the following.

...

> I have something like this running on the top directory:
> 
> 
> sub handler{
> 	my $r = shift;
> 	return DECLINED if ($r->uri() =~ /top/home.html);
> 	return DECLINED if ($r->uri() =~ /top/login.html);
> 	return DECLINED if ($r->uri() =~ /top/lower_dir1);
> 	return DECLINED if ($r->uri() =~ /top/lower_dir2);
> 	return DECLINED if (!$r->content_type('text/html));
> 	return DECLINED if ($r->content_type('images/gif));

i bet you mistyped some of that...

	val =~ /pattern/flags

maybe something more like:

	return DECLINED
	   if ($r->uri() =~ m{/top/((home|login).html|lower_dir[12])});

> It's doing an internal redirect when they are autorized for on of the
> lower directories, but the graphics are still now getting through
> to the top if I remove the DECLINED content_type 'text/html'.  But when
> I leave it in, they seem to have access to the directory access.

hmm -- "! text/html" should make "images/gif" redundant, i'd
think. anybody got a pointer, here?

-- 
I figure: if a man's gonna gamble, may as well do it
without plowing.   -- Bama Dillert, "Some Came Running"

will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!