2004-10-20 00:24:10 +02:00
< ? php
2007-01-05 16:06:17 +01:00
/* Copyright ( C ) 2004 - 2007 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2008-03-10 23:38:43 +01:00
* Copyright ( C ) 2004 - 2008 Laurent Destailleur < eldy @ users . sourceforge . net >
2005-06-27 21:48:50 +02:00
* Copyright ( C ) 2004 Benoit Mortier < benoit . mortier @ opensides . be >
* Copyright ( C ) 2004 Sebastien Di Cintio < sdicintio @ ressource - toi . org >
2004-02-02 02:41:33 +01:00
*
* 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 .
*/
2004-02-12 15:47:09 +01:00
2004-12-04 16:30:14 +01:00
/**
2007-05-08 23:54:11 +02:00
\file htdocs / install / etape1 . php
2008-04-21 09:21:13 +02:00
\ingroup install
2007-05-08 23:54:11 +02:00
\brief G<EFBFBD> n<EFBFBD> re le fichier conf . php avec les informations issues de l ' <EFBFBD> tape pr<EFBFBD> c<EFBFBD> dente
2008-03-10 23:38:43 +01:00
\version $Id $
2004-12-04 16:30:14 +01:00
*/
2004-08-25 22:12:02 +02:00
2007-04-18 19:38:55 +02:00
define ( 'DONOTLOADCONF' , 1 ); // To avoid loading conf by file inc..php
2007-07-16 10:37:36 +02:00
include ( " ./inc.php " );
2006-01-04 17:22:38 +01:00
$setuplang = isset ( $_POST [ " selectlang " ]) ? $_POST [ " selectlang " ] : ( isset ( $_GET [ " selectlang " ]) ? $_GET [ " selectlang " ] : 'auto' );
2005-10-30 02:07:00 +01:00
$langs -> setDefaultLang ( $setuplang );
2005-02-13 17:47:32 +01:00
$langs -> load ( " admin " );
2005-02-12 22:25:39 +01:00
$langs -> load ( " install " );
2008-04-21 09:21:13 +02:00
// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard.
if ( file_exists ( " ./install.forced.php " )) include_once ( " ./install.forced.php " );
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Entering etape1.php page " );
2008-04-21 09:21:13 +02:00
/*
* View
*/
2005-02-13 17:47:32 +01:00
pHeader ( $langs -> trans ( " ConfigurationFile " ), " etape2 " );
2004-02-12 15:47:09 +01:00
2005-09-24 01:36:48 +02:00
$error = 0 ;
2005-11-04 00:16:41 +01:00
2004-07-20 11:10:15 +02:00
// R<> pertoire des pages dolibarr
2005-09-24 01:36:48 +02:00
$main_dir = isset ( $_POST [ " main_dir " ]) ? trim ( $_POST [ " main_dir " ]) : '' ;
// On supprime / de fin dans main_dir
if ( substr ( $main_dir , strlen ( $main_dir ) - 1 ) == " / " )
{
2007-05-08 23:54:11 +02:00
$main_dir = substr ( $main_dir , 0 , strlen ( $main_dir ) - 1 );
2005-09-24 01:36:48 +02:00
}
// On supprime / de fin dans main_url
if ( substr ( $_POST [ " main_url " ], strlen ( $_POST [ " main_url " ]) - 1 ) == " / " )
{
2007-05-08 23:54:11 +02:00
$_POST [ " main_url " ] = substr ( $_POST [ " main_url " ], 0 , strlen ( $_POST [ " main_url " ]) - 1 );
2005-09-24 01:36:48 +02:00
}
2004-08-27 02:23:30 +02:00
2004-07-20 11:10:15 +02:00
// R<> pertoire des documents g<> n<EFBFBD> r<EFBFBD> s (factures, etc...)
2004-04-24 02:48:15 +02:00
$main_data_dir = isset ( $_POST [ " main_data_dir " ]) ? $_POST [ " main_data_dir " ] : '' ;
2005-06-27 21:48:50 +02:00
if ( ! $main_data_dir ) { $main_data_dir = " $main_dir /documents " ; }
2004-08-27 02:23:30 +02:00
2005-09-24 01:36:48 +02:00
/*
2007-05-08 23:54:11 +02:00
* Actions
*/
2007-07-14 22:36:31 +02:00
2004-04-24 02:48:15 +02:00
if ( $_POST [ " action " ] == " set " )
2004-01-27 15:36:40 +01:00
{
2007-05-08 23:54:11 +02:00
umask ( 0 );
2007-11-09 00:06:00 +01:00
print '<h3>' . $langs -> trans ( " ConfigurationFile " ) . '</h3>' ;
2007-05-08 23:54:11 +02:00
print '<table cellspacing="0" width="100%" cellpadding="1" border="0">' ;
// Verification validite parametre main_dir
if ( ! $error )
{
if ( ! is_dir ( $main_dir ))
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Repertoire ' " . $main_dir . " ' inexistant ou non accessible " );
2007-05-08 23:54:11 +02:00
print " <tr><td> " ;
print $langs -> trans ( " ErrorDirDoesNotExists " , $main_dir ) . '<br>' ;
print $langs -> trans ( " ErrorWrongValueForParameter " , $langs -> trans ( " WebPagesDirectory " )) . '<br>' ;
print $langs -> trans ( " ErrorGoBackAndCorrectParameters " ) . '<br><br>' ;
print '</td><td>' ;
print $langs -> trans ( " Error " );
print " </td></tr> " ;
$error ++ ;
}
}
// Sauvegarde fichier configuration
if ( ! $error )
{
$fp = fopen ( " $conffile " , " w " );
if ( $fp )
{
clearstatcache ();
fputs ( $fp , '<?php' );
fputs ( $fp , " \n " );
2007-05-14 22:35:04 +02:00
fputs ( $fp , " # \n " );
2007-10-29 13:54:25 +01:00
fputs ( $fp , " # File generated by Dolibarr installer on " . dolibarr_print_date ( gmmktime (), '' ));
2007-05-14 22:58:59 +02:00
fputs ( $fp , " \n " );
2007-05-14 22:35:04 +02:00
fputs ( $fp , " # \n " );
fputs ( $fp , " # Take a look at conf.php.example file for an example of conf.php file \n " );
fputs ( $fp , " # and explanations for all possibles parameters. \n " );
fputs ( $fp , " # \n " );
2007-05-08 23:54:11 +02:00
fputs ( $fp , '$dolibarr_main_url_root="' . $_POST [ " main_url " ] . '";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_main_document_root="' . $main_dir . '";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_main_data_root="' . $main_data_dir . '";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_main_db_host="' . $_POST [ " db_host " ] . '";' );
fputs ( $fp , " \n " );
2008-03-10 23:38:43 +01:00
fputs ( $fp , '$dolibarr_main_db_port="' . $_POST [ " db_port " ] . '";' );
fputs ( $fp , " \n " );
2007-05-08 23:54:11 +02:00
fputs ( $fp , '$dolibarr_main_db_name="' . $_POST [ " db_name " ] . '";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_main_db_user="' . $_POST [ " db_user " ] . '";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_main_db_pass="' . $_POST [ " db_pass " ] . '";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_main_db_type="' . $_POST [ " db_type " ] . '";' );
fputs ( $fp , " \n " );
2007-05-25 22:02:23 +02:00
fputs ( $fp , '$dolibarr_main_db_character_set="' . $_POST [ " character_set_database " ] . '";' );
2007-05-23 23:10:11 +02:00
fputs ( $fp , " \n " );
2007-12-21 20:14:11 +01:00
fputs ( $fp , '$dolibarr_main_db_collation="' . $_POST [ " dolibarr_main_db_collation " ] . '";' );
2007-05-23 23:10:11 +02:00
fputs ( $fp , " \n " );
2007-06-09 13:28:48 +02:00
/* Authentication */
2007-11-09 00:06:00 +01:00
if ( $_POST [ " db_type " ] == 'mssql' )
{
fputs ( $fp , '$dolibarr_main_authentication="dolibarr_mdb2";' );
}
else
{
fputs ( $fp , '$dolibarr_main_authentication="dolibarr";' );
}
fputs ( $fp , " \n " );
2007-06-09 13:28:48 +02:00
2007-05-08 23:54:11 +02:00
/* Preparation integration SMARTY */
fputs ( $fp , '$dolibarr_smarty_libs_dir="";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_smarty_compile="";' );
fputs ( $fp , " \n " );
fputs ( $fp , '$dolibarr_smarty_cache="";' );
fputs ( $fp , " \n " );
/* Fin Smarty*/
fputs ( $fp , '?>' );
fclose ( $fp );
if ( file_exists ( " $conffile " ))
{
include ( " $conffile " ); // On force rechargement. Ne pas mettre include_once !
2007-07-19 21:30:32 +02:00
conf ( $dolibarr_main_document_root );
2007-11-09 00:06:00 +01:00
print " <tr><td> " ;
print $langs -> trans ( " SaveConfigurationFile " );
print " </td><td> " ;
print $langs -> trans ( " OK " );
print " </td></tr> " ;
2007-05-08 23:54:11 +02:00
}
else
{
$error ++ ;
}
}
// Chargement driver acces bases
require_once ( $dolibarr_main_document_root . " /lib/databases/ " . $dolibarr_main_db_type . " .lib.php " );
}
/***************************************************************************
* Creation des r<EFBFBD> pertoires
***************************************************************************/
// Creation des sous-r<> pertoires main_data_dir
if ( ! $error )
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Directory ' " . $main_dir . " ' exists " );
2007-05-08 23:54:11 +02:00
// R<> pertoire des documents
if ( ! is_dir ( $main_data_dir ))
{
create_exdir ( $main_data_dir );
}
if ( ! is_dir ( $main_data_dir ))
{
print " <tr><td> " . $langs -> trans ( " ErrorDirDoesNotExists " , $main_data_dir );
2008-10-08 00:52:02 +02:00
print ' ' . $langs -> trans ( " YouMustCreateItAndAllowServerToWrite " );
2007-05-08 23:54:11 +02:00
print '</td><td>' ;
2008-03-17 23:53:58 +01:00
print '<font class="error">' . $langs -> trans ( " Error " ) . '</font>' ;
2007-05-08 23:54:11 +02:00
print " </td></tr> " ;
2008-03-17 23:53:58 +01:00
print '<tr><td colspan="2"><br>' . $langs -> trans ( " CorrectProblemAndReloadPage " , $_SERVER [ 'PHP_SELF' ] . '?testget=ok' ) . '</td></tr>' ;
2007-05-08 23:54:11 +02:00
$error ++ ;
}
else
{
// Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre t<> l<EFBFBD> charg<72> s en passant outre l'authentification
$dir [ 0 ] = " $main_data_dir /facture " ;
$dir [ 1 ] = " $main_data_dir /users " ;
$dir [ 2 ] = " $main_data_dir /propale " ;
$dir [ 3 ] = " $main_data_dir /societe " ;
$dir [ 4 ] = " $main_data_dir /ficheinter " ;
$dir [ 5 ] = " $main_data_dir /produit " ;
$dir [ 6 ] = " $main_data_dir /rapport " ;
$dir [ 7 ] = " $main_data_dir /rss " ;
$dir [ 8 ] = " $main_data_dir /logo " ;
// Boucle sur chaque r<> pertoire de dir[] pour les cr<63> er s'ils nexistent pas
for ( $i = 0 ; $i < sizeof ( $dir ) ; $i ++ )
{
if ( is_dir ( $dir [ $i ]))
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Directory ' " . $dir [ $i ] . " ' exists " );
2007-05-08 23:54:11 +02:00
}
else
{
if ( create_exdir ( $dir [ $i ]) < 0 )
{
print " <tr><td> " ;
print " Failed to create directory: " . $dir [ $i ];
print '</td><td>' ;
print $langs -> trans ( " Error " );
print " </td></tr> " ;
$error ++ ;
}
else
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Directory ' " . $dir [ $i ] . " ' created " );
2007-05-08 23:54:11 +02:00
}
}
}
2008-10-08 00:52:02 +02:00
if ( $error )
{
print " <tr><td> " . $langs -> trans ( " ErrorDirDoesNotExists " , $main_data_dir );
print ' ' . $langs -> trans ( " YouMustCreateItAndAllowServerToWrite " );
print '</td><td>' ;
print '<font class="error">' . $langs -> trans ( " Error " ) . '</font>' ;
print " </td></tr> " ;
print '<tr><td colspan="2"><br>' . $langs -> trans ( " CorrectProblemAndReloadPage " , $_SERVER [ 'PHP_SELF' ] . '?testget=ok' ) . '</td></tr>' ;
}
2007-05-08 23:54:11 +02:00
}
}
/**
* Cr<EFBFBD> ation des Bases de donn<EFBFBD> es
*/
if ( ! $error )
{
2008-10-09 16:46:07 +02:00
conf ( $dolibarr_main_document_root );
2007-05-08 23:54:11 +02:00
$userroot = isset ( $_POST [ " db_user_root " ]) ? $_POST [ " db_user_root " ] : " " ;
$passroot = isset ( $_POST [ " db_pass_root " ]) ? $_POST [ " db_pass_root " ] : " " ;
/**
* Si creation utilisateur admin demand<EFBFBD> e , on le cr<EFBFBD> e
*/
if ( isset ( $_POST [ " db_create_user " ]) && $_POST [ " db_create_user " ] == " on " )
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Creation de l'utilisateur: " . $dolibarr_main_db_user );
2007-05-08 23:54:11 +02:00
2008-08-29 21:01:20 +02:00
//print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->port;
2007-05-08 23:58:20 +02:00
$databasefortest = $conf -> db -> name ;
if ( $conf -> db -> type == 'mysql' || $conf -> db -> type == 'mysqli' )
{
$databasefortest = 'mysql' ;
2007-08-17 19:45:55 +02:00
}
else if ( $conf -> db -> type == 'pgsql' )
{
2007-05-23 23:10:11 +02:00
$databasefortest = 'postgres' ;
2007-05-08 23:58:20 +02:00
}
2007-08-17 19:45:55 +02:00
else if ( $conf -> db -> type == 'mssql' )
{
$databasefortest = 'mssql' ;
}
2007-05-08 23:54:11 +02:00
// Creation handler de base, verification du support et connexion
2007-05-23 23:10:11 +02:00
2008-03-10 23:38:43 +01:00
$db = new DoliDb ( $conf -> db -> type , $conf -> db -> host , $userroot , $passroot , $databasefortest , $conf -> db -> port );
2007-05-08 23:54:11 +02:00
if ( $db -> error )
2007-07-19 21:30:32 +02:00
{
2007-05-25 22:02:23 +02:00
print '<div class="error">' . $db -> error . '</div>' ;
2007-05-08 23:54:11 +02:00
$error ++ ;
}
if ( ! $error )
{
if ( $db -> connected )
{
2008-05-16 20:56:19 +02:00
$result = $db -> DDLCreateUser ( $dolibarr_main_db_host , $dolibarr_main_db_user , $dolibarr_main_db_pass , $dolibarr_main_db_name );
2007-05-08 23:54:11 +02:00
if ( $result > 0 )
{
print '<tr><td>' ;
print $langs -> trans ( " UserCreation " ) . ' : ' ;
print $dolibarr_main_db_user ;
print '</td>' ;
print '<td>' . $langs -> trans ( " OK " ) . '</td></tr>' ;
}
else
{
if ( $db -> errno () == 'DB_ERROR_RECORD_ALREADY_EXISTS' )
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: User already exists " );
2007-05-08 23:54:11 +02:00
print '<tr><td>' ;
print $langs -> trans ( " UserCreation " ) . ' : ' ;
print $dolibarr_main_db_user ;
print '</td>' ;
print '<td>' . $langs -> trans ( " LoginAlreadyExists " ) . '</td></tr>' ;
}
else
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Failed to create user " );
2007-05-08 23:54:11 +02:00
print '<tr><td>' ;
print $langs -> trans ( " UserCreation " ) . ' : ' ;
print $dolibarr_main_db_user ;
print '</td>' ;
print '<td>' . $langs -> trans ( " Error " ) . ' ' . $db -> error () . " </td></tr> " ;
}
}
$db -> close ();
}
else
{
print '<tr><td>' ;
print $langs -> trans ( " UserCreation " ) . ' : ' ;
print $dolibarr_main_db_user ;
print '</td>' ;
print '<td>' . $langs -> trans ( " Error " ) . '</td>' ;
print '</tr>' ;
// Affiche aide diagnostique
print '<tr><td colspan="2"><br>' ;
2007-05-25 22:02:23 +02:00
print $langs -> trans ( " YouAskDatabaseCreationSoDolibarrNeedToConnect " , $dolibarr_main_db_user , $dolibarr_main_db_host , $userroot );
print '<br>' ;
print $langs -> trans ( " BecauseConnectionFailedParametersMayBeWrong " ) . '<br><br>' ;
2007-05-08 23:54:11 +02:00
print $langs -> trans ( " ErrorGoBackAndCorrectParameters " ) . '<br><br>' ;
print '</td></tr>' ;
$error ++ ;
}
}
} // Fin si "creation utilisateur"
/*
* Si creation database demand<EFBFBD> e , on la cr<EFBFBD> e
*/
if ( ! $error && ( isset ( $_POST [ " db_create_database " ]) && $_POST [ " db_create_database " ] == " on " ))
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: Creation de la base : " . $dolibarr_main_db_name );
2007-05-08 23:54:11 +02:00
2008-03-10 23:38:43 +01:00
$db = new DoliDb ( $conf -> db -> type , $conf -> db -> host , $userroot , $passroot , '' , $conf -> db -> port );
2007-05-08 23:54:11 +02:00
if ( $db -> connected )
{
2007-07-14 22:36:31 +02:00
2007-05-08 23:54:11 +02:00
if ( $db -> DDLCreateDb ( $dolibarr_main_db_name ))
{
print '<tr><td>' ;
print $langs -> trans ( " DatabaseCreation " ) . ' : ' ;
print $dolibarr_main_db_name ;
print '</td>' ;
print " <td> " . $langs -> trans ( " OK " ) . " </td></tr> " ;
}
else
{
print '<tr><td>' ;
print $langs -> trans ( " DatabaseCreation " ) . ' : ' ;
print $dolibarr_main_db_name ;
print '</td>' ;
print '<td>' . $langs -> trans ( " Error " ) . ' ' . $db -> errno () . '</td></tr>' ;
// Affiche aide diagnostique
print '<tr><td colspan="2"><br>' ;
print $langs -> trans ( " ErrorFailedToCreateDatabase " , $dolibarr_main_db_name ) . '<br>' ;
print $langs -> trans ( " IfDatabaseExistsGoBackAndCheckCreate " );
print '<br>' ;
print '</td></tr>' ;
$error ++ ;
}
$db -> close ();
}
else {
print '<tr><td>' ;
print $langs -> trans ( " DatabaseCreation " ) . ' : ' ;
print $dolibarr_main_db_name ;
print '</td>' ;
print '<td>' . $langs -> trans ( " Error " ) . '</td>' ;
print '</tr>' ;
// Affiche aide diagnostique
2007-05-25 22:02:23 +02:00
print '<tr><td colspan="2"><br>' ;
print $langs -> trans ( " YouAskDatabaseCreationSoDolibarrNeedToConnect " , $dolibarr_main_db_user , $dolibarr_main_db_host , $userroot );
print '<br>' ;
print $langs -> trans ( " BecauseConnectionFailedParametersMayBeWrong " ) . '<br><br>' ;
2007-05-08 23:54:11 +02:00
print $langs -> trans ( " ErrorGoBackAndCorrectParameters " ) . '<br><br>' ;
print '</td></tr>' ;
$error ++ ;
}
} // Fin si "creation database"
/*
* On test maintenant l ' acc<EFBFBD> s par le user admin dolibarr
*/
if ( ! $error )
{
2008-03-10 23:38:43 +01:00
dolibarr_install_syslog ( " etape1: connexion de type= " . $conf -> db -> type . " sur host= " . $conf -> db -> host . " port= " . $conf -> db -> port . " user= " . $conf -> db -> user . " name= " . $conf -> db -> name );
//print "connexion de type=".$conf->db->type." sur host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name;
2007-05-08 23:54:11 +02:00
2008-03-17 02:10:31 +01:00
$db = new DoliDb ( $conf -> db -> type , $conf -> db -> host , $conf -> db -> user , $conf -> db -> pass , $conf -> db -> name , $conf -> db -> port );
2007-05-08 23:54:11 +02:00
if ( $db -> connected == 1 )
{
// si acc<63> s serveur ok et acc<63> s base ok, tout est ok, on ne va pas plus loin, on a m<> me pas utilis<69> le compte root.
if ( $db -> database_selected == 1 )
{
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: la connexion au serveur par le user " . $conf -> db -> user . " est reussie " );
2007-05-08 23:54:11 +02:00
print " <tr><td> " ;
print $langs -> trans ( " ServerConnection " ) . " : " ;
print $dolibarr_main_db_host ;
print " </td><td> " ;
print $langs -> trans ( " OK " );
print " </td></tr> " ;
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: la connexion a la base : " . $conf -> db -> name . " ,par le user : " . $conf -> db -> user . " est reussie " );
2007-05-08 23:54:11 +02:00
print " <tr><td> " ;
print $langs -> trans ( " DatabaseConnection " ) . " : " ;
print $dolibarr_main_db_name ;
print " </td><td> " ;
print $langs -> trans ( " OK " );
print " </td></tr> " ;
$error = 0 ;
}
else
{
2007-09-09 12:40:17 +02:00
dolibarr_install_syslog ( " etape1: la connexion au serveur par le user " . $conf -> db -> user . " est reussie " );
2007-05-08 23:54:11 +02:00
print " <tr><td> " ;
print $langs -> trans ( " ServerConnection " ) . " : " ;
print $dolibarr_main_db_host ;
print " </td><td> " ;
print $langs -> trans ( " OK " );
print " </td></tr> " ;
2007-05-10 20:58:52 +02:00
dolibarr_install_syslog ( " etape1: la connexion a la base " . $conf -> db -> name . " ,par le user " . $conf -> db -> user . " a <20> chou<6F> " );
2007-05-08 23:54:11 +02:00
print " <tr><td> " ;
print $langs -> trans ( " DatabaseConnection " ) . " : " ;
print $dolibarr_main_db_name ;
print '</td><td>' ;
print $langs -> trans ( " Error " );
print " </td></tr> " ;
// Affiche aide diagnostique
print '<tr><td colspan="2"><br>V<> rifier que le nom de base "<b>' . $dolibarr_main_db_name . '</b>" est correct.<br>' ;
print 'Si ce nom est correct et que cette base n\'existe pas d<> j<EFBFBD> , vous devez cocher l\'option "Cr<43> er la base de donn<6E> e".<br>' ;
print $langs -> trans ( " ErrorGoBackAndCorrectParameters " ) . '<br><br>' ;
print '</td></tr>' ;
$error ++ ;
}
}
else
{
2007-09-09 12:40:17 +02:00
dolibarr_install_syslog ( " etape1: la connexion au serveur par le user " . $conf -> db -> user . " est rate " );
2007-05-08 23:54:11 +02:00
print " <tr><td> " ;
print $langs -> trans ( " ServerConnection " ) . " : " ;
print $dolibarr_main_db_host ;
print '</td><td>' ;
print '<font class="error">' . $db -> error . '</div>' ;
print " </td></tr> " ;
// Affiche aide diagnostique
2008-08-29 21:01:20 +02:00
print '<tr><td colspan="2"><br>Le serveur "<b>' . $conf -> db -> host . '</b>", nom de base "<b>' . $conf -> db -> name . '</b>", login "<b>' . $conf -> db -> user . '</b>", ou mot de passe de la base de donn<6E> e est peut-<2D> tre incorrect ou la version du client PHP trop ancienne par rapport <20> la version de la base de donn<6E> e.<br>' ;
2007-05-08 23:54:11 +02:00
print 'Si le login n\'existe pas encore, vous devez cocher l\'option "Cr<43> er l\'utilisateur".<br>' ;
print $langs -> trans ( " ErrorGoBackAndCorrectParameters " ) . '<br><br>' ;
print '</td></tr>' ;
$error ++ ;
}
}
}
2007-04-18 19:38:55 +02:00
print '</table>' ;
2004-01-27 15:36:40 +01:00
}
2005-03-24 00:27:50 +01:00
2005-10-30 02:07:00 +01:00
pFooter ( $error , $setuplang );
2005-09-24 01:36:48 +02:00
2004-01-30 17:00:18 +01:00
?>