From 60296f0143466dc2a6b956cc71852a0674a4dc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Mon, 30 Aug 2010 08:56:16 +0000 Subject: [PATCH] CAS: Manage renew flag in LOGIN URL (#101) --- .../lib/Lemonldap/NG/Portal/IssuerDBCAS.pm | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBCAS.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBCAS.pm index d2f6ff4ef..e7e70bfcf 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBCAS.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBCAS.pm @@ -506,8 +506,21 @@ sub issuerForAuthUser { if ( $renew eq 'true' ) { # Authentication must be replayed - # TODO - $self->lmLog( "Authentication renewal not managed", 'warn' ); + $self->lmLog( "Authentication renew requested", 'debug' ); + $self->{updateSession} = 1; + $self->{error} = $self->_subProcess( + qw(issuerDBInit authInit issuerForUnAuthUser extractFormInfo + userDBInit getUser setAuthSessionInfo setSessionInfo + setMacros setLocalGroups setGroups authenticate + store authFinish) + ); + + # Return error if any + if ( $self->{error} > 0 ) { + $self->lmLog( "Error in authentication renew process", + 'error' ); + return $self->{error}; + } } # If no service defined, exit @@ -522,7 +535,10 @@ sub issuerForAuthUser { my $casServiceSession = $self->getCasSession(); - return PE_ERROR unless $casServiceSession; + unless ($casServiceSession) { + $self->lmLog( "Unable to create CAS session", 'error' ); + return PE_ERROR; + } $casServiceSession->{type} = 'casService'; $casServiceSession->{service} = $service;