Ajout tests de prrequis avant install
This commit is contained in:
parent
34a0b6fa83
commit
b641877d67
@ -31,6 +31,7 @@
|
||||
$err = 0;
|
||||
$allowinstall = 0;
|
||||
$allowupgrade = 0;
|
||||
$checksok = 1;
|
||||
|
||||
include_once("./inc.php");
|
||||
|
||||
@ -49,7 +50,32 @@ print '<center><img src="../theme/dolibarr_logo_2.png" alt="Dolibarr logo"></cen
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print $langs->trans("InstallEasy")."<br>\n";
|
||||
print $langs->trans("InstallEasy")."<br><br>\n";
|
||||
|
||||
|
||||
print '<b>'.$langs->trans("MiscellanousChecks")."</b>:<br>\n";
|
||||
|
||||
// Check PHP version
|
||||
if (versioncompare(versionphp(),array(4,1)) < 0)
|
||||
{
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow",'4.1')."<br>\n";
|
||||
$checksok=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphp())."<br>\n";
|
||||
}
|
||||
|
||||
// Si session non actives
|
||||
if (! function_exists("session_id"))
|
||||
{
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions")."<br>\n";
|
||||
$checksok=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportSessions")."<br>\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 "<br /><br />";
|
||||
print $langs->trans("ConfFileDoesNotExists",'conf.php');
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExists",'conf.php');
|
||||
print "<br />";
|
||||
print $langs->trans("YouMustCreateWithPermission",'htdocs/conf/conf.php');
|
||||
print "<br /><br />";
|
||||
@ -93,20 +118,19 @@ if (!file_exists($conffile))
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<br />\n";
|
||||
// Si fichier présent mais ne peut etre modifié
|
||||
if (!is_writable($conffile))
|
||||
{
|
||||
if ($confexists)
|
||||
{
|
||||
print $langs->trans("ConfFileExists",'conf.php');
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileExists",'conf.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ConfFileCouldBeCreated",'conf.php');
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileCouldBeCreated",'conf.php');
|
||||
}
|
||||
print "<br />";
|
||||
print $langs->trans("ConfFileIsNotWritable",'htdocs/conf/conf.php');
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Warning"> '.$langs->trans("ConfFileIsNotWritable",'htdocs/conf/conf.php');
|
||||
print "<br />\n";
|
||||
|
||||
$allowinstall=0;
|
||||
@ -116,14 +140,14 @@ else
|
||||
{
|
||||
if ($confexists)
|
||||
{
|
||||
print $langs->trans("ConfFileExists",'conf.php');
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileExists",'conf.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ConfFileCouldBeCreated",'conf.php');
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileCouldBeCreated",'conf.php');
|
||||
}
|
||||
print "<br />";
|
||||
print $langs->trans("ConfFileIsWritable",'conf.php');
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileIsWritable",'conf.php');
|
||||
print "<br />\n";
|
||||
|
||||
$allowinstall=1;
|
||||
@ -131,47 +155,48 @@ else
|
||||
print "<br />\n";
|
||||
print "<br />\n";
|
||||
|
||||
// Si pas d'erreur, on affiche le bouton pour passer à l'étape suivante
|
||||
|
||||
|
||||
print $langs->trans("ChooseYourSetupMode");
|
||||
|
||||
print '<table width="100%" cellspacing="1" cellpadding="4" border="1">';
|
||||
|
||||
print '<tr><td nowrap="nowrap"><b>'.$langs->trans("FreshInstall").'</b></td><td>';
|
||||
print $langs->trans("FreshInstallDesc").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($allowinstall)
|
||||
{
|
||||
print '<a href="licence.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("InstallNotAllowed");
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '<tr><td nowrap="nowrap"><b>'.$langs->trans("Upgrade").'</b></td><td>';
|
||||
print $langs->trans("UpgradeDesc").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($allowupgrade)
|
||||
{
|
||||
print '<a href="upgrade.php?action=upgrade&selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NotAvailable");
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
print "\n";
|
||||
// Si prerequis ok, on affiche le bouton pour passer à l'étape suivante
|
||||
if ($checksok)
|
||||
{
|
||||
print $langs->trans("ChooseYourSetupMode");
|
||||
|
||||
print '<table width="100%" cellspacing="1" cellpadding="4" border="1">';
|
||||
|
||||
print '<tr><td nowrap="nowrap"><b>'.$langs->trans("FreshInstall").'</b></td><td>';
|
||||
print $langs->trans("FreshInstallDesc").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($allowinstall)
|
||||
{
|
||||
print '<a href="licence.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("InstallNotAllowed");
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '<tr><td nowrap="nowrap"><b>'.$langs->trans("Upgrade").'</b></td><td>';
|
||||
print $langs->trans("UpgradeDesc").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($allowupgrade)
|
||||
{
|
||||
print '<a href="upgrade.php?action=upgrade&selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NotAvailable");
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
pFooter(1);
|
||||
pFooter(1); // 1 car ne doit jamais afficher bouton Suivant
|
||||
|
||||
?>
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 <b>%s</b> exists.
|
||||
ConfFileCouldBeCreated=Configuration file <b>%s</b> could be created.
|
||||
ConfFileIsNotWritable=Configuration file <b>%s</b> 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 <b>%s</b> is writable.
|
||||
ConfFileDoesNotExists=Configuration file <b>%s</b> 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
|
||||
|
||||
@ -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 <b>%s</b> existe.
|
||||
ConfFileDoesNotExists=Le fichier de configuration <b>%s</b> n'existe pas !
|
||||
ConfFileCouldBeCreated=Le fichier de configuration <b>%s</b> a pu être créé.
|
||||
ConfFileIsNotWritable=Le fichier <b>%s</b> 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 <b>%s</b> 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 <b>%s</b> 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
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user