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 = new Conf();
|
||||||
$conf->db->host = $dolibarr_main_db_host;
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
$conf->db->name = "mysql";
|
$conf->db->name = "mysql";
|
||||||
$conf->db->user = $HTTP_POST_VARS["db_user_root"];
|
$conf->db->user = isset($HTTP_POST_VARS["db_user_root"])?$HTTP_POST_VARS["db_user_root"]:"";
|
||||||
$conf->db->pass = $HTTP_POST_VARS["db_user_pass"];
|
$conf->db->pass = isset($HTTP_POST_VARS["db_user_pass"])?$HTTP_POST_VARS["db_user_pass"]:"";
|
||||||
$db = new DoliDb();
|
$db = new DoliDb();
|
||||||
|
|
||||||
$sql = "INSERT INTO user ";
|
$sql = "INSERT INTO user ";
|
||||||
@ -192,8 +192,12 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
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>";
|
print "<tr><td>Création de l'utilisateur : $dolibarr_main_db_user</td><td>ERREUR</td></tr>";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
@ -245,8 +249,8 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
$conf = new Conf();
|
$conf = new Conf();
|
||||||
$conf->db->host = $dolibarr_main_db_host;
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
$conf->db->name = "mysql";
|
$conf->db->name = "mysql";
|
||||||
$conf->db->user = $HTTP_POST_VARS["db_user_root"];
|
$conf->db->user = isset($HTTP_POST_VARS["db_user_root"])?$HTTP_POST_VARS["db_user_root"]:"";
|
||||||
$conf->db->pass = $HTTP_POST_VARS["db_user_pass"];
|
$conf->db->pass = isset($HTTP_POST_VARS["db_user_pass"])?$HTTP_POST_VARS["db_user_pass"]:"";
|
||||||
$db = new DoliDb();
|
$db = new DoliDb();
|
||||||
|
|
||||||
if ($ok)
|
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>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||||
@ -47,15 +70,14 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
|
|
||||||
$ok = 1 ;
|
$ok = 1 ;
|
||||||
|
|
||||||
$result = $db->list_tables($dolibarr_db_name);
|
//$result = $db->list_tables($dolibarr_main_db_name);
|
||||||
if ($result)
|
//if ($result)
|
||||||
{
|
//{
|
||||||
print "toto";
|
// while ($row = $db->fetch_row())
|
||||||
while ($row = $db->fetch_row())
|
// {
|
||||||
{
|
// print "Table : $row[0]<br>\n";
|
||||||
print "Table : $row[0]\n";
|
// }
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
|
|
||||||
// Création des tables
|
// Création des tables
|
||||||
$dir = "../../mysql/tables/";
|
$dir = "../../mysql/tables/";
|
||||||
@ -86,10 +108,15 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
}
|
}
|
||||||
else
|
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++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
@ -116,8 +143,12 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
print $db->error();
|
if ($db->errno() == 1062) {
|
||||||
print "<p>".$buffer."</p>";
|
// 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>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||||
@ -10,7 +33,7 @@
|
|||||||
|
|
||||||
<?PHP
|
<?PHP
|
||||||
include("./inc.php");
|
include("./inc.php");
|
||||||
$etape = 6;
|
$etape = 5;
|
||||||
print "<h2>Installation de Dolibarr - Etape $etape/$etapes</h2>";
|
print "<h2>Installation de Dolibarr - Etape $etape/$etapes</h2>";
|
||||||
|
|
||||||
$conf = "../conf/conf.php";
|
$conf = "../conf/conf.php";
|
||||||
|
|||||||
@ -139,10 +139,10 @@ exemples :<br>
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="bg2">
|
<tr class="bg2">
|
||||||
<td valign="top">Login</td>
|
<td valign="top">Login administrateur de la base</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="db_user_root">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -155,10 +155,7 @@ exemples :<br>
|
|||||||
</tr>
|
</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">
|
<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>
|
<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