Uniformize code

This commit is contained in:
Laurent Destailleur 2012-04-08 23:18:36 +02:00
parent 557d5e775a
commit 6da82e03be
6 changed files with 26 additions and 22 deletions

View File

@ -35,11 +35,11 @@ $langs->setDefaultLang($setuplang);
$langs->load("install");
// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard.
if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin='';
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
if (@file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); }
else if (@file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); }
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); }
dolibarr_install_syslog("Dolibarr install/upgrade process started");

View File

@ -43,10 +43,11 @@ $passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:"";
// Repertoire des pages dolibarr
$main_dir=isset($_POST["main_dir"])?trim($_POST["main_dir"]):'';
// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard.
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); }
else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); }
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); }
dolibarr_install_syslog("--- etape1: Entering etape1.php page");

View File

@ -52,10 +52,11 @@ if ($dolibarr_main_db_type == "pgsql") $choix=2;
if ($dolibarr_main_db_type == "mssql") $choix=3;
//if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into etape2.php page');
// Init "forced values" to nothing. "forced values" are used after a Doliwamp install wizard.
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); }
else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); }
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); }
dolibarr_install_syslog("--- etape2: Entering etape2.php page");

View File

@ -36,11 +36,11 @@ $langs->setDefaultLang($setuplang);
$langs->load("admin");
$langs->load("install");
// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard.
if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin='';
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); }
else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); }
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); }
dolibarr_install_syslog("--- etape4: Entering etape4.php page");
@ -74,7 +74,7 @@ $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db-
if ($db->ok == 1)
{
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>';
print '<input name="login" value="'.(! empty($_GET["login"])?$_GET["login"]:$force_install_dolibarrlogin).'"></td></tr>';
print '<input name="login" value="'.(! empty($_GET["login"])?$_GET["login"]:(isset($force_install_dolibarrlogin)?$force_install_dolibarrlogin:'')).'"></td></tr>';
print '<tr><td>'.$langs->trans("Password").' :</td><td>';
print '<input type="password" name="pass"></td></tr>';
print '<tr><td>'.$langs->trans("PasswordAgain").' :</td><td>';
@ -106,9 +106,9 @@ if ($db->ok == 1)
}
$db->close();
dolibarr_install_syslog("--- install/etape4.php end", LOG_INFO);
pFooter($err,$setuplang);
$db->close();
?>

View File

@ -61,9 +61,11 @@ if (! isset($force_install_databasepass)) $force_install_databasepass='';
if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin='';
if (! isset($force_install_databaserootpass)) $force_install_databaserootpass='';
if (! isset($force_install_lockinstall)) $force_install_lockinstall='';
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); }
else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); }
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); }
dolibarr_install_syslog("--- etape5: Entering etape5.php page", LOG_INFO);

View File

@ -53,14 +53,14 @@ if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=
if (! isset($force_install_databaserootpass)) $force_install_databaserootpass='';
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); }
else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); }
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); }
dolibarr_install_syslog("Fileconf: Entering fileconf.php page");
/*
* View
*/