From f8144bc10892876f765253071212a8bba622b2af Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Wed, 6 Feb 2019 22:54:15 +0100 Subject: [PATCH] Typo (#1625) --- .../lib/Lemonldap/NG/Portal/Issuer/CAS.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/CAS.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/CAS.pm index 3cce28b57..fddb2a810 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/CAS.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/CAS.pm @@ -27,18 +27,19 @@ has rule => ( is => 'rw', default => sub { {} } ); sub init { my ($self) = @_; - my $hd = $self->p->HANDLER; - $self->logger->debug( "CAS Rule -> " . $self->conf->{issuerDBCASRule} ); + # Parse activation rule + my $hd = $self->p->HANDLER; + $self->logger->debug( "CAS rule -> " . $self->conf->{issuerDBCASRule} ); my $rule = $hd->buildSub( $hd->substitute( $self->conf->{issuerDBCASRule} ) ); unless ($rule) { - $self->error( "Bad CAS rule " . $hd->tsv->{jail}->error ); + $self->error( "Bad CAS rule -> " . $hd->tsv->{jail}->error ); return 0; } $self->{rule} = $rule; - # Launch parents initialization subroutines, then launch IdP en SP lists + # Launch parents initialization subroutines, then launch IdP and SP lists my $res = $self->Lemonldap::NG::Portal::Main::Issuer::init(); return 0 unless ( $self->loadApp ); $self->addUnauthRoute( @@ -90,6 +91,7 @@ sub storeEnvAndCheckGateway { sub run { my ( $self, $req, $target ) = @_; + # Check activation rule unless ( $self->rule->( $req, $req->sessionInfo ) ) { $self->userLogger->error('CAS service not authorized'); return PE_CAS_SERVICE_NOT_ALLOWED;