summaryrefslogtreecommitdiffstats
path: root/app.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'app.cgi')
-rwxr-xr-xapp.cgi15
1 files changed, 8 insertions, 7 deletions
diff --git a/app.cgi b/app.cgi
index 6ee3207..844e3cd 100755
--- a/app.cgi
+++ b/app.cgi
@@ -68,15 +68,16 @@ sub login {
$error = '<p>Password has to be nonempty</p>';
} elsif ($password ne reverse($login)) {
$error = '<p>Password has to be reverse login</p>';
- } else {
- print "Set-Cookie: $AUTH_COOKIE=ok:$login; path=$ENV{SCRIPT_NAME}\n";
- print "Refresh: 3; URL=$ENV{SCRIPT_NAME}\n";
- $title = 'Logged in';
- $body = 'You will be redirected to the '
- . qq!<a href="$ENV{SCRIPT_NAME}">home page</a>!;
- return;
}
}
+ if (defined $login and $error eq '') {
+ print "Set-Cookie: $AUTH_COOKIE=ok:$login; path=$ENV{SCRIPT_NAME}\n";
+ print "Refresh: 3; URL=$ENV{SCRIPT_NAME}\n";
+ $title = 'Logged in';
+ $body = 'You will be redirected to the '
+ . qq!<a href="$ENV{SCRIPT_NAME}">home page</a>!;
+ return;
+ }
no warnings 'uninitialized';
$body = <<"EOS";
$error