From ddc16155465845159ec062426c535badb97f0599 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Thu, 6 Apr 2017 11:33:12 +0000 Subject: [PATCH] Kerberos-by-Ajax skeleton (#707) TODO: write javascript --- .../lib/Lemonldap/NG/Common/PSGI.pm | 14 ++-- .../lib/Lemonldap/NG/Portal/Auth/Kerberos.pm | 65 ++++++++++++++++--- .../lib/Lemonldap/NG/Portal/Main/Display.pm | 45 +++++++++++++ 3 files changed, 109 insertions(+), 15 deletions(-) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm index 7969d9f0f..b4864300b 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm @@ -128,13 +128,6 @@ sub sendError { $err ||= $req->error; $code ||= 500; $self->lmLog( "Error $code: $err", $code > 499 ? 'error' : 'notice' ); - my $title = ( - $code >= 500 ? 'Server error' - : $code == 403 ? 'Forbidden' - : $code == 401 ? 'Authentication required' - : $code == 400 ? 'Bad request' - : 'Error' - ); # SOAP responses if ( $req->env->{HTTP_SOAPACTION} ) { @@ -166,6 +159,13 @@ sub sendError { # Default response: HTML else { + my $title = ( + $code >= 500 ? 'Server error' + : $code == 403 ? 'Forbidden' + : $code == 401 ? 'Authentication required' + : $code == 400 ? 'Bad request' + : 'Error' + ); my $s = "$title