diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index 539e33352b7..6b852165c5a 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -31,6 +31,7 @@
$err = 0;
$allowinstall = 0;
$allowupgrade = 0;
+$checksok = 1;
include_once("./inc.php");
@@ -49,7 +50,32 @@ print '
\n";
-print $langs->trans("InstallEasy")."
\n";
+print $langs->trans("InstallEasy")."
\n";
+
+
+print ''.$langs->trans("MiscellanousChecks").":
\n";
+
+// Check PHP version
+if (versioncompare(versionphp(),array(4,1)) < 0)
+{
+ print '
'.$langs->trans("ErrorPHPVersionTooLow",'4.1')."
\n";
+ $checksok=0;
+}
+else
+{
+ print '
'.$langs->trans("PHPVersion")." ".versiontostring(versionphp())."
\n";
+}
+
+// Si session non actives
+if (! function_exists("session_id"))
+{
+ print '
'.$langs->trans("ErrorPHPDoesNotSupportSessions")."
\n";
+ $checksok=0;
+}
+else
+{
+ print '
'.$langs->trans("PHPSupportSessions")."
\n";
+}
// Si fichier présent et lisible et renseigné
clearstatcache();
@@ -80,10 +106,9 @@ else
}
// Si fichier absent et n'a pu etre créé
-if (!file_exists($conffile))
+if (! file_exists($conffile))
{
- print "
";
- print $langs->trans("ConfFileDoesNotExists",'conf.php');
+ print '
'.$langs->trans("ConfFileDoesNotExists",'conf.php');
print "
";
print $langs->trans("YouMustCreateWithPermission",'htdocs/conf/conf.php');
print "
";
@@ -93,20 +118,19 @@ if (!file_exists($conffile))
}
else
{
- print "
\n";
// Si fichier présent mais ne peut etre modifié
if (!is_writable($conffile))
{
if ($confexists)
{
- print $langs->trans("ConfFileExists",'conf.php');
+ print '
'.$langs->trans("ConfFileExists",'conf.php');
}
else
{
- print $langs->trans("ConfFileCouldBeCreated",'conf.php');
+ print '
'.$langs->trans("ConfFileCouldBeCreated",'conf.php');
}
print "
";
- print $langs->trans("ConfFileIsNotWritable",'htdocs/conf/conf.php');
+ print '
'.$langs->trans("ConfFileIsNotWritable",'htdocs/conf/conf.php');
print "
\n";
$allowinstall=0;
@@ -116,14 +140,14 @@ else
{
if ($confexists)
{
- print $langs->trans("ConfFileExists",'conf.php');
+ print '
'.$langs->trans("ConfFileExists",'conf.php');
}
else
{
- print $langs->trans("ConfFileCouldBeCreated",'conf.php');
+ print '
'.$langs->trans("ConfFileCouldBeCreated",'conf.php');
}
print "
";
- print $langs->trans("ConfFileIsWritable",'conf.php');
+ print '
'.$langs->trans("ConfFileIsWritable",'conf.php');
print "
\n";
$allowinstall=1;
@@ -131,47 +155,48 @@ else
print "
\n";
print "
\n";
- // Si pas d'erreur, on affiche le bouton pour passer à l'étape suivante
-
-
- print $langs->trans("ChooseYourSetupMode");
-
- print '';
-
- print '| '.$langs->trans("FreshInstall").' | ';
- print $langs->trans("FreshInstallDesc").' | ';
- print '';
- if ($allowinstall)
- {
- print ''.$langs->trans("Start").'';
- }
- else
- {
- print $langs->trans("InstallNotAllowed");
- }
- print ' | ';
- print '
'."\n";
-
- print '| '.$langs->trans("Upgrade").' | ';
- print $langs->trans("UpgradeDesc").' | ';
- print '';
- if ($allowupgrade)
- {
- print ''.$langs->trans("Start").'';
- }
- else
- {
- print $langs->trans("NotAvailable");
- }
- print ' | ';
- print '
'."\n";
-
- print '
';
- print "\n";
+ // Si prerequis ok, on affiche le bouton pour passer à l'étape suivante
+ if ($checksok)
+ {
+ print $langs->trans("ChooseYourSetupMode");
+
+ print '';
+
+ print '| '.$langs->trans("FreshInstall").' | ';
+ print $langs->trans("FreshInstallDesc").' | ';
+ print '';
+ if ($allowinstall)
+ {
+ print ''.$langs->trans("Start").'';
+ }
+ else
+ {
+ print $langs->trans("InstallNotAllowed");
+ }
+ print ' | ';
+ print '
'."\n";
+
+ print '| '.$langs->trans("Upgrade").' | ';
+ print $langs->trans("UpgradeDesc").' | ';
+ print '';
+ if ($allowupgrade)
+ {
+ print ''.$langs->trans("Start").'';
+ }
+ else
+ {
+ print $langs->trans("NotAvailable");
+ }
+ print ' | ';
+ print '
'."\n";
+
+ print '
';
+ print "\n";
+ }
}
-pFooter(1);
+pFooter(1); // 1 car ne doit jamais afficher bouton Suivant
?>
diff --git a/htdocs/install/default.css b/htdocs/install/default.css
index 41c4e014dd4..01e5f1f3063 100644
--- a/htdocs/install/default.css
+++ b/htdocs/install/default.css
@@ -83,6 +83,10 @@ margin: 0.5em 0em 0.5em 0em;
border: 1px solid #6C7C8B;
}
+font.error {
+color: #550000;
+}
+
div.barrebottom {
text-align: right;
margin-top: 10px;
diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang
index 5d6f3815792..7e513da6293 100644
--- a/htdocs/langs/en_US/install.lang
+++ b/htdocs/langs/en_US/install.lang
@@ -1,16 +1,21 @@
# Dolibarr language file - en_US - install
InstallEasy=We tried to make Dolibarr setup as easy as possible. Just follow instructions step by step.
+MiscellanousChecks=Prerequisites checks
DolibarrWelcome=Welcome on Dolibarr
ConfFileExists=Configuration file %s exists.
ConfFileCouldBeCreated=Configuration file %s could be created.
ConfFileIsNotWritable=Configuration file %s is not writable. Check permissions. For first install, your web server must be granted to be able to write into this file during configuration process ("chmod 666" for example on Unix like OS).
ConfFileIsWritable=Configuration file %s is writable.
ConfFileDoesNotExists=Configuration file %s does not exist !
+PHPSupportSessions=This PHP supports sessions.
+ErrorPHPDoesNotSupportSessions=Your PHP installation does not support sessions. This feature is required to make Dolibarr working. Check your PHP setup.
ErrorDirDoesNotExists=Directory %s does not exists.
ErrorGoBackAndCorrectParameters=Go backward and correct wrong parameters.
ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'.
ErrorFaileToCreateDatabase=Failed to create database '%'.
ErrorFaileToConnectToDatabase=Failed to connect to database '%'.
+ErrorPHPVersionTooLow=PHP version too old. Version %s is required.
+PHPVersion=PHP Version
YouCanContinue=You can continue...
License=Using license
ConfigurationFile=Configuration file
diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang
index f09ed78e373..2344b427a94 100644
--- a/htdocs/langs/fr_FR/install.lang
+++ b/htdocs/langs/fr_FR/install.lang
@@ -1,16 +1,21 @@
# Dolibarr language file - fr_FR - install
InstallEasy=Nous avons fait en sorte que l'installation soit le plus simple possible, vous n'avez qu'à suivre les étapes une à une.
+MiscellanousChecks=Vérification de prérequis
DolibarrWelcome=Bienvenue sur Dolibarr
ConfFileExists=Le fichier de configuration %s existe.
ConfFileDoesNotExists=Le fichier de configuration %s n'existe pas !
ConfFileCouldBeCreated=Le fichier de configuration %s a pu être créé.
ConfFileIsNotWritable=Le fichier %s n'est pas modifiable. Pour une première installation, modifiez ses permissions. Le serveur Web doit avoir le droit d'écrire dans ce fichier le temps de la configuration ("chmod 666" par exemple sur un OS compatible Unix).
ConfFileIsWritable=Le fichier %s est modifiable.
+PHPSupportSessions=Ce PHP supporte les sessions.
+ErrorPHPDoesNotSupportSessions=Votre installation PHP ne supporte pas les sessions. Cette fonctionnalité est requise pour faire fonctionner Dolibarr. Vérifiez votre configuration de PHP.
ErrorDirDoesNotExists=Le répertoire %s n'existe pas ou n'est pas accessible.
ErrorGoBackAndCorrectParameters=Revenez en arrière et corrigez les paramètres invalides.
ErrorWrongValueForParameter=Vous avez peut-être saisi une mauvaise valeur pour le paramètre '%s'.
ErrorFaileToCreateDatabase=Echec de création de la base '%'.
ErrorFaileToConnectToDatabase=Echec de connection à la base '%'.
+ErrorPHPVersionTooLow=Version de PHP trop ancienne. La version %s est requise.
+PHPVersion=Version PHP
YouCanContinue=Vous pouvez continuer...
License=Licence d'utilisation
ConfigurationFile=Fichier de configuration
diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php
index 1dd728b485d..492c9e23a4b 100644
--- a/htdocs/lib/functions.inc.php
+++ b/htdocs/lib/functions.inc.php
@@ -76,7 +76,7 @@ function versioncompare($versionarray1,$versionarray2)
/**
- \brief Compare 2 versions
+ \brief Renvoie version PHP
\return array Tableau de version (vermajeur,vermineur,autre)
*/
function versionphp()