From 02dd3a676922524e6b91ee7a73b9218df2119f5e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 3 Dec 2018 14:47:26 +0000 Subject: [PATCH] Bug 21934 - Allow user to specify name for 'Shibboleth' To test: 1 - Add a shibboleth config to your koha-conf.xml file (it does not need to be valid) 1 userid 2 - Note on staff and user auth pages the message says "Shibboleth account" 3 - Apply patch, update database 4 - Note login text has not changed 5 - Define a name in 'shibbolethName' 6 - Note it is reflected on all auth pages --- installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/admin.pref | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 5 +++-- koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 7 ++++--- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt | 11 ++++++----- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 1e36c306c6..11dc4a3b4f 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -521,6 +521,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'), ('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'), ('ShelfBrowserUsesLocation','1','1','Use the item location when finding items for the shelf browser.','YesNo'), +('shibbolethName','',NULL,'Specify the name for Shibboleth accounts, "Shibboleth" will be used if blank','Free'), ('ShowAllCheckins', '0', '', 'Show all checkins', 'YesNo'), ('showLastPatron','0','','If ON, enables the last patron feature in the intranet','YesNo'), ('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index 464c8c8e6a..3f57ecbc8e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -111,6 +111,10 @@ Administration: choices: yes: "Yes" no: "No" + - + - Refer to Shibboleth accounts as + - pref: shibbolethName + - "accounts. 'Shibboleth' will be used if left blank." CAS authentication: - - "Use CAS for login authentication: " diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt index 19548caf57..87a9e829f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -2,6 +2,7 @@ [% USE Koha %] [% USE Branches %] [% SET footerjs = 1 %] +[% SET shibbolethName = Koha.Preference('shibbolethName') || 'Shibboleth' %] [% INCLUDE 'doc-head-open.inc' %] Koha › [% IF ( nopermission ) %]Access denied[% END %] @@ -52,9 +53,9 @@ [% IF (shibbolethAuthentication) %] <!-- This is what is displayed if shib login has failed --> [% IF (invalidShibLogin ) %] -<div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div> +<div id="login_error"><Strong>Error: </strong>[% shibbolethName %] login failed</div> [% END %] -<p>If you have a shibboleth account, please <a href="[% shibbolethLoginUrl | url %]">click here</a> to login.</p> +<p>To use your [% shibbolethName %] account, please <a href="[% shibbolethLoginUrl | url %]">click here</a> to login.</p> [% END %] <!-- login prompt time--> diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index e9e42b28be..069e78f270 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -2,6 +2,7 @@ [% USE Koha %] [% USE Branches %] [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] +[% SET shibbolethName = Koha.Preference('shibbolethName') || 'Shibboleth' %] <div id="wrap"> <div id="header-region" class="noprint"> <div class="navbar navbar-inverse navbar-static-top"> @@ -303,11 +304,11 @@ [% IF ( invalidShibLogin ) %] <!-- This is what is displayed if shibboleth login has failed to match a koha user --> <div class="alert alert-info"> - <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p> + <p>Sorry, your [% shibbolethName %] identity does not match a valid library identity. If you have a local login, you may use that below.</p> </div> [% ELSE %] - <h4>Shibboleth login</h4> - <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl | url %]">click here to login</a>.</p> + <h4>[% shibbolethName %] login</h4> + <p>To use your [% shibbolethName %] account, please <a href="[% shibbolethLoginUrl | url %]">click here to login</a>.</p> <h4>Local Login</h4> [% END %] [% 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 71edf3c7ce..21491a6e94 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt @@ -1,5 +1,6 @@ [% USE raw %] [% USE Koha %] +[% SET shibbolethName = Koha.Preference('shibbolethName') || 'Shibboleth' %] [% INCLUDE 'doc-head-open.inc' %] <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] @@ -68,7 +69,7 @@ [% IF ( invalidShibLogin ) %] <!-- This is what is displayed if shibboleth login has failed to match a koha user --> <div class="alert alert-info"> - <p>Sorry, your Shibboleth identity does not match a valid library identity.</p> + <p>Sorry, your [% shibbolethName %] identity does not match a valid library identity.</p> [% IF ( casAuthentication ) %] [% IF ( invalidCasLogin ) %] <!-- This is what is displayed if cas login has failed --> @@ -81,15 +82,15 @@ [% END %] </div> [% ELSE %] - <h4>Shibboleth Login</h4> - <p><a href="[% shibbolethLoginUrl | url %]">If you have a Shibboleth account, please click here to log in.</a></p> + <h4>[% shibbolethName %] Login</h4> + <p><a href="[% shibbolethLoginUrl | url %]">To use your [% shibbolethName %] account, please click here to log in.</a></p> [% END %] [% IF ( casAuthentication ) %] <h4>CAS login</h4> - <p>If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.</p> + <p>If you do not have a [% shibbolethName %] account, but you do have a CAS account, you can use CAS.</p> [% ELSE %] <h4>Local login</h4> - <p>If you do not have a Shibboleth account, but you do have a local login, then you may login below.</p> + <p>If you do not have a [% shibbolethName %] account, but you do have a local login, then you may login below.</p> [% END %] [% END %] -- 2.11.0