From aab3fc9e7c48ed77aa817fb85015ed72fe3458b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2009 18:32:35 +0000 Subject: [PATCH] First try to reduce usage of $dolibarr_main_url_root. --- ChangeLog | 4 ++-- htdocs/install/etape5.php | 6 +++--- htdocs/install/repair.php | 19 ++++++++++++------- htdocs/master.inc.php | 6 +++++- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1cfa3c714c..6b33f272ba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,8 +83,8 @@ For developers: - Updated wiki documentation. - Better W3C standard. - Can add init data when enabling a module. -- Can fix some corruptions in database by calling the update page with - action=repair +- Can fix some corruptions in database by calling the update page + /install/repair.ksh - Log files contains more information (PHP_SELD added and OS user used for log of command lines scripts) - Can protect a module to not being enabled if javascript disabled. diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 7ff8b81c85c..2bd65234b37 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -294,7 +294,7 @@ if ($_POST["action"] == "set") print $langs->trans("YouNeedToPersonalizeSetup")."

"; - print '
'; + print '
'; print $langs->trans("GoToSetupArea"); print '
'; } @@ -332,7 +332,7 @@ elseif (eregi('upgrade',$_POST["action"])) print "
"; - print '
'; + print '
'; print $langs->trans("GoToDolibarr"); print '
'; } @@ -344,7 +344,7 @@ elseif (eregi('upgrade',$_POST["action"])) print "
"; - print '
'; + print '
'; print $langs->trans("GoToUpgradePage"); print '
'; } diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index f527bb1cc02..cd4b2f1286d 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -56,8 +56,8 @@ if ($dolibarr_main_db_type == "pgsql") $choix=2; if ($dolibarr_main_db_type == "mssql") $choix=3; -dolibarr_install_syslog("upgrade: Entering upgrade.php page"); -if (! is_object($conf)) dolibarr_install_syslog("upgrade2: conf file not initialized",LOG_ERR); +dolibarr_install_syslog("repair: Entering upgrade.php page"); +if (! is_object($conf)) dolibarr_install_syslog("repair: conf file not initialized",LOG_ERR); /* @@ -102,13 +102,13 @@ if ($db->connected == 1) { print ''; print $langs->trans("ServerConnection")." : $dolibarr_main_db_host".$langs->trans("OK").""; - dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerConnection")." : $dolibarr_main_db_host ".$langs->transnoentities("OK")); + dolibarr_install_syslog("repair: ".$langs->transnoentities("ServerConnection")." : $dolibarr_main_db_host ".$langs->transnoentities("OK")); $ok = 1; } else { print "".$langs->trans("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)."".$langs->transnoentities("Error").""; - dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)); + dolibarr_install_syslog("repair: ".$langs->transnoentities("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)); $ok = 0; } @@ -118,13 +118,13 @@ if ($ok) { print ''; print $langs->trans("DatabaseConnection")." : ".$dolibarr_main_db_name."".$langs->trans("OK").""; - dolibarr_install_syslog("upgrade: Database connection successfull : $dolibarr_main_db_name"); + dolibarr_install_syslog("repair: Database connection successfull : $dolibarr_main_db_name"); $ok=1; } else { print "".$langs->trans("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)."".$langs->trans("Error").""; - dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)); + dolibarr_install_syslog("repair: ".$langs->transnoentities("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)); $ok=0; } } @@ -136,7 +136,7 @@ if ($ok) $versionarray=$db->getVersionArray(); print ''.$langs->trans("ServerVersion").''; print ''.$version.''; - dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerVersion")." : $version"); + dolibarr_install_syslog("repair: ".$langs->transnoentities("ServerVersion")." : $version"); //print ''.join('.',$versionarray).''; } @@ -201,6 +201,11 @@ if (empty($actiondone)) print '
'.$langs->trans("ErrorWrongParameters").'
'; } + +print '
'; +print $langs->trans("GoToDolibarr"); +print '
'; + pFooter(1,$setuplang); ?> diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index b81d5780138..d65bb0cda0c 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -80,7 +80,11 @@ if (empty($dolibarr_main_data_root)) // Define some constants define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem pages php (htdocs) define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem donnes (documents) -if ($dolibarr_main_url_root == 'auto') $dolibarr_main_url_root=$_SERVER["SERVER_NAME"]; // This make possible to reach web site with different URLs (works only if dolibarr dir is virtual web root dir). +if ($dolibarr_main_url_root == 'auto') +{ + // TODO Try to define dolibarr_main_url_root with non root installation + $dolibarr_main_url_root=$_SERVER["SERVER_NAME"]; // This make possible to reach web site with different URLs (works only if dolibarr dir is virtual web root dir). +} define('DOL_MAIN_URL_ROOT', $dolibarr_main_url_root); // URL relative root $uri=eregi_replace('^http(s?)://','',$dolibarr_main_url_root); // $suburi contains url without http* $suburi = strstr ($uri, '/'); // $suburi contains url without domain