X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=installer%2Finstall.pl;h=d9feac4b4373c634ac8b6cedf0758528938248dc;hb=84825be42adf4a50b77360cf016cd5bfee15c072;hp=5fac1f6160c202e5f9208a1fe2becf18dec7eb57;hpb=64c6ffe6101d8fc87e9349c7e42179e1ad0f6060;p=koha_fer diff --git a/installer/install.pl b/installer/install.pl index 5fac1f6160..d9feac4b43 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -10,6 +10,7 @@ use IPC::Cmd; use C4::Context; use C4::Output; +use C4::Templates; use C4::Languages qw(getAllLanguages getTranslatedLanguages); use C4::Installer; @@ -22,7 +23,7 @@ my ( $template, $loggedinuser, $cookie ); my $all_languages = getAllLanguages(); if ( defined($language) ) { - setlanguagecookie( $query, $language, "install.pl?step=1" ); + C4::Templates::setlanguagecookie( $query, $language, "install.pl?step=1" ); } ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -58,7 +59,7 @@ if ( $step && $step == 1 ) { $template->param( language => 1 ); $template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are - unless ( $] >= 5.008008 ) { # Bug 4505 + unless ( $] >= 5.010000 ) { # Bug 7375 $template->param( problems => 1, perlversion => 1, checkmodule => 0 ); } @@ -184,10 +185,11 @@ elsif ( $step && $step == 3 ) { # we have finished, just redirect to mainpage. # print $query->redirect("/cgi-bin/koha/mainpage.pl"); - exit 1; + exit; } elsif ( $op && $op eq 'finish' ) { $installer->set_version_syspref(); + $installer->set_indexing_engine(0); # use Zebra # Installation is finished. # We just deny anybody access to install @@ -195,10 +197,6 @@ elsif ( $step && $step == 3 ) { # The installer will have to relogin since we do not pass cookie to redirection. $template->param( "$op" => 1 ); } - elsif ( $op && $op eq 'SetIndexingEngine' ) { - $installer->set_indexing_engine($query->param('NoZebra')); - $template->param( "$op" => 1 ); - } elsif ( $op && $op eq 'addframeworks' ) { # # 1ST install, 3rd sub-step : insert the SQL files the user has selected @@ -231,6 +229,7 @@ elsif ( $step && $step == 3 ) { # Framework Selection is achieved through checking boxes. my $langchoice = $query->param('fwklanguage'); $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); + $langchoice =~ s/[^a-zA-Z_-]*//g; my $marcflavour = $query->param('marcflavour'); if ($marcflavour){ $installer->set_marcflavour_syspref($marcflavour); @@ -268,6 +267,7 @@ elsif ( $step && $step == 3 ) { # Marcflavour Selection is achieved through radiobuttons. my $langchoice = $query->param('fwklanguage'); $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); + $langchoice =~ s/[^a-zA-Z_-]*//g; my $dir = C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/$langchoice/marcflavour"; unless (opendir( MYDIR, $dir )) { @@ -312,6 +312,15 @@ elsif ( $step && $step == 3 ) { # Not 1st install, the only sub-step : update database # #Do updatedatabase And report + + if ( ! defined $ENV{PERL5LIB} ) { + my $find = "C4/Context.pm"; + my $path = $INC{$find}; + $path =~ s/\Q$find\E//; + $ENV{PERL5LIB} = "$path:$path/installer"; + warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n"; + } + my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl"; my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0); @@ -330,7 +339,7 @@ elsif ( $step && $step == 3 ) { } else { # - # check wether it's a 1st install or an update + # check whether it's a 1st install or an update # #Check if there are enough tables. # Paul has cleaned up tables so reduced the count