On Sun, Nov 26, 2000 at 03:31:52PM -0500, Neil Gunton wrote:
> 
> Perhaps a directive which allows certain file extensions to be processed
> by EmbperlObject::Execute(*), but not parsed and interpreted internally.
> 

option 1:

use the "Safe" module and allow user's web pages to include code, but
limit exactly what opcodes they're allowed.

see the embperl docs, and Safe(3pm)


option 2:

don't use Execute('*') if you don't want embperl to process the
file. just parse the filename out of $req_rec->uri and use normal perl
file IO to include its contents.

eg:
[- $req_rec->uri =~ m|some/web/root/(.*)$|;
   my $file = $1;
   my $buf;

   open F, "<$file" or { $req_rec->status(404); exit; };
   print OUT $buf while (read F, $buf, 4096);
   close F;
 -]



gerald, is there a nicer way to do set the status, then exit ?
how about getting the filename of '*' ?

Apache::exit isn't actually documented anywhere, but being able to
call exit(404) directly would be cool.

-- 
 - Gus

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to