From 6e8efac7d017f14e94b7c331560edb70f1496385 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Fri, 10 Aug 2018 20:56:01 +0200 Subject: [PATCH] Display an explanation (#1487) --- .../lib/Lemonldap/NG/Portal/2F/Engines/Default.pm | 12 ++++++++---- .../site/htdocs/static/languages/ar.json | 1 + .../site/htdocs/static/languages/de.json | 1 + .../site/htdocs/static/languages/en.json | 1 + .../site/htdocs/static/languages/es.json | 1 + .../site/htdocs/static/languages/fr.json | 1 + .../site/htdocs/static/languages/it.json | 1 + .../site/htdocs/static/languages/nl.json | 1 + .../site/htdocs/static/languages/pt.json | 1 + .../site/htdocs/static/languages/ro.json | 1 + .../site/htdocs/static/languages/vi.json | 1 + .../site/templates/bootstrap/2fregisters.tpl | 8 +++++++- 12 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Engines/Default.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Engines/Default.pm index 174a764d4..be0e04464 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Engines/Default.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Engines/Default.pm @@ -281,7 +281,9 @@ sub _displayRegister { }; } } - if ( @am == 1 and not $req->userData->{_2fDevices} ) { + if ( @am == 1 + and not( $req->userData->{_2fDevices} or $req->data->{sfRegRequired} ) ) + { return [ 302, [ Location => $self->conf->{portal} . $am[0]->{URL} ], [] ]; } @@ -298,9 +300,10 @@ sub _displayRegister { $req, '2fregisters', params => { - SKIN => $self->conf->{portalSkin}, - MODULES => \@am, - SFDEVICES => $_2fDevices, + SKIN => $self->conf->{portalSkin}, + MODULES => \@am, + SFDEVICES => $_2fDevices, + REG_REQUIRED => $req->data->{sfRegRequired}, } ); } @@ -347,6 +350,7 @@ sub restoreSession { my $token = $req->pdata->{sfRegToken} or return [ 302, [ Location => $self->conf->{portal} ], [] ]; $req->userData( $self->ott->getToken( $token, 1 ) ); + $req->data->{sfRegRequired} = 1; return $req->method eq 'POST' ? $self->register( $req, @path ) : $self->_displayRegister( $req, @path ); diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/ar.json b/lemonldap-ng-portal/site/htdocs/static/languages/ar.json index 2e34a0a92..9ab2c6291 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/ar.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/ar.json @@ -86,6 +86,7 @@ "PE84":"أنت غير مخول بالدخول إلى هذا الخادم", "PE85":" الموقع البعيد يطلب جلسة جديدة (ولم يتم تحميل برنامج ترقية الجلسة).\nسجل الخروج و أعد المحاولة", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"قبول", "accessDenied":"ليس لديك إذن بالدخول لهذا التطبيق", "accountCreated":"تم إنشاء حسابك و إرسال كلمة المرور المؤقتة إلى بريدك الإلكتروني.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/de.json b/lemonldap-ng-portal/site/htdocs/static/languages/de.json index cb491109c..0294c902d 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/de.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/de.json @@ -86,6 +86,7 @@ "PE84":"You're not authorized to access to this host", "PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Accept", "accessDenied":"You have no access authorization for this application", "accountCreated":"Your account has been created, your temporary password has been sent to your mail address.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/en.json b/lemonldap-ng-portal/site/htdocs/static/languages/en.json index ba5adc66d..3a1e72779 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/en.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/en.json @@ -86,6 +86,7 @@ "PE84":"You're not authorized to access to this host", "PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Accept", "accessDenied":"You have no access authorization for this application", "accountCreated":"Your account has been created, your temporary password has been sent to your mail address.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/es.json b/lemonldap-ng-portal/site/htdocs/static/languages/es.json index 5f48a3454..d756ddd57 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/es.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/es.json @@ -86,6 +86,7 @@ "PE84":"You're not authorized to access to this host", "PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Accept", "accessDenied":"You have no access authorization for this application", "accountCreated":"Your account has been created, your temporary password has been sent to your mail address.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/fr.json b/lemonldap-ng-portal/site/htdocs/static/languages/fr.json index 3389d107c..19aca3fa5 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/fr.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/fr.json @@ -86,6 +86,7 @@ "PE84":"Vous n'êtes pas autorisé à accéder à ce site", "PE85":"Le site souhaite une authentification plus récente (et le plugin UpgradeSession n'est pas chargé). Déconnectez-vous et réessayez", "2FManagment":"Gestionnaire 2ndFA", +"2fRegRequired":"Ce service requiert une authentification à deux facteurs. Enregistrez un équipement ici et retournez au portail.", "accept":"Accepter", "accessDenied":"Vous n'avez pas les droits d'accès à cette application", "accountCreated":"Votre compte a été créé, un mot de passe temporaire a été envoyé à votre adresse mail.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/it.json b/lemonldap-ng-portal/site/htdocs/static/languages/it.json index ea0d8e9c0..c5b0013a9 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/it.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/it.json @@ -86,6 +86,7 @@ "PE84":"Non sei autorizzato ad accedere a questo host", "PE85":"Il sito remoto richiede una sessione più recente (e il plug-in di UpgradeSession non viene caricato). Disconnetti e riprova", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Accetta", "accessDenied":"Non hai un'autorizzazione di accesso per questa applicazione", "accountCreated":"Il tuo account è stato creato, la tua password temporanea è stata inviata all'indirizzo email.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/nl.json b/lemonldap-ng-portal/site/htdocs/static/languages/nl.json index 6779c76b3..89cf7db68 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/nl.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/nl.json @@ -86,6 +86,7 @@ "PE84":"You're not authorized to access to this host", "PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Accept", "accessDenied":"You have no access authorization for this application", "accountCreated":"Your account has been created, your temporary password has been sent to your mail address.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/pt.json b/lemonldap-ng-portal/site/htdocs/static/languages/pt.json index 45da2879d..92d1ff277 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/pt.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/pt.json @@ -86,6 +86,7 @@ "PE84":"You're not authorized to access to this host", "PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Accept", "accessDenied":"You have no access authorization for this application", "accountCreated":"Your account has been created, your temporary password has been sent to your mail address.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/ro.json b/lemonldap-ng-portal/site/htdocs/static/languages/ro.json index e31afec3e..a562c2a4e 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/ro.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/ro.json @@ -86,6 +86,7 @@ "PE84":"You're not authorized to access to this host", "PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Accept", "accessDenied":"You have no access authorization for this application", "accountCreated":"Your account has been created, your temporary password has been sent to your mail address.", diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/vi.json b/lemonldap-ng-portal/site/htdocs/static/languages/vi.json index 46afe95ee..f14b3be66 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/vi.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/vi.json @@ -86,6 +86,7 @@ "PE84":"Bạn không được phép truy cập vào máy chủ lưu trữ này", "PE85":"Trang web từ xa yêu cầu một phiên mới (và plugin UpgradeSession không được tải). Đăng xuất và thử lại ", "2FManagment":"2ndFA Management", +"2fRegRequired":"This service requires a double factor authentication. Register a device now, then go back to the portal.", "accept":"Chấp nhận", "accessDenied":"Bạn không có quyền truy cập vào ứng dụng này", "accountCreated":"Tài khoản của bạn đã được tạo, mật khẩu tạm thời của bạn đã được gửi đến địa chỉ mail của bạn.", diff --git a/lemonldap-ng-portal/site/templates/bootstrap/2fregisters.tpl b/lemonldap-ng-portal/site/templates/bootstrap/2fregisters.tpl index f646264af..83cbc34a2 100644 --- a/lemonldap-ng-portal/site/templates/bootstrap/2fregisters.tpl +++ b/lemonldap-ng-portal/site/templates/bootstrap/2fregisters.tpl @@ -1,7 +1,13 @@
-
+
+ + + + + +