diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Custom.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Custom.pm index 5570a7df1..d72e0e8a2 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Custom.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Custom.pm @@ -9,10 +9,10 @@ sub new { die 'Custom Auth module not defined'; } - eval $self->{p}->loadModule( $self->{conf}->{customAuth} ); - ($@) - ? return $self->{p}->loadModule( $self->{conf}->{customAuth} ) - : die 'Unable to load Auth module ' . $self->{conf}->{customAuth}; + my $res; + eval { $res = $self->{p}->loadModule( $self->{conf}->{customAuth} ) }; + die 'Unable to load Auth module ' . $self->{conf}->{customAuth} if ($@); + return $res; } sub getDisplayType { diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OverConf.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OverConf.pm index 3d7f0f5b9..58aee16c1 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OverConf.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OverConf.pm @@ -27,7 +27,7 @@ sub loadModule { $nc = $self->conf; } return 0 - unless ( $obj = $self->p->loadModule( "$plugin", $nc ) and $obj->init ); + unless ( $obj = $self->p->loadModule( "$plugin", $nc ) ); return $obj; }