From 5415cec1fcd46222852239a9837a6fa767ebab94 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 3 Feb 2021 15:48:29 +0000 Subject: [PATCH] Bug 18506: (QA follow-up) Indentation and more conditionals Indentation fixes for readability Cleaned up a few places where the ability to login otherwise was leakign through Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/modules/auth.tt | 120 +++++----- .../bootstrap/en/includes/masthead.inc | 54 +++-- .../bootstrap/en/modules/opac-auth.tt | 218 +++++++++--------- .../bootstrap/en/modules/opac-main.tt | 2 +- 4 files changed, 201 insertions(+), 193 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt index 8d4cf0c240..b4a5448413 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -61,78 +61,80 @@

If you have a shibboleth account, please click here to login.

[% END %] - -
- -[% FOREACH INPUT IN INPUTS %] - -[% END %] -

- -

-

- -

- -[% UNLESS IndependentBranches %] -

- - +[% UNLESS Koha.Preference('staffShibOnly') %] + + + + [% FOREACH INPUT IN INPUTS %] + + [% END %] +

+ +

+

+

- [% IF Koha.Preference('UseCirculationDesks') && Desks.all %] + [% UNLESS IndependentBranches %]

- - + + [% FOREACH l IN Branches.all( unfiltered => 1 ) %] + + [% END %]

- [% END %] - [% IF Koha.Preference('UseCashRegisters') && Registers.all().size %] -

- - -

- [% END %] + [% IF Koha.Preference('UseCirculationDesks') && Desks.all %] +

+ + +

+ [% END %] + + [% IF Koha.Preference('UseCashRegisters') && Registers.all().size %] +

+ + +

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

-
-[% IF ( casAuthentication ) %] -

Cas login

+

+ + [% IF ( casAuthentication ) %] +

Cas login

-[% IF ( invalidCasLogin ) %] - -

Sorry, the CAS login failed.

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

Sorry, the CAS login failed.

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

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

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

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

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

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

-
    - [% FOREACH casServer IN casServersLoop %] -
  • [% casServer.name | html %]
  • + [% IF ( casServersLoop ) %] +

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

    +
      + [% FOREACH casServer IN casServersLoop %] +
    • [% casServer.name | html %]
    • + [% END %] + [% END %] [% END %] -[% END %] [% END %] [% IF ( nopermission ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 9436d99e49..34b9eaca24 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -379,33 +379,39 @@ [% ELSE %]

      Shibboleth login

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

      -

      Local Login

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

      Local Login

      + [% END %] [% END %] [% END %] - -
      - - - [% IF Koha.Preference( 'OpacLoginInstructions' ) %] -
      - [% Koha.Preference( 'OpacLoginInstructions' ) | $raw %] -
      - [% END %] - [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %] - - [% END %] - [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] -
      -

      Don't have an account? Register here.

      -
      - [% END %] -
      - - + [% UNLESS Koha.Preference('opacShibOnly') %] + + [% END %] 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 a773d58e25..14432ecb85 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt @@ -80,16 +80,16 @@

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

      [% 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.

      + [% 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 %] [% END %]
      [% ELSE %] @@ -97,124 +97,124 @@

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

      [% END # /IF invalidShibLogin %] [% 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 %] + [% 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 %] [% UNLESS ( Koha.Preference('OPACShibOnly') ) %] - [% IF ( casAuthentication ) %] - [% IF ( shibbolethAuthentication ) %] - [% IF ( casServerUrl ) %] -

      Please click here to log in.

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

      Please click here to log in.

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

      Please choose against which one you would like to authenticate:

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

      CAS login

      - [% 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 ( invalidCasLogin ) %] - -

      Sorry, the CAS login failed.

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

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

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

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

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

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

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

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

      - + [% 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 shibbolethAuthentication %] - [% 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 %] - [% 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 %] + [% 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('OPACShibOnly') or SCO_login or SCI_login %] - [% IF SCO_login %] -
      - [% ELSIF SCI_login %] - - [% ELSE %] - - [% END %] - - -
      - [% FOREACH INPUT IN INPUTS %] - [% NEXT IF INPUT.name == 'logout.x' %] - - [% END %] -
      - - -
      -
      - - -
      -
      - + [% IF SCO_login %] + + [% ELSIF SCI_login %] + + [% ELSE %] + + [% END %] + + +
      + [% FOREACH INPUT IN INPUTS %] + [% NEXT IF INPUT.name == 'logout.x' %] + + [% END %] +
      + + +
      +
      + + +
      +
      + +
      -
      - [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %] - - [% END %] -
      - [% IF Koha.Preference('OpacLoginInstructions') %] - [% Koha.Preference('OpacLoginInstructions') | $raw %] - [% ELSE %] -

      Don't have a password yet?

      -

      If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.

      -

      Don't have a library card?

      -

      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. - + [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %] + [% END %] -
      - +
      + [% IF Koha.Preference('OpacLoginInstructions') %] + [% Koha.Preference('OpacLoginInstructions') | $raw %] + [% ELSE %] +

      Don't have a password yet?

      +

      If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.

      +

      Don't have a library card?

      +

      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 %] +
      + [% END # / IF !OPACShibOnly or SCO_login or SCI_login %] [% END # / IF loginprompt %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt index f2ccf82271..181fb9a0db 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt @@ -181,7 +181,7 @@
      [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] [% UNLESS ( loggedinusername ) %] - [% UNLESS ( casAuthentication || shibbolethAuthentication ) %] + [% UNLESS ( casAuthentication || shibbolethAuthentication || Koha.Preference('opacShibOnly') ) %]
      -- 2.20.1