Lines 109-118
InstallAuth - Authenticates Koha users for Install process
Link Here
|
109 |
sub get_template_and_user { |
109 |
sub get_template_and_user { |
110 |
my $in = shift; |
110 |
my $in = shift; |
111 |
my $query = $in->{'query'}; |
111 |
my $query = $in->{'query'}; |
112 |
my $language = $query->cookie('KohaOpacLanguage'); |
112 |
my $language =_get_template_language($query->cookie('KohaOpacLanguage')); |
113 |
my $path = |
113 |
my $path = C4::Context->config('intrahtdocs'). "/prog/". $language; |
114 |
C4::Context->config('intrahtdocs') . "/prog/" |
|
|
115 |
. ( $language ? $language : "en" ); |
116 |
my $template = HTML::Template::Pro->new( |
114 |
my $template = HTML::Template::Pro->new( |
117 |
filename => "$path/modules/" . $in->{template_name}, |
115 |
filename => "$path/modules/" . $in->{template_name}, |
118 |
die_on_bad_params => 1, |
116 |
die_on_bad_params => 1, |
Lines 159-164
sub get_template_and_user {
Link Here
|
159 |
return ( $template, $borrowernumber, $cookie ); |
157 |
return ( $template, $borrowernumber, $cookie ); |
160 |
} |
158 |
} |
161 |
|
159 |
|
|
|
160 |
sub _get_template_language { |
161 |
#verify if opac language exists in staff (bug 5660) |
162 |
#conditions are 1) dir exists and 2) enabled in prefs |
163 |
my ($opaclang)= @_; |
164 |
return 'en' unless $opaclang; |
165 |
my $path= C4::Context->config('intrahtdocs')."/prog/$opaclang"; |
166 |
my $pref= ','.C4::Context->preference('language').','; |
167 |
if(-d $path) { |
168 |
if($pref =~ /,$opaclang,/ ) { |
169 |
return $opaclang; |
170 |
} |
171 |
} |
172 |
return 'en'; |
173 |
} |
174 |
|
162 |
=item checkauth |
175 |
=item checkauth |
163 |
|
176 |
|
164 |
($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type); |
177 |
($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type); |
165 |
- |
|
|