Re: Filter access to Files on Apache

2001-07-09 Thread Ken Williams

[EMAIL PROTECTED] (Thomas Bach) wrote:
>At 11:17 09/07/01 -0500, you wrote:
>>If you want to directly send a file, use:
>>
>>open(DATEI, ...)
>>$r->send_fd(DATEI)
>>close(DATEI)
>>
>>You can do an internal redirect using subrequests, if you want.  See
>>$r->lookup_uri().
>
>what kind of object is $r ?
>CGI?

It's the Apache request object.  See 'perldoc Apache' or 'perldoc mod_perl'.

>>But I'm not sure why you need to redirect just to authenticate.  Can't
>>you just deny access if authentication fails, and allow it if it
>>succeeds?
>
>
>yes, this is what i want to do, but how do I make this over an apache 
>handler (or sth. similar)?
>sorry, I'm not that deep in this stuff, but I hope once I'll get it.

It sounds like perhaps you should take a look at the book "Writing
Apache Modules with Perl and C" from O'Reilly.  There are many ways you
could do this, and a book like that will give you a sense of the issues
involved.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Re: Filter access to Files on Apache

2001-07-09 Thread Ken Williams

[EMAIL PROTECTED] (Thomas Bach) wrote:
>perhaps it is off-topic (sorry for that, but i hope that somebody of you 
>can help me), but somehow i wish to have a solution with precompiled perl 
>such as mod_perl or ... everything else which fits to my needs.
>
>I want to filter every access of for example all .jpg-files on my apache 
>for autentication purposes. I  use my own cookie-based authentication 
>mechanisms.
>So one solution i had was to add a handler
>
>Action auth authent.pl
>AddHanlder auth jpg
>
>and in the authent.pl use something like a internal redirection. But the 
>only way i know to get this internal redirection is the following:
>
>open(DATEI, ...)
>print while ()
>close(DATEI)

If you want to directly send a file, use:

   open(DATEI, ...)
   $r->send_fd(DATEI)
   close(DATEI)

You can do an internal redirect using subrequests, if you want.  See
$r->lookup_uri().

But I'm not sure why you need to redirect just to authenticate.  Can't
you just deny access if authentication fails, and allow it if it
succeeds?


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Filter access to Files on Apache

2001-07-09 Thread Thomas Bach

Hello list

perhaps it is off-topic (sorry for that, but i hope that somebody of you 
can help me), but somehow i wish to have a solution with precompiled perl 
such as mod_perl or ... everything else which fits to my needs.

I want to filter every access of for example all .jpg-files on my apache 
for autentication purposes. I  use my own cookie-based authentication 
mechanisms.
So one solution i had was to add a handler

Action auth authent.pl
AddHanlder auth jpg

and in the authent.pl use something like a internal redirection. But the 
only way i know to get this internal redirection is the following:

open(DATEI, ...)
print while ()
close(DATEI)

So, I'd be glad if you can give me some hints to solve this.
Especially in order to efficiency (for that it don't have to be compiled 
everytime)
I'm running apache 1.3.17 with mod_perl on a Linux machine.

Thanks in advance!

Thomas Bach

<><><><><><><><>
think karo..
bkaro.net