@@ -, +, @@ --- C4/Auth.pm | 7 +++++++ installer/data/mysql/atomicupdate/shibOnly.perl | 6 ++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ .../prog/en/modules/admin/preferences/staff_client.pref | 7 +++++++ 4 files changed, 27 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/shibOnly.perl --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -1311,6 +1311,13 @@ sub checkauth { } if ($shib) { + #If shibOnly is enabled just go ahead and redirect directly + if ( (($type eq 'opac') && C4::Context->preference('opacShibOnly')) || (($type ne 'opac') && C4::Context->preference('staffShibOnly')) ) { + my $redirect_url = login_shib_url( $query ); + print $query->redirect($redirect_url); + safe_exit; + } + $template->param( shibbolethAuthentication => $shib, shibbolethLoginUrl => login_shib_url($query), --- a/installer/data/mysql/atomicupdate/shibOnly.perl +++ a/installer/data/mysql/atomicupdate/shibOnly.perl @@ -0,0 +1,6 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('opacShibOnly','0','If ON enables shibboleth only authentication for the opac','','YesNo'),('staffShibOnly','0','If ON enables shibboleth only authentication for the staff client','','YesNo')" ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug XXXXX - shibOnly preferences)\n"; +} --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -824,3 +824,10 @@ OPAC: - "The patron should see the charge description as " - pref: PayPalChargeDescription class: long + Authentication: + - + - pref: opacShibOnly + choices: + yes: "Don't allow" + no: Allow + - patrons to login by means other than Shibboleth. --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref @@ -167,3 +167,10 @@ Staff Client: yes: Show no: "Don't show" - a search field pulldown for 'Search the catalog' boxes. + Authentication: + - + - pref: staffShibOnly + choices: + yes: "Don't allow" + no: Allow + - staff to login by means other than shibboleth. --