You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Dennis Stout <st...@stout.dyndns.org> on 2003/07/02 23:49:50 UTC

if (!$one_thing) { $other; }

I suppose the subroutine that makes the call to it would help too.

I'll spare you all the dispatch routine as it's quite lengthy, but basically
the DispatchTbl::* generates webpages dynamically depending on the uri
caught by RequestHandler::handler();.

sub post_login_form {
        my $state = shift;
        my %args = $state->{q};
        $state->{template} = 'generic.tmpl';
        $state->{title} = 'TTMS Login';

        my $checkpass = get_password($state);

        if ($checkpass eq $state->{q}{login_pass}) {
                $state->{login_user} = $state->{q}{login_user};
                $state->{login_pass} = $state->{q}{login_pass};
                $state->{auth_status} = "Logged in as $state->{login_user}";
                set_auth_cookie($state);

                $args{body} = "Good Morning, Dave.";
        } else {
                set_logout_cookie($state);

                $args{body} = "I'm afraid I can't let you do that, Dave.";
        }

        return output_html($state, %args);
}