From a16d452a624244d4bc093e780f8b39b295fd4ce8 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Sun, 3 Apr 2016 16:51:23 +0000 Subject: [PATCH] AuthDemo asks for auth (#595) --- .../lib/Lemonldap/NG/Portal/Main.pm | 2 +- .../lib/Lemonldap/NG/Portal/Main/Plugins.pm | 21 ++++++++++--------- .../lib/Lemonldap/NG/Portal/Main/Process.pm | 2 +- .../lib/Lemonldap/NG/Portal/Main/Run.pm | 6 ++++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main.pm index 7a5e784cf..b9659c4c7 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main.pm @@ -6,8 +6,8 @@ use Mouse; our $VERSION = '2.0.0'; extends( - 'Lemonldap::NG::Portal::Main::Init', 'Lemonldap::NG::Portal::Main::Run', + 'Lemonldap::NG::Portal::Main::Init', ); 1; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugins.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugins.pm index 12dec8e85..17191bd52 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugins.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugins.pm @@ -24,22 +24,22 @@ sub enabledPlugins { # Check if captcha is required # TODO: verify if this list is OK - foreach my $key ( - qw(captcha_login_enabled captcha_mail_enabled captcha_register_enabled)) - { - if ( $self->conf->{$key} ) { - $self->lmLog( 'Captcha enabled', 'debug' ); - push @res, '::Plugins::Captcha'; - last; - } - } + #foreach my $key ( + # qw(captcha_login_enabled captcha_mail_enabled captcha_register_enabled)) + #{ + # if ( $self->conf->{$key} ) { + # $self->lmLog( 'Captcha enabled', 'debug' ); + # push @res, '::Plugins::Captcha'; + # last; + # } + #} # Check if SOAP is enabled # TODO: REST push @res, 'SOAP' if ( $self->conf->{Soap} ); # Check if notification is enabled - push @res, '::Plugins::Notifications' if ( $self->conf->{notification} ); + push @res, '::Plugins::Notifications' if ( $self->conf->{notifications} ); foreach my $type (qw(password register)) { my $tmp = $self->conf->{$type}; if ( $tmp and $tmp ne 'Null' ) { @@ -60,6 +60,7 @@ sub enabledPlugins { $self->lmLog( 'Custom plugins: ' . $self->conf->{plugins}, 'debug' ); push @res, grep ( /\w/, split( /,\s*/, $self->conf->{plugins} ) ); } + return @res; } 1; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm index df72fb789..f1193f808 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm @@ -44,7 +44,7 @@ sub restoreArgs { # Verify url parameter sub controlUrl { my ( $self, $req ) = @_; - $req->datas->{_url} ||= ''; + $req->{datas}->{_url} ||= ''; if ( my $url = $req->param('url') ) { # REJECT NON BASE64 URL diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm index 2a08df4c5..c12565979 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm @@ -16,6 +16,8 @@ use Lemonldap::NG::Portal::Main::Request; extends 'Lemonldap::NG::Portal::Main::Process'; +use constant HANDLER => 'Lemonldap::NG::Handler::PSGI::API'; + our $VERSION = '2.0.0'; # List constants @@ -34,14 +36,14 @@ sub sessionDatas { # Lemonldap::NG::Portal::Main::Request # - launch Lemonldap::NG::Common::PSGI::Request::handler() sub handler { - my ( $self, $req ) = shift; + my ( $self, $req ) = @_; unless ($self->conf->{cfgNum} and $self->conf->{cfgNum} eq HANDLER->lmConf->{cfgNum} ) { $self->reloadConf(); } bless $req, 'Lemonldap::NG::Portal::Main::Request'; - return $self->SUPER::handler($req); + return $self->Lemonldap::NG::Common::PSGI::Router::handler($req); } # MAIN ENTRY POINTS (declared in Lemonldap::NG::Portal::Main::Init)