diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 74fe8a1fe83e14c812181138c5f082748f4a1d3e..6fba964338977c446ceba371be0b0d14e5f04a1f 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -151,22 +151,29 @@ if ($memmaxorig != '') } -// Si fichier present et lisible et renseigne +// If config file presente and filled clearstatcache(); if (is_readable($conffile) && filesize($conffile) > 8) { - dolibarr_install_syslog("check: conf file '$conffile' already exists"); + dolibarr_install_syslog("check: conf file '$conffile' already defined"); $confexists=1; include_once($conffile); - // Deja install�, on peut upgrader - // \todo Test if database ok - $allowupgrade=1; + $databaseok=1; // TODO Check if database is ok + if ($databaseok) + { + // Already installed for all parts (config and database). We can propose upgrade. + $allowupgrade=1; + } + else + { + $allowupgrade=0; + } } else { - // Si non on le cr�e - dolibarr_install_syslog("check: we try to creat conf file '$conffile'"); + // If not, we create it + dolibarr_install_syslog("check: we try to create conf file '$conffile'"); $confexists=0; # First we try by copying example @@ -196,7 +203,7 @@ else -// Si fichier absent et n'a pu etre cr�� +// Si fichier absent et n'a pu etre cree if (! file_exists($conffile)) { //print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffile); @@ -210,7 +217,7 @@ if (! file_exists($conffile)) } else { - // Si fichier pr�sent mais ne peut etre modifi� + // Si fichier present mais ne peut etre modifie if (!is_writable($conffile)) { if ($confexists) @@ -246,7 +253,7 @@ else } print "<br />\n"; - // Si prerequis ok, on affiche le bouton pour passer � l'�tape suivante + // Si prerequis ok, on affiche le bouton pour passer a l'etape suivante if ($checksok) { $ok=0; diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index b6bc5f61e8f865945935ede6069a791ad5a74d7b..2c2d051ccf8d87e53e982e780459978798def129 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -64,7 +64,7 @@ if (substr($_POST["main_url"], strlen($_POST["main_url"]) -1) == "/") $_POST["main_url"] = substr($_POST["main_url"], 0, strlen($_POST["main_url"])-1); } -// R�pertoire des documents g�n�r�s (factures, etc...) +// Directory for generated documents (invoices, orders, ecm, etc...) $main_data_dir=isset($_POST["main_data_dir"])?$_POST["main_data_dir"]:''; if (! $main_data_dir) { $main_data_dir="$main_dir/documents"; } @@ -120,7 +120,7 @@ if ($_POST["action"] == "set") // Create subdirectory main_data_dir if (! $error) { - // R�pertoire des documents + // Create directory for documents if (! is_dir($main_data_dir)) { create_exdir($main_data_dir); @@ -138,7 +138,23 @@ if ($_POST["action"] == "set") } else { - // Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre t�l�charg�s en passant outre l'authentification + // Create .htaccess file in document directory + $pathhtaccess=$main_data_dir.'/.htaccess'; + if (! file_exists($pathhtaccess)) + { + dolibarr_install_syslog("etape1: .htaccess file does not exists, we create it in '".$main_data_dir."'"); + $handlehtaccess=@fopen($pathhtaccess,'w'); + if ($handlehtaccess) + { + fwrite($handlehtaccess,'Order allow,deny'."\n"); + fwrite($handlehtaccess,'Deny from all'."\n"); + + fclose($handlehtaccess); + dolibarr_install_syslog("etape1: .htaccess file created"); + } + } + + // Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre telecharges en passant outre l'authentification $dir[0] = "$main_data_dir/facture"; $dir[1] = "$main_data_dir/users"; $dir[2] = "$main_data_dir/propale";