Bugzilla – Attachment 143465 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: (follow-up) Protect against unauthorized redirects
Bug-31699-follow-up-Protect-against-unauthorized-r.patch (text/plain), 1.54 KB, created by
Martin Renvoize (ashimema)
on 2022-11-09 08:29:02 UTC
(
hide
)
Description:
Bug 31699: (follow-up) Protect against unauthorized redirects
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-09 08:29:02 UTC
Size:
1.54 KB
patch
obsolete
>From 5fbd800e3e41511c41cfa4ce654df181138e8fb8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 9 Nov 2022 08:27:44 +0000 >Subject: [PATCH] Bug 31699: (follow-up) Protect against unauthorized redirects > >--- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 2 +- > opac/opac-user.pl | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 27fe084755..ce5d4f64b6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -228,7 +228,7 @@ $(document).ready(function(){ > var button = $(this); > var context = button.data('return'); > if ( context ) { >- $('#modalAuth').append('<input type="hidden" name="return" value="'+window.location+'" />'); >+ $('#modalAuth').append('<input type="hidden" name="return" value="'+window.location.pathname+window.location.search+'" />'); > } > $("#loginModal").modal("show"); > }); >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 1b2aa815d2..41397ac816 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -428,8 +428,10 @@ if ($search_query) { > # back to the page we triggered the login from > my $return = $query->param('return'); > if ( $return ) { >+ my $uri = C4::Context->('OPACBaseURL'); >+ $uri .= $return; > print $query->redirect( >- -uri => $return, >+ -uri => $uri, > -cookie => $cookie, > ); > } >-- >2.20.1
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