Bug 30979: Add modal trigger to shibboleth target url

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2023-02-20 17:02:05 +00:00 committed by Tomas Cohen Arazi
parent 1d2539b803
commit 89b008bccd
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 4 additions and 1 deletions

View File

@ -385,7 +385,7 @@
</div>
[% ELSE %]
<h3>Shibboleth login</h3>
<p><a href="[% shibbolethLoginUrl | $raw %]">Log in using a Shibboleth account</a>.</p>
<p><a id="shib_url" href="[% shibbolethLoginUrl | $raw %]">Log in using a Shibboleth account</a>.</p>
[% UNLESS Koha.Preference('opacShibOnly') %]
<h3>Local login</h3>
[% END %]

View File

@ -68,6 +68,9 @@ $(document).ready(function() {
let url = new URL(window.location.href);
url.searchParams.append('modal','checkout');
$('#modalAuth').append('<input type="hidden" name="return" value="' + url.href +'" />');
$('#shib_login').each(function(){
this.url = this.url.replace(/target=(.*)/, "target=" + url.href);
});
$('#loginModal').modal('show');
return false;
}