Then in /auth_required/autohandler :<div class="small_text"> <h1><% $message %>You are not logged in:</h1> If you don't have a login, Click <a href="/create_user.html">here</a +> to create one. </div> <form method="post" action="/index.html"> <table class="form_fields"> <tr> <td>User Name: </td> <td><input type="text" name="name_user" /></td> </tr> <tr> <td>Password: </td> <td><input type="password" name="password" value="" alt="Require +d only for admins"/></td> </tr> </table> <div style="text-align:right"> <input type="submit" value="Proceed" /> </div> </form> <%args> $message => '' </%args>
where get_message looks like:<%init> my $log_in_status = My::App->authenitcate_user($r); if ($log_in_status eq 'OK') { $m->call_next; # proceeed to /auth_required/foo.html } else { my $message = $m->comp('/get_message', key => $log_in_status); $m->comp('/non_auth', message => $message); } </%init>
<% $message %> <%args> $key </%args> <%init> my $message = $key ? $Messages{$key} : ' '; </%init> <%once> my %Messages = ( http_title => 'Welcome', # Invalid user name or password OR username deleted from table 101 => 'Invalid username or password', # No cookie sent to server 201 => 'An error has occured', # The session id from cookie was invalid 301 => 'An error has occured' ); </%once>
In reply to Re: Problem with Mason, can it be solved with a subrequest?
by Arunbear
in thread Problem with Mason, can it be solved with a subrequest?
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |