Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
The stupid question is the question not asked
 
PerlMonks  

Re: CGI::Application design strategy

by Ctrl-z (Friar)
on Mar 02, 2004 at 05:39 UTC ( [id://333212]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to CGI::Application design strategy

Run_modes are like the public interface to your App - they dont need to account for everything your app does. Id be more likely to have just 1 runmode - login - that calls private methods depending on whether the appropriate username/password combo was coming in on the CGI params.
sub login
{
    my $self = shift;
    my $q    = $self->query(); # ?
    if($q->param("username") && $q->param("password"))
    {
        $self->_verify_login() ;
    }
    else
    {
        $self->_generate_form();
    }

    # ... do template stuff here
}
For login_retry - id probably just put a <TMPL_IF> in my original form template, and reuse it for the retry.
<tmpl_if name="BAD_LOGIN"> 
     Sorry please try again...  
</tmpl_if>
    <form>...</form>
Hope that helps



time was, I could move my arms like a bird and...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://333212]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.