return $password eq 'sesame' ? ('self',undef) : (undef,'wrong');
}
-my $ar = CGI::Auth::Flexible->new_verifier(
+our $verifier = CGI::Auth::Flexible->new_verifier(
dir => "$ENV{'NJAWAYMSG'}/data",
# do_redirect => \&do_redirect_mason,
handle_divert => sub { $m->auto_send_headers(0); return 0; },
login_ok => \&login_ok_self,
);
</%once>
-<%perl>
-my $cgi = $m->cgi_object();
-print STDERR ">".$cgi->url()."<\n";
-my $ar = $ar->new_request($cgi);
-if ($ar->check_ok()) {
- $m->call_next();
-</%perl>
+<%shared>
+our $cgi = $m->cgi_object();
+our $ar = $verifier->new_request($cgi);
+</%shared>
+% if ($ar->check_ok()) {
+% $m->call_next();
<hr>
-<form method="POST" action="<% $cgi->url() %>">
+<form method="POST" action="<% $ENV{'URL'} %>">
<% $ar->secret_hidden_html() %>
<input type="submit" name="caf_logout" value="Logout">
</form>
-<%perl>
-}
-</%perl>
+% }
db_connect();
www_begin($r,$m);
</%init>
+<%shared>
+our ($cgi,$ar);
+</%shared>
<%args>
$create => undef
</%perl>
<& htmlhead, subpage => "Edit \"$tx->{'desc'}\"" &>
<form action="save" method="post">
+<% $ar->secret_hidden_html() %>
<&| txtable, tx => $tx, inputs => 1 &>
<tr><td colspan=2><textarea name="text" cols="79" rows="15"><%
$tx->{'text'} |h %></textarea></td></tr>
www_begin($r,$m);
my ($sth,$row,$sthi,$rowi);
</%init>
+<%shared>
+our ($cgi,$ar);
+</%shared>
<&htmlhead, subpage => 'Overview' &>
<h2>Email addresses and their configuration</h2>
$sth->execute();
</%perl>
% while (my $row= $sth->fetchrow_hashref()) {
-<form action="edit" method="get">
+<form action="<% $ENV{'URL'} %>/edit" method="POST">
+<% $ar->secret_hidden_html() %>
<h3>Message "<% $row->{'desc'} |h %>"</h3>
<&| txtable, tx => $row &>