From 84fd4321b964b3772d4a6a90daa374e71874aa72 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 26 Jun 2019 11:11:14 +0100 Subject: [PATCH] Bug 18506: (follow-up) Handle shibOnly in opac-auth.tt This patch adds the shibOnly conditional to the opac-auth.tt template such that if shibOnly is enabled then only the shibboleth login link ,and any shibboleth login errors if there are any, will display. It does not however preclude SCO and SCI login, those are still available if when SCO_login or SCI_login parameters are passed. Signed-off-by: Matthias Meusburger --- .../opac-tmpl/bootstrap/en/modules/opac-auth.tt | 196 ++++++++++++--------- 1 file changed, 108 insertions(+), 88 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt index 348a830..ab16cee 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt @@ -44,25 +44,24 @@

Log in to your account

[% IF ( timed_out ) %] - -
-

Sorry, your session has timed out. Please log in again.

-
+ +
+

Sorry, your session has timed out. Please log in again.

+
[% END %] [% IF ( different_ip ) %] - -
-

You are logging from a different IP address. Please log in again.

-
+ +
+

You are logging from a different IP address. Please log in again.

+
[% END %] - [% IF invalid_username_or_password || too_many_login_attempts %] - -
-

You entered an incorrect username or password. Please try again! But note that passwords are case sensitive[% IF Koha.Preference('FailedLoginAttempts') %] and that your account will be locked out after a fixed number of failed login attempts[% END %]. Please contact a library staff member if you continue to have problems.

-
+ +
+

You entered an incorrect username or password. Please try again! But note that passwords are case sensitive[% IF Koha.Preference('FailedLoginAttempts') %] and that your account will be locked out after a fixed number of failed login attempts[% END %]. Please contact a library staff member if you continue to have problems.

+
[% END %] [% IF ( shibbolethAuthentication ) %] @@ -70,94 +69,114 @@

Sorry, your Shibboleth identity does not match a valid library identity.

- [% IF ( casAuthentication ) %] - [% IF ( invalidCasLogin ) %] - -

Sorry, the CAS login also failed. If you have a local login you may use that below.

+ [% UNLESS ( Koha.Preference('opacShibOnly') ) %] + [% IF ( casAuthentication ) %] + [% IF ( invalidCasLogin ) %] + +

Sorry, the CAS login also failed. If you have a local login you may use that below.

+ [% ELSE %] +

If you have a CAS account, you may use that below.

+ [% END %] [% ELSE %] -

If you have a CAS account, you may use that below.

+

If you have a local account, you may use that below.

[% END %] - [% ELSE %] -

If you have a local account, you may use that below.

[% END %]
- [% ELSE %] -

Shibboleth Login

-

If you have a Shibboleth account, please click here to log in.

- [% END %] - [% IF ( casAuthentication ) %] -

CAS login

-

If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.

- [% ELSE %] -

Local login

-

If you do not have a Shibboleth account, but you do have a local login, then you may login below.

- [% END %] - - [% END %] - - [% IF ( casAuthentication ) %] - [% IF ( shibbolethAuthentication ) %] - [% IF ( casServerUrl ) %] -

Please click here to log in.

+ [% ELSE %] +

Shibboleth Login

+

If you have a Shibboleth account, please click here to log in.

+ [% END %] + [% UNLESS ( Koha.Preference('opacShibOnly') ) %] + [% IF ( casAuthentication ) %] +

CAS login

+

If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.

+ [% ELSE %] +

Local login

+

If you do not have a Shibboleth account, but you do have a local login, then you may login below.

+ [% END %] [% END %] + [% END # / IF shibbolethAuthentication %] - [% IF ( casServersLoop ) %] -

Please choose against which one you would like to authenticate:

- - [% END %] - [% ELSE %] -

CAS login

- [% IF ( invalidCasLogin ) %] - -

Sorry, the CAS login failed.

- [% END %] + [% IF ( casServersLoop ) %] +

Please choose against which one you would like to authenticate:

+ + [% END %] + [% ELSE %] +

CAS login

- [% IF ( casServerUrl ) %] -

If you have a CAS account, please click here to log in.

- [% END %] + [% IF ( invalidCasLogin ) %] + +

Sorry, the CAS login failed.

+ [% END %] - [% IF ( casServersLoop ) %] -

If you have a CAS account, please choose against which one you would like to authenticate:

- - [% END %] - [% END %] - [% IF ( shibbolethAuthentication ) %] -

Nothing

- [% ELSE %] -

Local login

-

If you do not have a CAS account, but do have a local account, you can still log in:

- [% END %] + [% IF ( casServersLoop ) %] +

If you have a CAS account, please choose against which one you would like to authenticate:

+ + [% END %] + [% END %] - [% END # / IF casAuthentication %] + [% IF ( shibbolethAuthentication ) %] +

Nothing

+ [% ELSE %] +

Local login

+

If you do not have a CAS account, but do have a local account, you can still log in:

+ [% END %] + [% END # / IF casAuthentication %] + + [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %] + [% IF ( invalidGoogleOpenIDConnectLogin ) %] +

Google login

+

Sorry, your Google login failed. [% invalidGoogleOpenIDConnectLogin | html %]

+

Please note that the Google login will only work if you are using the e-mail address registered with this library.

+

If you want to, you can try to log in using a different account + [% END %] + Log in with Google +

If you do not have a Google account, but do have a local account, you can still log in:

+ [% END # / IF GoogleOpenIdConnect %] + [% END # / UNLESS opacShibOnly %] - [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %] - [% IF ( invalidGoogleOpenIDConnectLogin ) %] -

Google login

-

Sorry, your Google login failed. [% invalidGoogleOpenIDConnectLogin | html %]

-

Please note that the Google login will only work if you are using the e-mail address registered with this library.

-

If you want to, you can try to log in using a different account - [% END %] - Log in with Google -

If you do not have a Google account, but do have a local account, you can still log in:

- [% END %] + [% IF SCO_login or SCI_login %] + [% IF SCO_login %] +
+ [% ELSIF SCI_login %] + + [% END %] + +
+ [% FOREACH INPUT IN INPUTS %] + + [% END %] + + + +
- [% IF SCO_login %] - - [% ELSIF SCI_login %] - - [% ELSE %] + + +
+ + [% ELSE # / IF SCO_login or SCI_login %] + [% UNLESS ( Koha.Preference('opacShibOnly') ) %]
- [% END %]
[% FOREACH INPUT IN INPUTS %] @@ -175,6 +194,8 @@ Forgot your password? [% END %] + + [% END # / UNLESS opacShibOnly %]
[% IF Koha.Preference('OpacLoginInstructions') %] [% Koha.Preference('OpacLoginInstructions') | $raw %] @@ -185,10 +206,9 @@

If you don't have a library card, stop by your local library to sign up.

[% END # / IF Koha.Preference('OpacLoginInstructions') %] - [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]You may register here. - [% END %] + [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]You may register here.[% END %]
- + [% END # / IF SCO_login or SCI_login %] [% END # / IF loginprompt %] [% ELSE %] -- 2.7.4