View | Details | Raw Unified | Return to bug 5660
Collapse All | Expand All

(-)a/installer/InstallAuth.pm (-7 / +17 lines)
Lines 110-126 InstallAuth - Authenticates Koha users for Install process Link Here
110
sub get_template_and_user {
110
sub get_template_and_user {
111
    my $in       = shift;
111
    my $in       = shift;
112
    my $query    = $in->{'query'};
112
    my $query    = $in->{'query'};
113
    my $language = $query->cookie('KohaOpacLanguage');
113
    my $language =_get_template_language($query->cookie('KohaOpacLanguage'));
114
    my $path =
114
    my $path     = C4::Context->config('intrahtdocs'). "/prog/". $language;
115
      C4::Context->config('intrahtdocs') . "/prog/"
116
      . ( $language ? $language : "en" );
117
    
118
    my $filename = "$path/modules/" . $in->{template_name};
115
    my $filename = "$path/modules/" . $in->{template_name};
119
    $filename =~ s/\.tmpl$/.tt/; 
116
    $filename =~ s/\.tmpl$/.tt/; 
120
    my $interface = 'intranet';
117
    my $interface = 'intranet';
121
    my $template = C4::Templates->new( $interface, $filename);
118
    my $template = C4::Templates->new( $interface, $filename);
122
    
119
    
123
124
    my ( $user, $cookie, $sessionID, $flags ) = checkauth(
120
    my ( $user, $cookie, $sessionID, $flags ) = checkauth(
125
        $in->{'query'},
121
        $in->{'query'},
126
        $in->{'authnotrequired'},
122
        $in->{'authnotrequired'},
Lines 159-164 sub get_template_and_user { Link Here
159
    return ( $template, $borrowernumber, $cookie );
155
    return ( $template, $borrowernumber, $cookie );
160
}
156
}
161
157
158
sub _get_template_language {
159
  #verify if opac language exists in staff (bug 5660)
160
  #conditions are 1) dir exists and 2) enabled in prefs
161
  my ($opaclang)= @_;
162
  return 'en' unless $opaclang;
163
  my $path= C4::Context->config('intrahtdocs')."/prog/$opaclang";
164
  my $pref= ','.C4::Context->preference('language').',';
165
  if(-d $path) {
166
    if($pref =~ /,$opaclang,/ ) {
167
      return $opaclang;
168
    }
169
  }
170
  return 'en';
171
}
172
162
=item checkauth
173
=item checkauth
163
174
164
  ($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type);
175
  ($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type);
165
- 

Return to bug 5660