lemonldap-ng/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Custom.pm

19 lines
474 B
Perl
Raw Normal View History

package Lemonldap::NG::Portal::Auth::Custom;
use strict;
2018-11-23 22:08:06 +01:00
# Fake 'new' method here. Return Lemonldap::NG::Portal::Auth::Custom::{CustomAuth}->new
sub new {
my ( $class, $self ) = @_;
unless ( $self->{conf}->{customAuth} ) {
2018-08-29 18:52:22 +02:00
die 'Custom Auth module not defined';
}
2018-08-29 18:52:22 +02:00
2018-11-29 21:12:43 +01:00
my $res;
eval { $res = $self->{p}->loadModule( $self->{conf}->{customAuth} ) };
die 'Unable to load Auth module ' . $self->{conf}->{customAuth} if ($@);
return $res;
}
1;