From 4f979bfe22717cc4451b00b6706514c7d1585cd4 Mon Sep 17 00:00:00 2001 From: Thomas CHEMINEAU Date: Thu, 29 Apr 2010 13:47:57 +0000 Subject: [PATCH] SAML: change error name to PE_IMG_OK and PE_IMG_NOK --- modules/lemonldap-ng-portal/example/index_skin.pl | 4 ++-- .../lib/Lemonldap/NG/Portal/IssuerDBSAML.pm | 5 +++-- .../lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/lemonldap-ng-portal/example/index_skin.pl b/modules/lemonldap-ng-portal/example/index_skin.pl index 47c3c55fa..cce349b3c 100755 --- a/modules/lemonldap-ng-portal/example/index_skin.pl +++ b/modules/lemonldap-ng-portal/example/index_skin.pl @@ -48,9 +48,9 @@ my ( $skinfile, %templateParams ); if ( $portal->process() ) { # 1.1 Image mode - if ( $portal->{error} == PE_INFO_OK || $portal->{error} == PE_INFO_KO ) { + if ( $portal->{error} == PE_IMG_OK || $portal->{error} == PE_IMG_NOK ) { $skinfile = $skin_dir . '/common/ok.png'; - if ( $portal->{error} == PE_INFO_KO ) { + if ( $portal->{error} == PE_IMG_NOK ) { $skinfile = $skin_dir . '/common/warning.png'; } $portal->printImage($skinfile, 'image/png'); diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm index 943260004..2f7a52bd7 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm @@ -175,6 +175,7 @@ sub issuerForUnAuthUser { } # 1.3. SLO SOAP replay (send SOAP requests asynchronously) + # This URL is used by IMG html tag, and should returned PE_IMG_* if ( $url =~ /^(\Q$saml_slo_url_relay_soap\E)/i ) { $self->lmLog( "URL $url detected as a relay service URL", 'debug' ); @@ -229,10 +230,10 @@ sub issuerForUnAuthUser { unless ($rstatus) { $self->lmLog( "Fail to process SOAP logout request to $providerID", 'error' ); - return PE_INFO_KO; + return PE_IMG_NOK; } - return PE_INFO_OK; + return PE_IMG_OK; } 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 64dd4922b..312020482 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -51,8 +51,8 @@ use constant { # Portal errors # Developers warning, do not use PE_INFO, it's reserved to autoRedirect. # If you want to send an information, use $self->info('text'). - PE_INFO_KO => -5, - PE_INFO_OK => -4, + PE_IMG_NOK => -5, + PE_IMG_OK => -4, PE_INFO => -3, PE_REDIRECT => -2, PE_DONE => -1, @@ -111,7 +111,7 @@ use constant { }; # EXPORTER PARAMETERS -our @EXPORT = qw( PE_INFO_KO PE_INFO_OK PE_INFO PE_REDIRECT PE_DONE PE_OK +our @EXPORT = qw( PE_IMG_NOK PE_IMG_OK PE_INFO PE_REDIRECT PE_DONE PE_OK PE_SESSIONEXPIRED PE_FORMEMPTY PE_WRONGMANAGERACCOUNT PE_USERNOTFOUND PE_BADCREDENTIALS PE_LDAPCONNECTFAILED PE_LDAPERROR PE_APACHESESSIONERROR PE_FIRSTACCESS PE_BADCERTIFICATE PE_PP_ACCOUNT_LOCKED PE_PP_PASSWORD_EXPIRED