Bugzilla – Attachment 61741 Details for
Bug 18019
Add CSRF protection to authorities-home.pl (op==delete)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18019: [QA Follow-up] Also catch the delete from authorities detail
Bug-18019-QA-Follow-up-Also-catch-the-delete-from-.patch (text/plain), 2.12 KB, created by
Jonathan Druart
on 2017-03-30 18:13:51 UTC
(
hide
)
Description:
Bug 18019: [QA Follow-up] Also catch the delete from authorities detail
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-03-30 18:13:51 UTC
Size:
2.12 KB
patch
obsolete
>From f432203a7094e6af870fe3123b79825286842581 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 30 Mar 2017 10:20:30 +0200 >Subject: [PATCH] Bug 18019: [QA Follow-up] Also catch the delete from > authorities detail > >Good catch from Jonathan. See comment11. >Authorities detail should pass a CSRF token to authorities-home when >deleting a record without linked biblios. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Passing the token with GET is not a good way to do, but nothing quick to >replace that. >--- > authorities/detail.pl | 2 ++ > koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > >diff --git a/authorities/detail.pl b/authorities/detail.pl >index 1ba280d..38af541 100755 >--- a/authorities/detail.pl >+++ b/authorities/detail.pl >@@ -50,6 +50,7 @@ use C4::Koha; > use Koha::Authorities; > > use Koha::Authority::Types; >+use Koha::Token; > > our ($tagslib); > >@@ -219,6 +220,7 @@ $template->param( > authtypetext => $authority_types->find($authtypecode)->authtypetext, > authtypecode => $authtypecode, > authority_types => $authority_types, >+ csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $query->cookie('CGISESSID') }), > ); > > $template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt >index 295c325..e150232 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt >@@ -34,7 +34,7 @@ > function confirm_deletion() { > var is_confirmed = confirm(_("Are you sure you want to delete this authority?")); > if (is_confirmed) { >- window.location="authorities-home.pl?op=delete&authid=[% authid %]"; >+ window.location="authorities-home.pl?op=delete&authid=[% authid %]&csrf_token=[% csrf_token %]"; > } > } > function Dopop(link) { >-- >2.9.3
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 18019
:
59969
|
59971
|
60417
|
61672
|
61673
|
61732
|
61740
| 61741