Bug 15111: Do not include the antiClickjack legacy browser trick for greybox
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 22 Feb 2016 09:24:29 +0000 (09:24 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 14 Mar 2016 16:30:09 +0000 (16:30 +0000)
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>
koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt
koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-idref.tt

index ec26a85..90e4d47 100644 (file)
@@ -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" />
 
index 2d6e5b4..d6bbf45 100644 (file)
@@ -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' %]
index af60eab..0f517d9 100644 (file)
@@ -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() {
index 3753b20..bf22842 100644 (file)
@@ -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() {
index 0fa238b..54cf6c7 100644 (file)
@@ -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 ) %]
index c389c79..85a0191 100644 (file)
@@ -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; }