lemonldap-ng/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2.pm

51 lines
1.0 KiB
Perl
Raw Normal View History

2017-02-16 08:37:40 +01:00
# LLNG platform class for Apache-2/ModPerl-2
#
2019-02-04 20:58:04 +01:00
# See https://lemonldap-ng.org/documentation/latest/handlerarch
package Lemonldap::NG::Handler::ApacheMP2;
use strict;
use Lemonldap::NG::Handler::ApacheMP2::Request;
2017-02-08 23:18:52 +01:00
use Lemonldap::NG::Handler::ApacheMP2::Main;
our $VERSION = '2.0.0';
# PUBLIC METHODS
sub handler {
2017-02-09 07:24:12 +01:00
shift if ($#_);
return launch( 'run', @_ );
2017-02-09 07:24:12 +01:00
}
sub logout {
shift if ($#_);
return launch( 'unlog', @_ );
2017-02-09 07:24:12 +01:00
}
sub reload {
shift if ($#_);
return launch( 'reload', @_ );
}
2017-02-09 07:24:12 +01:00
sub status {
shift if ($#_);
return launch( 'getStatus', @_ );
2017-02-09 07:24:12 +01:00
}
# Internal method to get class to load
sub launch {
my ( $sub, $r ) = @_;
2017-03-29 07:02:56 +02:00
my $req = Lemonldap::NG::Handler::ApacheMP2::Request->new($r);
my $type = Lemonldap::NG::Handler::ApacheMP2::Main->checkType($req);
2017-03-29 07:02:56 +02:00
if ( my $t = $r->dir_config('VHOSTTYPE') ) {
$type = $t;
}
2017-02-08 23:18:52 +01:00
my $class = "Lemonldap::NG::Handler::ApacheMP2::$type";
eval "require $class";
2017-02-09 07:24:12 +01:00
die $@ if ($@);
2017-03-29 07:17:35 +02:00
my ($res) = $class->$sub($req);
return $res;
}
1;