From 2735520c1675440143fa5cb4b478662744a2c67b Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Sun, 19 Feb 2017 07:17:42 +0000 Subject: [PATCH] Don't use "login" to display errors for connected users (#595) --- .../lib/Lemonldap/NG/Portal/Main/Display.pm | 16 ++++++++++------ .../site/templates/bootstrap/error.tpl | 9 +++------ .../site/templates/impact/error.tpl | 3 +++ .../site/templates/pastel/error.tpl | 4 ++++ 4 files changed, 20 insertions(+), 12 deletions(-) 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 291e8198d..ca83811e1 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm @@ -142,16 +142,11 @@ sub display { } # 2.2 Case : display menu (with error or not) - elsif ( $req->error == PE_OK or ( $req->userData and %{ $req->userData } ) ) - { - + elsif ( $req->error == PE_OK ) { $skinfile = 'menu'; #utf8::decode($auth_user); - %templateParams = ( - AUTH_ERROR => $req->error, - AUTH_ERROR_TYPE => $req->error_type, AUTH_USER => $req->{sessionInfo}->{ $self->conf->{portalUserAttr} }, NEWWINDOW => $self->conf->{portalOpenLinkInNewWindow}, LOGOUT_URL => $self->conf->{portal} . "?logout=1", @@ -161,6 +156,15 @@ sub display { ); } + # 2.3 Case : user authenticated but an error was returned (bas url,...) + elsif ( $req->userData and %{ $req->userData } ) { + $skinfile = 'error'; + %templateParams = ( + AUTH_ERROR => $req->error, + AUTH_ERROR_TYPE => $req->error_type, + ); + } + # 3 Authentication has been refused OR first access else { $skinfile = 'login'; diff --git a/lemonldap-ng-portal/site/templates/bootstrap/error.tpl b/lemonldap-ng-portal/site/templates/bootstrap/error.tpl index 7a92ce0a7..0c82500b8 100644 --- a/lemonldap-ng-portal/site/templates/bootstrap/error.tpl +++ b/lemonldap-ng-portal/site/templates/bootstrap/error.tpl @@ -1,7 +1,8 @@ -
- + +
alert">">
+
You have no access authorization for this application @@ -21,7 +22,6 @@
-
You were redirect from @@ -41,9 +41,6 @@
-
-
- diff --git a/lemonldap-ng-portal/site/templates/impact/error.tpl b/lemonldap-ng-portal/site/templates/impact/error.tpl index 0dbe45271..194efdf48 100644 --- a/lemonldap-ng-portal/site/templates/impact/error.tpl +++ b/lemonldap-ng-portal/site/templates/impact/error.tpl @@ -8,6 +8,9 @@

+ +

">

+

You have no access authorization for this application

diff --git a/lemonldap-ng-portal/site/templates/pastel/error.tpl b/lemonldap-ng-portal/site/templates/pastel/error.tpl index 9ef674562..8152a8d2d 100644 --- a/lemonldap-ng-portal/site/templates/pastel/error.tpl +++ b/lemonldap-ng-portal/site/templates/pastel/error.tpl @@ -2,6 +2,10 @@
+ +
">
  • ">
+
+
  • You have no access authorization for this application