aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-01 20:12:34 +0200
committerGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-01 21:03:20 +0200
commitec2ed6c255ca97f39d4a58071f8558744bd9958d (patch)
treef8e248356f6b8ec8600cf485716aedcf9dba992f /lib
parent79344b1efee7e914b8d23bd0dfd92664cf698c11 (diff)
cgi-bin
Diffstat (limited to 'lib')
-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 {