Fix: Suppression des warnings de l'install quand php en mode error_reporting=E_ALL.

This commit is contained in:
Laurent Destailleur 2005-04-02 20:56:18 +00:00
parent a5172ba445
commit 71024bc478
3 changed files with 17 additions and 10 deletions

View File

@ -39,8 +39,10 @@ $langs->defaultlang=$setuplang;
$langs->load("admin");
$langs->load("install");
pHeader($langs->trans("CreateDatabaseObjects"),"etape4");
$grant_query='';
$etape = 2;
if (file_exists($conffile))
@ -145,7 +147,7 @@ if ($_POST["action"] == "set")
}
else
{
if ($db->errno() == DB_ERROR_TABLE_ALREADY_EXISTS)
if ($db->errno() == 'DB_ERROR_TABLE_ALREADY_EXISTS')
{
//print "<td>Déjà existante</td></tr>";
$table_exists = 1;
@ -217,7 +219,7 @@ if ($_POST["action"] == "set")
}
else
{
if ($db->errno() == DB_ERROR_CANNOT_CREATE || eregi('duplicate key name',$db->error()))
if ($db->errno() == 'DB_ERROR_CANNOT_CREATE' || eregi('duplicate key name',$db->error()))
{
//print "<td>Déjà existante</td></tr>";
$key_exists = 1;
@ -253,7 +255,7 @@ if ($_POST["action"] == "set")
if ($ok)
{
// Droits sur les tables
if ($grant_query) {
if ($grant_query) { // Non null si postgresql
if ($db->query($grant_query))
{
print "<tr><td>Grant User</td><td>".$langs->trans("OK")."</td></tr>";
@ -300,7 +302,7 @@ if ($_POST["action"] == "set")
}
else
{
if ($db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS)
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
// print "<tr><td>Insertion ligne : $buffer</td><td>
}
@ -355,7 +357,7 @@ if ($_POST["action"] == "set")
}
else
{
if ($db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS)
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
// print "<tr><td>Insertion ligne : $buffer</td><td>
}

View File

@ -54,7 +54,7 @@ require ($dolibarr_main_document_root . "/conf/conf.class.php");
print '<table cellspacing="0" cellpadding="4" border="1" width="100%">';
$error=0;
$err=0;
$conf = new Conf();
$conf->db->type = $dolibarr_main_db_type;
@ -76,24 +76,27 @@ if ($db->ok == 1)
print '<input type="password" name="pass_verif"></td></tr>';
print '</table>';
if ($_GET["error"] == 1)
if (isset($_GET["error"]) && $_GET["error"] == 1)
{
print '<div class="error">'.$langs->trans("PasswordsMismatch").'</div>';
}
if ($_GET["error"] == 2)
if (isset($_GET["error"]) && $_GET["error"] == 2)
{
print '<div class="error">';
print $langs->trans("PleaseTypePassword");
print '</div>';
}
if ($_GET["error"] == 3)
if (isset($_GET["error"]) && $_GET["error"] == 3)
{
print '<div class="error">'.$langs->trans("PleaseTypeALogin").'</div>';
}
$db->close();
}
$db->close();
pFooter($err);
?>

View File

@ -33,6 +33,8 @@
include_once("./inc.php");
$err=0;
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:$langcode);
$langs->defaultlang=$setuplang;
$langs->load("install");