Bugzilla – Attachment 144644 Details for
Bug 31699
Add a generic way to redirect back to the page you were on at login for modal logins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31699: Add 'return' option to opac modal login
Bug-31699-Add-return-option-to-opac-modal-login.patch (text/plain), 2.01 KB, created by
Martin Renvoize (ashimema)
on 2022-12-16 11:28:23 UTC
(
hide
)
Description:
Bug 31699: Add 'return' option to opac modal login
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-12-16 11:28:23 UTC
Size:
2.01 KB
patch
obsolete
>From 45d67ed92e2ccc9c360cac90c8ac8d1138734a9b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 6 Oct 2022 14:38:42 +0100 >Subject: [PATCH] Bug 31699: Add 'return' option to opac modal login > >This patch adds the option to trigger a redirect back to the current >context after successful login using modal logins triggered from various >places in the OPAC. > >To make use of this, simply add 'data-return="true"' to the modal trigger link. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 5 +++++ > opac/opac-user.pl | 10 ++++++++++ > 2 files changed, 15 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 6f5ae95c3fa..27fe084755e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -225,6 +225,11 @@ $(document).ready(function(){ > > $(".loginModal-trigger").on("click",function(e){ > e.preventDefault(); >+ var button = $(this); >+ var context = button.data('return'); >+ if ( context ) { >+ $('#modalAuth').append('<input type="hidden" name="return" value="'+window.location+'" />'); >+ } > $("#loginModal").modal("show"); > }); > $("#loginModal").on("shown.bs.modal", function(){ >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index ba45ddd2379..1b2aa815d29 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -424,4 +424,14 @@ if ($search_query) { > ); > } > >+# if not an empty string this indicates to return >+# back to the page we triggered the login from >+my $return = $query->param('return'); >+if ( $return ) { >+ print $query->redirect( >+ -uri => $return, >+ -cookie => $cookie, >+ ); >+} >+ > output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; >-- >2.39.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31699
:
141420
|
141421
|
142200
|
142201
|
142204
|
142205
|
142733
|
142734
|
143378
|
143463
|
143464
|
143465
|
143468
|
143469
|
143608
|
143643
| 144644 |
144645
|
144646