From 479a3fac28403d0023c454990323ae6fd2fa6c7a Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Sun, 10 Apr 2016 07:20:54 +0000 Subject: [PATCH] Login form is displayed (#595) --- lemonldap-ng-portal/example/index.fcgi | 12 ++++++++++++ .../example/skins/bootstrap/standardform.tpl | 2 +- .../lib/Lemonldap/NG/Portal/Main/Display.pm | 8 ++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lemonldap-ng-portal/example/index.fcgi b/lemonldap-ng-portal/example/index.fcgi index abf76cd93..86e60c5d6 100755 --- a/lemonldap-ng-portal/example/index.fcgi +++ b/lemonldap-ng-portal/example/index.fcgi @@ -1,5 +1,17 @@ #!/usr/bin/env perl +# TODO: remove this +BEGIN { + $pwd = `pwd`; + chomp $pwd; + eval qq{ + use lib "$pwd/../../lemonldap-ng-common/blib/lib"; + use lib "$pwd/../../lemonldap-ng-handler/blib/lib"; + use lib "$pwd/../../lemonldap-ng-portal/blib/lib"; + use lib "$pwd/../../lemonldap-ng-manager/blib/lib"; + }; + die $@ if ($@); +} use Plack::Handler::FCGI; use Lemonldap::NG::Portal::Main; diff --git a/lemonldap-ng-portal/example/skins/bootstrap/standardform.tpl b/lemonldap-ng-portal/example/skins/bootstrap/standardform.tpl index eb13c8943..b287c6c6b 100644 --- a/lemonldap-ng-portal/example/skins/bootstrap/standardform.tpl +++ b/lemonldap-ng-portal/example/skins/bootstrap/standardform.tpl @@ -1,7 +1,7 @@
- " trplaceholder="login" required /> + " trplaceholder="login" required />
diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm index b00ced2d4..2961d4ca1 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm @@ -44,6 +44,7 @@ sub display { # 1.1 Image mode if ( $req->{error} == PE_IMG_OK || $req->{error} == PE_IMG_NOK ) { + $self->lmLog( 'Request for file', 'debug' ); return staticFile( "common/" . ( $req->{error} == PE_IMG_OK ? 'ok.png' : 'warning.png' ) ); } @@ -181,12 +182,14 @@ sub display { # 2.5 Authentication has been refused OR this is the first access else { - $skinfile = 'login'; + $skinfile = 'login'; + my $login = $self->userId($req); + $login = '' if ( $login eq 'anonymous' ); %templateParams = ( AUTH_ERROR => $req->error, AUTH_ERROR_TYPE => $req->error_type, AUTH_URL => $self->get_url, - LOGIN => $self->user($req), + LOGIN => $login, CHECK_LOGINS => $self->conf->{portalCheckLogins}, ASK_LOGINS => $self->conf->{checkLogins}, DISPLAY_RESETPASSWORD => $self->conf->{portalDisplayResetPassword}, @@ -322,6 +325,7 @@ sub display { %templateParams = ( %templateParams, %$customParams ); } + $self->lmLog( "Skin returned: $skinfile", 'debug' ); return $self->sendHtml( $req, "$skinfile", params => \%templateParams ); }