From ec2ed6c255ca97f39d4a58071f8558744bd9958d Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 1 Sep 2012 20:12:34 +0200 Subject: cgi-bin --- lib/FPanel/Login.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/FPanel') 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 { -- cgit v1.2.3