From 3eac5ce288984c04081183c1fd292b9332f803ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Sat, 20 Feb 2010 11:44:05 +0000 Subject: [PATCH] Portal: display logout status to user --- .../lib/Lemonldap/NG/Portal/Simple.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm index 448366b00..4ee01b4e0 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -402,8 +402,10 @@ sub error_type { return "positive" if ( scalar( - grep { /^$code$/ } - ( PE_REDIRECT, PE_DONE, PE_OK, PE_PASSWORD_OK, PE_MAILOK, ) + grep { /^$code$/ } ( + PE_REDIRECT, PE_DONE, PE_OK, PE_PASSWORD_OK, + PE_MAILOK, PE_LOGOUT_OK, + ) ) ); @@ -827,7 +829,10 @@ sub controlExistingSession { if ( $self->param('logout') ) { # Delete session in global storage - $self->_deleteSession($h); + unless ( $self->_deleteSession($h) ) { + $self->lmLog( "Unable to delete session $id", 'error' ); + return PE_ERROR; + } # Call issuerDB logout eval { $self->_sub('issuerLogout'); }; @@ -841,11 +846,8 @@ sub controlExistingSession { $self->lmLog( "Error when calling authLogout: $@", 'debug' ); } - $self->{error} = PE_REDIRECT; - - # Redirect user - $self->_subProcess(qw(autoRedirect)); - return PE_FIRSTACCESS; + # Display logout message + return PE_LOGOUT_OK; } # If the user wants to purge other sessions