From ab592a36aff82722766cfddff8e7e4e7ee72c0d7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 7 May 2019 10:15:56 +0100 Subject: [PATCH] Bug 18506: (follow-up) Make this play nicely with opacPublic Signed-off-by: Matthias Meusburger --- C4/Auth.pm | 17 +++++++++++++++++ koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/C4/Auth.pm b/C4/Auth.pm index 0c6d1fe..cc7f312 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1055,6 +1055,23 @@ sub checkauth { } } + # If shib configured and shibOnly enabled, we should ignore anything other than a shibboleth type login. + if ( + $shib + && !$shibSuccess + && ( + ( + ( $type eq 'opac' ) + && C4::Context->preference('opacShibOnly') + ) + || ( ( $type ne 'opac' ) + && C4::Context->preference('staffShibOnly') ) + ) + ) + { + $return = 0; + } + # $return: 1 = valid user if ($return) { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 184a605..8acf076 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -71,6 +71,8 @@ [% IF Koha.Preference('casAuthentication') %] [%# CAS authentication is too complicated for modal window %]
  • Log in to create your own lists
  • + [% ELSIF shibbolethAuthentication && Koha.Preference('opacShibOnly') %] +
  • Log in to create your own lists
  • [% ELSE %]
  • Log in to create your own lists
  • [% END %] @@ -95,6 +97,8 @@
  • [% ELSIF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
  • + [% ELSIF shibbolethAuthentication && Koha.Preference('opacShibOnly') %] +
  • [% ELSE %]
  • [% END %] -- 2.7.4