On 12/20/05, Brad Cathey <[EMAIL PROTECTED]> wrote:
> Do you mean something like:
>
> sub cgiapp_prerun
> {
>    my $self = shift;
>    if ($self->session->param('logged_in'))
>    {
>       #do stuff
>    }
>    else
>    {
>       $self->header_type('redirect');
>       $self->header_props(-url=>"index.cgi?rm=sl");
>     }   #index.cgi is the instance script for the log-in
> }

or simplify that with the CAP::Redirect plugin:

use CGI::Application::Plugin::Redirect;

sub cgiapp_prerun {
   my $self = shift;
   if ($self->session->param('logged_in')) {
      #do stuff
   }
   else{
      return $self->redirect("index.cgi?rm=sl");
   }
}

This does practically the same thing, except it also short circuits
the runmode (in your example, the runmode is still executed).

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to