Browse Source

Bug 15111: Do not include the antiClickjack legacy browser trick for greybox

Most of the scripts called via greybox (which uses iframe) don't include
doc-head-close. But some do.
This patch adds a popup parameter for these templates, not to include
the legacy browser trick and avoid the replacement of the location.

Test plan:
1/ Export patroncard and label
2/ translate itemtypes
3/ click on a idref link at the OPAC

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
new_12478_elasticsearch
Jonathan Druart 8 years ago
committed by Kyle M Hall
parent
commit
fc640d2a86
  1. 20
      koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
  2. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt
  3. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt
  4. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt
  5. 20
      koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc
  6. 2
      koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-idref.tt

20
koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc

@ -4,15 +4,17 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[%# Prevent XFS attacks -%]
<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
[% UNLESS popup %]
<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
[% END %]
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt

@ -1,6 +1,6 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Localization</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'datatables.inc' %]

2
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt

@ -1,6 +1,6 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Label printing/exporting</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
<script type="text/javascript">
//<![CDATA[
function Done() {

2
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt

@ -1,6 +1,6 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Patron cards &rsaquo; Patron card printing/exporting</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'doc-head-close.inc' popup => 1%]
<script type="text/javascript">
//<![CDATA[
function Done() {

20
koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc

@ -3,15 +3,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
[%# Prevent XFS attacks -%]
<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
[% UNLESS popup %]
<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
[% END %]
<link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% interface %]/[% theme %]/images/favicon.ico[% END %]" type="image/x-icon" />
[% IF ( bidi ) %]

2
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-idref.tt

@ -1,7 +1,7 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your search IDREF for ppn [% unimarc3 %]</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
[% BLOCK cssinclude %]
<style type="text/css">
ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a { padding:0.6em 1em; }

Loading…
Cancel
Save