From 42320f29c9fbaa332fa610c8e3e60a6607aaeae7 Mon Sep 17 00:00:00 2001 From: MJ Ray Date: Fri, 25 May 2012 12:20:36 +0100 Subject: [PATCH] bug 8155 - comply with UK Electronic Commerce (EC Directive) Regulations 2002 C4/Auth.pm: destroy the session and cookie if it is not needed installer/data/mysql/sysprefs.sql: change default for EnableOpacSearchHistory koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref: add note about this law koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt: add div#cookiewarning with consent request --- C4/Auth.pm | 17 +++++++++++++++++ installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/opac.pref | 4 ++-- koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index ffee1bb..66ab5fa 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -472,6 +472,23 @@ sub get_template_and_user { ); $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic")); + + # bug 8155 - comply with UK Electronic Commerce (EC Directive) Regulations 2002 + # if we are not using any features requiring a session, destroy it and avoid sending the CGISESSID cookie to the browser + if ( + !( + $user + || C4::Context->preference('EnableOpacSearchHistory') + || C4::Context->preference('OpacBrowseResults') + ) + ) + { + my $session = get_session($sessionID); + $session->delete(); + $session->flush(); + $template->param( SessionID => undef ); + $cookie = undef; + } } return ( $template, $borrowernumber, $cookie, $flags); } diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 49debd2..935e9e2 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -285,7 +285,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'If ON, displays patron image when a patron uses web-based self-checkout', '', 'YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '1', 'Enable or disable opac search history', 'YesNo',''); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '0', 'Enable or disable opac search history', 'YesNo',''); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingListAddReserves','1','If ON the patrons on routing lists are automatically added to holds on the issue.','','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'OpacAddMastheadLibraryPulldown', '0', '', 'Adds a pulldown menu to select the library to search on the opac masthead.', 'YesNo' ); INSERT INTO systempreferences VALUES ('ImageLimit',5,'','Limit images stored in the database by the Patron Card image manager to this number.','Integer'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index eb74d81..da9ddbc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -257,7 +257,7 @@ OPAC: choices: yes: Allow no: "Don't allow" - - patrons to browse subject authorities on OPAC (run misc/cronjobs/build_browser_and_cloud.pl to create the browser list) + - patrons to browse subject authorities on OPAC (run misc/cronjobs/build_browser_and_cloud.pl to create the browser list) ("Allow" sets a cookie on every page, which may break UK/EU law in some situations.) - - pref: OpacAuthorities choices: @@ -436,7 +436,7 @@ OPAC: choices: yes: Keep no: "Don't keep" - - patron search history in the OPAC. + - patron search history in the OPAC. ("Keep" sets a cookie on every page, may break UK/EU law in some situations.) - - pref: OPACPrivacy default: 0 diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt index a73c8bb..a329818 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt @@ -84,6 +84,7 @@ please choose against which one you would like to authenticate:

+

Logging in here will save a small piece of information (a cookie) in your browser, to avoid sending your password on every page. For more information, see AllAboutCookies.org.

Don't have a password yet?

If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.

Don't have a library card?

If you don't have a library card, stop by your local library to sign up.

-- 1.7.2.5