aboutsummaryrefslogtreecommitdiffstats
path: root/lib/FPanel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/FPanel')
-rw-r--r--lib/FPanel/Login.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/FPanel/Login.pm b/lib/FPanel/Login.pm
index dc5ae3a..55188f6 100644
--- a/lib/FPanel/Login.pm
+++ b/lib/FPanel/Login.pm
@@ -30,7 +30,7 @@ sub cgiapp_init {
],
DEFAULT_EXPIRY => '+24h',
COOKIE_PARAMS => { -name => 'FripostAdminPanel_SessAuth'
- , -path => '/index.cgi/'
+ , -path => '/cgi-bin/'
# Expires when the browser quits
, -expires => -1
,'-max-age' => -1
@@ -99,6 +99,7 @@ sub mymode_param {
# $domain = $path[1];
$mode = 'index';
}
+ print STDERR $q->self_url, "\n";
print STDERR $ENV{PATH_INFO} . '?' . $q->query_string
. " -> "
. $mode
@@ -124,7 +125,7 @@ sub login : Runmode {
$self->query->param('a') eq 'login';
# A logged user has no reason to ask for a relogin
- $self->authen->logout() if defined $self->authen->username;
+ $self->authen->logout if $self->authen->is_authenticated;
$self->query->param( destination => $self->query->self_url)
unless (defined $self->query->param('destination'));
@@ -151,11 +152,18 @@ sub login_box {
sub logout : Runmode {
my $self = shift;
- if ($self->authen->username) {
+ if ($self->authen->is_authenticated) {
$self->authen->logout;
$self->session->delete;
+ $self->session->flush;
}
- return $self->redirect($self->query->url . '/');
+
+ # Do not come back here afterwards
+ $self->query->delete( 'a' )
+ if (defined $self->query->param('a')) and
+ $self->query->param('a') eq 'logout';
+
+ return $self->redirect($self->query->self_url);
}
sub error_rm : ErrorRunmode {