diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm index ed46e506d..71c5b4ace 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm @@ -15,7 +15,7 @@ use Unicode::String qw(utf8); use strict; our @EXPORT = qw(ldap); -our $VERSION = '1.3.0'; +our $VERSION = '1.3.2'; our $ppLoaded = 0; BEGIN { @@ -167,24 +167,7 @@ sub userBind { return ( $mesg->code == 0 ? PE_OK : PE_LDAPERROR ); } - # Get expiration warning and graces - if ( $resp->grace_authentications_remaining ) { - $self->{portal}->info( "

" - . $resp->grace_authentications_remaining . " " - . $self->{portal}->msg(PM_PP_GRACE) - . "

" ); - } - if ( $resp->time_before_expiration ) { - $self->{portal}->info( - "

" - . sprintf( - $self->{portal}->msg(PM_PP_EXP_WARNING), - $self->{portal}->convertSec( $resp->time_before_expiration ) - ) - . "

" - ); - } - + # Check for ppolicy error my $pp_error = $resp->pp_error; if ( defined $pp_error ) { $self->{portal}->_sub( 'userError', @@ -202,6 +185,26 @@ sub userBind { ]->[$pp_error]; } elsif ( $mesg->code == 0 ) { + + # Get expiration warning and graces + if ( $resp->grace_authentications_remaining ) { + $self->{portal}->info( "

" + . $resp->grace_authentications_remaining . " " + . $self->{portal}->msg(PM_PP_GRACE) + . "

" ); + } + if ( $resp->time_before_expiration ) { + $self->{portal}->info( + "

" + . sprintf( + $self->{portal}->msg(PM_PP_EXP_WARNING), + $self->{portal} + ->convertSec( $resp->time_before_expiration ) + ) + . "

" + ); + } + return PE_OK; } }