From 5805b5f363bd657d3dac6aeba225438bf80cae9b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 18 Apr 2013 15:07:40 -0300 Subject: [PATCH 1/3] Bug 10074 - Encoding problems at login time Bug 6554 patched output_html_with_http_headers to encode utf8 data, and Templates.pm to expect utf8 data to be encoded. (At least) the staff login screen outputs directly to STDOUT (Auth.pm does, WHICH IS WRONG!) and wasn't fixed to do the encoding first. This patch makes it use output_html_with_http_headers and solves the problem. Changed 'use' for 'require' as jcamins and marcelr suggested. Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Marcel de Rooy Signed-off-by: Jared Camins-Esakov --- C4/Auth.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index ca061b5284..811151b628 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -19,6 +19,7 @@ package C4::Auth; use strict; use warnings; + use Digest::MD5 qw(md5_base64); use Storable qw(thaw freeze); use URI::Escape; @@ -1065,14 +1066,10 @@ sub checkauth { LibraryName => C4::Context->preference("LibraryName"), ); $template->param( %info ); -# $cookie = $query->cookie(CGISESSID => $session->id -# ); - print $query->header( - -type => 'text/html', - -charset => 'utf-8', - -cookie => $cookie - ), - $template->output; + + require C4::Output; + C4::Output::output_html_with_http_headers( $query, $cookie, + $template->output); safe_exit; } From d0c6e09429d2af711f911b57601a02f17591d441 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 18 Apr 2013 16:27:03 -0300 Subject: [PATCH 2/3] Bug 10074 - Encoding problems for installer Bug 6554 patched output_html_with_http_headers to encode utf8 data, and Templates.pm to expect utf8 data to be encoded. The Installer page login screen outputs directly to STDOUT (InstallAuthAuth.pm does, WHICH IS WRONG!) and wasn't fixed to do the encoding first. This patch makes it use output_html_with_http_headers and solves the problem. Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Marcel de Rooy Signed-off-by: Jared Camins-Esakov --- installer/InstallAuth.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/installer/InstallAuth.pm b/installer/InstallAuth.pm index 0015a14e2d..a86681565d 100644 --- a/installer/InstallAuth.pm +++ b/installer/InstallAuth.pm @@ -394,11 +394,8 @@ sub checkauth { -HttpOnly => 1, -expires => '' ); - print $query->header( - -type => 'text/html; charset=utf-8', - -cookie => $cookie - ), - $template->output; + + output_html_with_http_headers $query, $cookie, $template->output; exit; } From e848d89e45d3e6610c3e9d246bd3672636dd63fb Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 19 Apr 2013 14:44:35 +0200 Subject: [PATCH 3/3] Bug 10074: QA Followup for InstallAuth.pm Moving use Output.pm to optional require. Signed-off-by: Marcel de Rooy Signed-off-by: Jared Camins-Esakov --- installer/InstallAuth.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/InstallAuth.pm b/installer/InstallAuth.pm index a86681565d..1a8a4df89f 100644 --- a/installer/InstallAuth.pm +++ b/installer/InstallAuth.pm @@ -26,7 +26,6 @@ use Digest::MD5 qw(md5_base64); require Exporter; use C4::Context; -use C4::Output; use C4::Templates; use C4::Koha; use CGI::Session; @@ -395,7 +394,8 @@ sub checkauth { -expires => '' ); - output_html_with_http_headers $query, $cookie, $template->output; + require C4::Output; + C4::Output::output_html_with_http_headers($query,$cookie,$template->output); exit; }