New: Ajout test prerequis PHP a l'install sur support des _GET et _POST
This commit is contained in:
parent
97bc40dd7f
commit
92d4294894
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Océbo <marc@ocebo.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -66,6 +66,17 @@ else
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphp())."<br>\n";
|
||||
}
|
||||
|
||||
// Check PHP support for $_POST
|
||||
if (! isset($_GET["testget"]) && ! isset($_POST["testpost"]))
|
||||
{
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("PHPSupportPOSTGETKo")."<br>\n";
|
||||
$checksok=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk")."<br>\n";
|
||||
}
|
||||
|
||||
// Si session non actives
|
||||
if (! function_exists("session_id"))
|
||||
{
|
||||
|
||||
@ -122,17 +122,24 @@ if (isset($main_url) && $main_url)
|
||||
$dolibarr_main_url_root=$main_url;
|
||||
if (! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0)
|
||||
{
|
||||
if (isset($_SERVER["SCRIPT_URI"])) { # Si défini
|
||||
# Si défini (Ex: Apache sous Linux)
|
||||
if (isset($_SERVER["SCRIPT_URI"])) {
|
||||
$dolibarr_main_url_root=$_SERVER["SCRIPT_URI"];
|
||||
}
|
||||
else { # SCRIPT_URI n'est pas toujours défini (Exemple: Apache 2.0.44 pour Windows)
|
||||
# Si défini (Ex: Apache sous Caudium)
|
||||
elseif (isset($_SERVER["SERVER_URL"]) && isset($_SERVER["DOCUMENT_URI"])) {
|
||||
$dolibarr_main_url_root=$_SERVER["SERVER_URL"].$_SERVER["DOCUMENT_URI"];
|
||||
}
|
||||
# Si SCRIPT_URI, SERVER_URL, DOCUMENT_URI non défini (Ex: Apache 2.0.44 pour Windows)
|
||||
else {
|
||||
$dolibarr_main_url_root="http://".$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"];
|
||||
}
|
||||
$dolibarr_main_url_root = substr($dolibarr_main_url_root,0,strlen($dolibarr_main_url_root)-12);
|
||||
# Nettoyage de l'URL proposée
|
||||
$dolibarr_main_url_root = ereg_replace('\/$','',$dolibarr_main_url_root); # Supprime le /
|
||||
$dolibarr_main_url_root = ereg_replace('\/index\.php$','',$dolibarr_main_url_root); # Supprime le /index.php
|
||||
$dolibarr_main_url_root = ereg_replace('\/install$','',$dolibarr_main_url_root); # Supprime le /install
|
||||
// $dolibarr_main_url_root = substr($dolibarr_main_url_root,0,strlen($dolibarr_main_url_root)-12);
|
||||
$dolibarr_main_url_root = ereg_replace('\/fileconf\.php$','',$dolibarr_main_url_root); # Supprime le /fileconf.php
|
||||
$dolibarr_main_url_root = ereg_replace('\/$','',$dolibarr_main_url_root); # Supprime le /
|
||||
$dolibarr_main_url_root = ereg_replace('\/index\.php$','',$dolibarr_main_url_root); # Supprime le /index.php
|
||||
$dolibarr_main_url_root = ereg_replace('\/install$','',$dolibarr_main_url_root); # Supprime le /install
|
||||
}
|
||||
|
||||
print $dolibarr_main_url_root;
|
||||
|
||||
@ -108,7 +108,7 @@ function pHeader($soutitre,$next,$action='set')
|
||||
print '<body>';
|
||||
print '<span class="titre"><a class="titre" href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("DolibarrSetup").'</a></span>';
|
||||
|
||||
print '<form action="'.$next.'.php?testget=ok" method="POST">';
|
||||
print '<form action="'.$next.'.php" method="POST">';
|
||||
print '<input type="hidden" name="testpost" value="ok">';
|
||||
print '<input type="hidden" name="action" value="'.$action.'">';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user