SAML: change error name to PE_IMG_OK and PE_IMG_NOK

This commit is contained in:
Thomas CHEMINEAU 2010-04-29 13:47:57 +00:00
parent 423541455b
commit 4f979bfe22
3 changed files with 8 additions and 7 deletions

View File

@ -48,9 +48,9 @@ my ( $skinfile, %templateParams );
if ( $portal->process() ) { if ( $portal->process() ) {
# 1.1 Image mode # 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'; $skinfile = $skin_dir . '/common/ok.png';
if ( $portal->{error} == PE_INFO_KO ) { if ( $portal->{error} == PE_IMG_NOK ) {
$skinfile = $skin_dir . '/common/warning.png'; $skinfile = $skin_dir . '/common/warning.png';
} }
$portal->printImage($skinfile, 'image/png'); $portal->printImage($skinfile, 'image/png');

View File

@ -175,6 +175,7 @@ sub issuerForUnAuthUser {
} }
# 1.3. SLO SOAP replay (send SOAP requests asynchronously) # 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 ) { if ( $url =~ /^(\Q$saml_slo_url_relay_soap\E)/i ) {
$self->lmLog( "URL $url detected as a relay service URL", 'debug' ); $self->lmLog( "URL $url detected as a relay service URL", 'debug' );
@ -229,10 +230,10 @@ sub issuerForUnAuthUser {
unless ($rstatus) { unless ($rstatus) {
$self->lmLog( "Fail to process SOAP logout request to $providerID", $self->lmLog( "Fail to process SOAP logout request to $providerID",
'error' ); 'error' );
return PE_INFO_KO; return PE_IMG_NOK;
} }
return PE_INFO_OK; return PE_IMG_OK;
} }

View File

@ -51,8 +51,8 @@ use constant {
# Portal errors # Portal errors
# Developers warning, do not use PE_INFO, it's reserved to autoRedirect. # Developers warning, do not use PE_INFO, it's reserved to autoRedirect.
# If you want to send an information, use $self->info('text'). # If you want to send an information, use $self->info('text').
PE_INFO_KO => -5, PE_IMG_NOK => -5,
PE_INFO_OK => -4, PE_IMG_OK => -4,
PE_INFO => -3, PE_INFO => -3,
PE_REDIRECT => -2, PE_REDIRECT => -2,
PE_DONE => -1, PE_DONE => -1,
@ -111,7 +111,7 @@ use constant {
}; };
# EXPORTER PARAMETERS # 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_SESSIONEXPIRED PE_FORMEMPTY PE_WRONGMANAGERACCOUNT PE_USERNOTFOUND
PE_BADCREDENTIALS PE_LDAPCONNECTFAILED PE_LDAPERROR PE_APACHESESSIONERROR PE_BADCREDENTIALS PE_LDAPCONNECTFAILED PE_LDAPERROR PE_APACHESESSIONERROR
PE_FIRSTACCESS PE_BADCERTIFICATE PE_PP_ACCOUNT_LOCKED PE_PP_PASSWORD_EXPIRED PE_FIRSTACCESS PE_BADCERTIFICATE PE_PP_ACCOUNT_LOCKED PE_PP_PASSWORD_EXPIRED