diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm index a35ff58d3..619c3f1d4 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -473,19 +473,20 @@ sub new { return $self; } -##@method boolean loadModule(string module) +##@method boolean loadModule(string module, boolean ignoreError) # Load a module into portal namespace # @param module module name +# @param ignoreError set to 1 if error should not appear in logs # @return boolean sub loadModule { - my ( $self, $module ) = splice @_; + my ( $self, $module, $ignoreError ) = splice @_; return 1 unless $module; # Load module test eval "require $module"; if ($@) { - $self->lmLog( "$module load error: $@", 'error' ); + $self->lmLog( "$module load error: $@", 'error' ) unless $ignoreError; return 0; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm index ab8e2b92c..78732c6af 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm @@ -8,7 +8,7 @@ package Lemonldap::NG::Portal::_Choice; use Lemonldap::NG::Portal::Simple; -our $VERSION = '1.2.0'; +our $VERSION = '1.3.0'; ## @cmethod Lemonldap::NG::Portal::_Choice new(Lemonldap::NG::Portal::Simple portal) # Constructor @@ -41,7 +41,7 @@ sub new { my $samlModule = 'Lemonldap::NG::Portal::AuthSAML'; my $samlForce = 0; eval { - $portal->loadModule($samlModule); + $portal->loadModule( $samlModule, 1 ); $authForce = $samlModule . '::authForce'; $samlForce = $portal->$authForce; };