updating web installer : going to step1 if needed and fixing sql
authortipaul <tipaul>
Tue, 26 Jun 2007 14:30:22 +0000 (14:30 +0000)
committertipaul <tipaul>
Tue, 26 Jun 2007 14:30:22 +0000 (14:30 +0000)
C4/Auth.pm
installer/install.pl

index 8a250b1..3db1400 100644 (file)
@@ -339,7 +339,7 @@ sub checkauth {
 
     my $dbh     = C4::Context->dbh;
     unless (C4::Context->preference('Version')){
-      print $query->redirect("/cgi-bin/koha/installer/install.pl?step=3");
+      print $query->redirect("/cgi-bin/koha/installer/install.pl");
       exit;
     }
     my $timeout = C4::Context->preference('timeout');
index 58796b4..b4ae8d3 100755 (executable)
@@ -223,7 +223,7 @@ if ($step && $step==1){
     foreach my $file (@fnames){
 #      warn $file;
       undef $/;
-      my $strcmd="mysql ".($info{hostname}?"-h $info{hostname} ":"").($info{port}?"-P $info{port} ":"").($info{user}?"-u $info{user} ":"").($info{password}?"-p$info{password}":"")." $info{dbname} ";
+      my $strcmd="mysql ".($info{hostname}?" -h $info{hostname} ":"").($info{port}?" -P $info{port} ":"").($info{user}?" -u $info{user} ":"").($info{password}?" -p$info{password}":"")." $info{dbname} ";
       my $error = qx($strcmd < $file 2>&1);
       my @file = split qr(\/|\\),$file;
       $lang=$file[scalar(@file)-3] unless ($lang);
@@ -336,9 +336,10 @@ if ($step && $step==1){
     #Import data structure and show errors if any
     my $filename="kohastructure.sql";
     undef $/;
-       my $str = qx(mysql -h $info{hostname} -P $info{port} -u $info{user} -p$info{password} $info{dbname} <$filename 2>&1);
-       $str=~s/\n|\r/<br \/>/g;
-       $template->param("error"=>$str ,
+    my $strcmd="mysql ".($info{hostname}?"-h $info{hostname} ":"").($info{port}?"-P $info{port} ":"").($info{user}?"-u $info{user} ":"").($info{password}?"-p$info{password}":"")." $info{dbname} ";
+    my $str = qx($strcmd < $filename 2>&1);
+    $str=~s/\n|\r/<br \/>/g;
+    $template->param("error"=>$str ,
                         "$op"=> 1, );
   } else {
     #Check if there are enough tables.