Meilleure gestion d'erreurs de l'install.
Suppression de warnings apparaissant avec register_global=off.
This commit is contained in:
parent
ef99cef95a
commit
c64e485633
@ -168,8 +168,8 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
$conf = new Conf();
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->name = "mysql";
|
||||
$conf->db->user = $HTTP_POST_VARS["db_user_root"];
|
||||
$conf->db->pass = $HTTP_POST_VARS["db_user_pass"];
|
||||
$conf->db->user = isset($HTTP_POST_VARS["db_user_root"])?$HTTP_POST_VARS["db_user_root"]:"";
|
||||
$conf->db->pass = isset($HTTP_POST_VARS["db_user_pass"])?$HTTP_POST_VARS["db_user_pass"]:"";
|
||||
$db = new DoliDb();
|
||||
|
||||
$sql = "INSERT INTO user ";
|
||||
@ -192,7 +192,11 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td>Création de l'utilisateur : $dolibarr_main_db_user</td><td>ERREUR</td></tr>";
|
||||
if ($db->errno() == 1062) {
|
||||
print "<tr><td>Création de l'utilisateur : $dolibarr_main_db_user</td><td>Deja existant</td></tr>";
|
||||
} else {
|
||||
print "<tr><td>Création de l'utilisateur : $dolibarr_main_db_user</td><td>ERREUR</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
@ -245,8 +249,8 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
$conf = new Conf();
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->name = "mysql";
|
||||
$conf->db->user = $HTTP_POST_VARS["db_user_root"];
|
||||
$conf->db->pass = $HTTP_POST_VARS["db_user_pass"];
|
||||
$conf->db->user = isset($HTTP_POST_VARS["db_user_root"])?$HTTP_POST_VARS["db_user_root"]:"";
|
||||
$conf->db->pass = isset($HTTP_POST_VARS["db_user_pass"])?$HTTP_POST_VARS["db_user_pass"]:"";
|
||||
$db = new DoliDb();
|
||||
|
||||
if ($ok)
|
||||
|
||||
@ -1,3 +1,26 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||
@ -47,15 +70,14 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
|
||||
$ok = 1 ;
|
||||
|
||||
$result = $db->list_tables($dolibarr_db_name);
|
||||
if ($result)
|
||||
{
|
||||
print "toto";
|
||||
while ($row = $db->fetch_row())
|
||||
{
|
||||
print "Table : $row[0]\n";
|
||||
}
|
||||
}
|
||||
//$result = $db->list_tables($dolibarr_main_db_name);
|
||||
//if ($result)
|
||||
//{
|
||||
// while ($row = $db->fetch_row())
|
||||
// {
|
||||
// print "Table : $row[0]<br>\n";
|
||||
// }
|
||||
//}
|
||||
|
||||
// Création des tables
|
||||
$dir = "../../mysql/tables/";
|
||||
@ -86,8 +108,13 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td>ERREUR</td></tr>";
|
||||
if ($db->errno() == 1050) {
|
||||
print "<td>Déjà existante</td></tr>";
|
||||
}
|
||||
else {
|
||||
print "<td>ERREUR ".$db->errno()."</td></tr>";
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,8 +143,12 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
else
|
||||
{
|
||||
$ok = 0;
|
||||
print $db->error();
|
||||
print "<p>".$buffer."</p>";
|
||||
if ($db->errno() == 1062) {
|
||||
// print "<tr><td>Insertion ligne : $buffer</td><td>Déja existante</td></tr>";
|
||||
}
|
||||
else {
|
||||
print "Erreur SQL ".$db->errno()." sur requete '$buffer'<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,26 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||
@ -10,7 +33,7 @@
|
||||
|
||||
<?PHP
|
||||
include("./inc.php");
|
||||
$etape = 6;
|
||||
$etape = 5;
|
||||
print "<h2>Installation de Dolibarr - Etape $etape/$etapes</h2>";
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
|
||||
@ -91,7 +91,7 @@ if(! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0)
|
||||
{
|
||||
$dolibarr_main_document_root = substr($_SERVER["SCRIPT_FILENAME"],0,strlen($_SERVER["SCRIPT_FILENAME"])-18);
|
||||
# Nettoyage du path proposé
|
||||
$dolibarr_main_document_root = str_replace('\\\\','/',$dolibarr_main_document_root); # Gere les chemins windows avec double "\"
|
||||
$dolibarr_main_document_root = str_replace('\\\\','/',$dolibarr_main_document_root); # Gere les chemins windows avec double "\"
|
||||
$dolibarr_main_document_root = ereg_replace('[\\\\\/]$','',$dolibarr_main_document_root); # Supprime le "\" ou "/" de fin
|
||||
}
|
||||
print "$dolibarr_main_document_root";
|
||||
@ -139,10 +139,10 @@ exemples :<br>
|
||||
</tr>
|
||||
|
||||
<tr class="bg2">
|
||||
<td valign="top">Login</td>
|
||||
<td valign="top">Login administrateur de la base</td>
|
||||
<td>
|
||||
<input type="text" name="db_user_root">
|
||||
</td><td><div class="comment">Login de l'utilisateur ayant les droits de création de la base de données, inutile si vous êtes chez un hébergeur, votre base de données est déjà créée. Laisser vide si vous vous connectez en anonymous</div>
|
||||
</td><td><div class="comment">Login de l'utilisateur ayant les droits de création de bases de données.<br>Si vous avez déjà une base, vierge ou non, pour accueillir les tables dolibarr (exemple si vous êtes chez un hébergeur), ne rien remplir. Laisser vide également si vous vous connectez en anonymous</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -155,10 +155,7 @@ exemples :<br>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="3" align="center"><h2>Base de données Dolibarr<h2></td>
|
||||
</tr>
|
||||
<tr><td colspan="3" align="center"><h2>Base de données Dolibarr<h2></td></tr>
|
||||
|
||||
<tr class="bg2">
|
||||
<td>Nom de la base de données</td><td valign="top"><input type="text" name="db_name" value="<?PHP print isset($dolibarr_main_db_name)?$dolibarr_main_db_name:'dolibarr' ?>"></td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user