Bugzilla – Attachment 4840 Details for
Bug 5660
Webinstaller should check if KohaOpacLanguage exists in staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch (passed QA)
0001-5660-Webinstaller-should-check-if-KohaOpacLanguage-e.patch (text/plain), 2.14 KB, created by
Paul Poulain
on 2011-08-04 12:55:15 UTC
(
hide
)
Description:
proposed patch (passed QA)
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2011-08-04 12:55:15 UTC
Size:
2.14 KB
patch
obsolete
>From a5c608f1d7997a1c47ba9adc9f3fd82cfe8bdc24 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 7 Apr 2011 14:10:40 +0200 >Subject: [PATCH] 5660 Webinstaller should check if KohaOpacLanguage exists in staff > >Rebased on April 27 for master (3.05.00.001). > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> >--- > installer/InstallAuth.pm | 24 ++++++++++++++++++------ > 1 files changed, 18 insertions(+), 6 deletions(-) > >diff --git a/installer/InstallAuth.pm b/installer/InstallAuth.pm >index 26ba5a7..3efc407 100644 >--- a/installer/InstallAuth.pm >+++ b/installer/InstallAuth.pm >@@ -110,18 +110,15 @@ InstallAuth - Authenticates Koha users for Install process > sub get_template_and_user { > my $in = shift; > my $query = $in->{'query'}; >- my $language = $query->cookie('KohaOpacLanguage'); >- my $path = >- C4::Context->config('intrahtdocs') . "/prog/" >- . ( $language ? $language : "en" ); >- >+ my $language =_get_template_language($query->cookie('KohaOpacLanguage')); >+ my $path = C4::Context->config('intrahtdocs'). "/prog/". $language; >+ > my $tmplbase = $in->{template_name}; > $tmplbase=~ s/\.tmpl$/.tt/; > my $filename = "$path/modules/" . $tmplbase; > my $interface = 'intranet'; > my $template = C4::Templates->new( $interface, $filename, $tmplbase); > >- > my ( $user, $cookie, $sessionID, $flags ) = checkauth( > $in->{'query'}, > $in->{'authnotrequired'}, >@@ -160,6 +157,21 @@ sub get_template_and_user { > return ( $template, $borrowernumber, $cookie ); > } > >+sub _get_template_language { >+ #verify if opac language exists in staff (bug 5660) >+ #conditions are 1) dir exists and 2) enabled in prefs >+ my ($opaclang)= @_; >+ return 'en' unless $opaclang; >+ my $path= C4::Context->config('intrahtdocs')."/prog/$opaclang"; >+ my $pref= ','.C4::Context->preference('language').','; >+ if(-d $path) { >+ if($pref =~ /,$opaclang,/ ) { >+ return $opaclang; >+ } >+ } >+ return 'en'; >+} >+ > =item checkauth > > ($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type); >-- >1.7.4.1 >
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 5660
:
3025
|
3783
|
3856
|
3857
|
4008
|
4136
| 4840