JSP has a tag where as long as you haven't written to OUT, you can forward
all output from the current file to another, abandoning all consequent
instructions in this file. I have been trying to achieve similar using
Embperl, to little success (probably because my Apache knowledge is rather
limited ...). The following stub indicates what I want to do: if the
authorise function fails, hand the request to /public/secviolation.html and
don't present any of the rest of the page.
<html>
<head>
<link rel="stylesheet" href="/balclutha.css">
</head>
[!
use DBIx::Recordset;
sub authorise(%) {
my ($argref) = @_;
$$argref{errorpage} ||= '/public/secviolation.html';
if (!exists $udat{user} ||
exists $$argref{group} && !$udat{user}->hasgroup($$argref{group})) {
my $r = Apache->request;
$r->internal_redirect_handler($$argref{errorpage});
}
}
!]
<body>
[* authorise( { group => 'aadmin' } ); *]
<h4>Operations Control</h4>
<h4>Clients</h4>
<table>
......
However, this does the contents of the redirect and continues to present the
page. In fact, it splits the contents of the page over two HTTP requests.
Does anyone know how this should be done properly?
Cheers, Alan
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]