David Baird wrote:
On 9/12/05, Peter Speltz <[EMAIL PROTECTED]> wrote:
Another case, say you wanted images to display only if a user was over
18 . How, from the authenticate sub, would you skip Maypole
processing yet tell Apache to not return the image? . Return ERROR?
If you set the template, the model phase won't be run, and your
alternate template will replace the image. Your 'template' would need
to be an image as well, because the browser asked for something in an
'img' tag.
Ermm? What stops the model being processed is $applicable != OK (which
is as a result of is_applicable() and which also sets the template).
You can change $r attributes in authenticate(), but you can't change
$applicable. You can set $r->output and tweak the headers if necessary,
to avoid template processing altogether. Or you can change the template
if you DO want template processing but the one set automatically after
is_applicable() is no good.
Or, your authenticate() could return an AUTH_REQUIRED or FORBIDDEN
error and the code will be returned to the browser. (You'll need to
import these constants from somewhere).
How does this work? Maypole clearly isn't expecting anything but OK or
DECLINED (which is the same numerical value as ERROR) because of these
lines in Maypole.pm:
if ( $r->debug and $status != OK and $status != DECLINED ) {
$r->view_object->error( $r,
"Got unexpected status $status from calling authentication" );
And whenever I make authenticate return anything other than OK, the
browser displays 500 - server error. Is this a CGI::Maypole problem or
do you see the same with mod_perl?
Cheers, Dave
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users