minor html and css corrections (as shown by browser validation and phpstorm inspections)

This commit is contained in:
Steve 2018-07-07 23:50:41 +02:00
parent 5944c161bc
commit 65e42522d3
11 changed files with 159 additions and 165 deletions

View File

@ -40,7 +40,7 @@ $langs->setDefaultLang($setuplang);
$langs->load("install"); $langs->load("install");
// Now we load forced value from install.forced.php file. // Now we load forced/pre-set values from install.forced.php file.
$useforcedwizard=false; $useforcedwizard=false;
$forcedfile="./install.forced.php"; $forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
@ -49,14 +49,14 @@ if (@file_exists($forcedfile)) {
include_once $forcedfile; include_once $forcedfile;
} }
dolibarr_install_syslog("--- check: Dolibarr install/upgrade process started"); dolibarr_install_syslog("- check: Dolibarr install/upgrade process started");
/* /*
* View * View
*/ */
pHeader('',''); // No next step for navigation buttons. Next step is defined by clik on links. pHeader('',''); // No next step for navigation buttons. Next step is defined by click on links.
//print "<br>\n"; //print "<br>\n";
@ -233,13 +233,13 @@ else
else dolibarr_install_syslog("check: failed to create a new file " . $conffile . " into current dir " . getcwd() . ". Please check permissions.", LOG_ERR); else dolibarr_install_syslog("check: failed to create a new file " . $conffile . " into current dir " . getcwd() . ". Please check permissions.", LOG_ERR);
} }
// First install, we can't upgrade // First install: no upgrade necessary/required
$allowupgrade=false; $allowupgrade=false;
} }
// File is missng and can't be created // File is missing and cannot be created
if (! file_exists($conffile)) if (! file_exists($conffile))
{ {
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffiletoshow); print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffiletoshow);
@ -258,7 +258,7 @@ else
$allowinstall=0; $allowinstall=0;
} }
// File exists but can't be modified // File exists but cannot be modified
elseif (!is_writable($conffile)) elseif (!is_writable($conffile))
{ {
if ($confexists) if ($confexists)
@ -294,7 +294,7 @@ else
} }
print "<br>\n"; print "<br>\n";
// Requirements ok, we display the next step button // Requirements met/all ok: display the next step button
if ($checksok) if ($checksok)
{ {
$ok=0; $ok=0;
@ -307,7 +307,7 @@ else
{ {
if (! file_exists($dolibarr_main_document_root."/core/lib/admin.lib.php")) if (! file_exists($dolibarr_main_document_root."/core/lib/admin.lib.php"))
{ {
print '<font class="error">A '.$conffiletoshow.' file exists with a dolibarr_main_document_root to '.$dolibarr_main_document_root.' that seems wrong. Try to fix or remove the '.$conffiletoshow.' file.</font><br>'."\n"; print '<span class="error">A '.$conffiletoshow.' file exists with a dolibarr_main_document_root to '.$dolibarr_main_document_root.' that seems wrong. Try to fix or remove the '.$conffiletoshow.' file.</span><br>'."\n";
dol_syslog("A '" . $conffiletoshow . "' file exists with a dolibarr_main_document_root to " . $dolibarr_main_document_root . " that seems wrong. Try to fix or remove the '" . $conffiletoshow . "' file.", LOG_WARNING); dol_syslog("A '" . $conffiletoshow . "' file exists with a dolibarr_main_document_root to " . $dolibarr_main_document_root . " that seems wrong. Try to fix or remove the '" . $conffiletoshow . "' file.", LOG_WARNING);
} }
else else
@ -326,7 +326,7 @@ else
else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
} }
// $conf is already instancied inside inc.php // $conf already created in inc.php
$conf->db->type = $dolibarr_main_db_type; $conf->db->type = $dolibarr_main_db_type;
$conf->db->host = $dolibarr_main_db_host; $conf->db->host = $dolibarr_main_db_host;
$conf->db->port = $dolibarr_main_db_port; $conf->db->port = $dolibarr_main_db_port;
@ -342,7 +342,7 @@ else
} }
} }
// If a database access is available, we set more variable // If database access is available, we set more variables
if ($ok) if ($ok)
{ {
if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0; if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0;
@ -364,8 +364,8 @@ else
// Show title // Show title
if (! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ! empty($conf->global->MAIN_VERSION_LAST_INSTALL)) if (! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ! empty($conf->global->MAIN_VERSION_LAST_INSTALL))
{ {
print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.(empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE).'</font></b><br>'; print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.(empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE).'</span></b><br>';
print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b>'; print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b>';
//print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired")); //print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired"));
print '<br>'; print '<br>';
print '<br>'; print '<br>';
@ -375,7 +375,7 @@ else
print $langs->trans("InstallEasy")." "; print $langs->trans("InstallEasy")." ";
print $langs->trans("ChooseYourSetupMode"); print $langs->trans("ChooseYourSetupMode");
print '<br><br>'; print '<br>';
$foundrecommandedchoice=0; $foundrecommandedchoice=0;
@ -383,9 +383,9 @@ else
$notavailable_choices = array(); $notavailable_choices = array();
// Show first install line // Show first install line
$choice = '<tr class="listofchoices"><td class="listofchoices nowrap" align="center"><b>'.$langs->trans("FreshInstall").'</b>'; $choice = "\n".'<tr><td class="nowrap center"><b>'.$langs->trans("FreshInstall").'</b>';
$choice .= '</td>'; $choice .= '</td>';
$choice .= '<td class="listofchoices listofchoicesdesc">'; $choice .= '<td class="listofchoicesdesc">';
$choice .= $langs->trans("FreshInstallDesc"); $choice .= $langs->trans("FreshInstallDesc");
if (empty($dolibarr_main_db_host)) // This means install process was not run if (empty($dolibarr_main_db_host)) // This means install process was not run
{ {
@ -397,7 +397,7 @@ else
} }
$choice .= '</td>'; $choice .= '</td>';
$choice .= '<td class="listofchoices" align="center">'; $choice .= '<td class="center">';
if ($allowinstall) if ($allowinstall)
{ {
$choice .= '<a class="button" href="fileconf.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>'; $choice .= '<a class="button" href="fileconf.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
@ -465,7 +465,7 @@ else
if ($ok) if ($ok)
{ {
if (count($dolibarrlastupgradeversionarray) >= 2) // If a database access is available and last upgrade version is known if (count($dolibarrlastupgradeversionarray) >= 2) // If database access is available and last upgrade version is known
{ {
// Now we check if this is the first qualified choice // Now we check if this is the first qualified choice
if ($allowupgrade && empty($foundrecommandedchoice) && if ($allowupgrade && empty($foundrecommandedchoice) &&
@ -477,22 +477,23 @@ else
} }
} }
else { else {
// We can not recommand a choice. // We cannot recommend a choice.
// A version of install may be known, but we need last upgrade. // A version of install may be known, but we need last upgrade.
} }
} }
$choice .= '<tr class="listofchoices '.($recommended_choice ? 'choiceselected' : '').'">'; $choice .= "\n".'<tr'.($recommended_choice ? ' class="choiceselected"' : '').'>';
$choice .= '<td class="listofchoices nowrap" align="center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>'; $choice .= '<td class="nowrap center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>';
$choice .= '<td class="listofchoices listofchoicesdesc">'; $choice .= '<td class="listofchoicesdesc">';
$choice .= $langs->trans("UpgradeDesc"); $choice .= $langs->trans("UpgradeDesc");
if ($recommended_choice) if ($recommended_choice)
{ {
$choice .= '<br>'; $choice .= '<br>';
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
$choice .= '<div class="center"><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div>'; $choice .= '<div class="center">';
if ($count < count($migarray)) // There is other choices after $choice .= '<div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div>';
if ($count < count($migarray)) // There are other choices after
{ {
print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION); print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION);
} }
@ -500,7 +501,7 @@ else
} }
$choice .= '</td>'; $choice .= '</td>';
$choice .= '<td class="listofchoices" align="center">'; $choice .= '<td class="center">';
if ($allowupgrade) if ($allowupgrade)
{ {
$disabled=false; $disabled=false;
@ -512,8 +513,14 @@ else
{ {
$foundrecommandedchoice = 2; $foundrecommandedchoice = 2;
} }
if ($disabled) $choice .= '<span class="buttonDisable runupgrade"'.($disabled?' disabled="disabled"':'').' href="#">'.$langs->trans("NotAvailable").'</span>'; if ($disabled)
else $choice .= '<a class="button runupgrade"'.($disabled?' disabled="disabled"':'').' href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>'; {
$choice .= '<span class="button">'.$langs->trans("NotAvailable").'</span>';
}
else
{
$choice .= '<a class="button runupgrade" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
}
} }
else else
{ {
@ -537,28 +544,28 @@ else
} }
// Array of install choices // Array of install choices
print"\n";
print '<table width="100%" class="listofchoices">'; print '<table width="100%" class="listofchoices">';
foreach ($available_choices as $choice) { foreach ($available_choices as $choice) {
print $choice; print $choice;
} }
print '</table>'; print '</table>'."\n";
if (count($notavailable_choices)) { if (count($notavailable_choices)) {
print '<br>';
print '<div id="AShowChoices">'; print '<div id="AShowChoices">';
print '<img src="../theme/eldy/img/1downarrow.png"> <a href="#">'.$langs->trans('ShowNotAvailableOptions').'</a>'; print '<img src="../theme/eldy/img/1downarrow.png"> <a href="#">'.$langs->trans('ShowNotAvailableOptions').'</a>';
print '</div>'; print '</div>';
print '<div id="navail_choices" style="display:none">'; print '<div id="navail_choices" style="display:none">';
print '<br>'; print "<br>\n";
print '<table width="100%" class="listofchoices">'; print '<table width="100%" class="listofchoices">';
foreach ($notavailable_choices as $choice) { foreach ($notavailable_choices as $choice) {
print $choice; print $choice;
} }
print '</table>'; print '</table>'."\n";
print '</div>'; print '</div>';
} }
@ -590,6 +597,5 @@ $(".runupgrade").click(function() {
</script>'; </script>';
dolibarr_install_syslog("--- check: end"); dolibarr_install_syslog("- check: end");
pFooter(1); // Never display next button pFooter(1); // Never display next button

View File

@ -199,7 +199,7 @@ input:-webkit-autofill {
-webkit-box-shadow: 0 0 0 50px #FBFFEA inset; -webkit-box-shadow: 0 0 0 50px #FBFFEA inset;
} }
table.listofchoices, tr.listofchoices, td.listofchoices { table.listofchoices, table.listofchoices tr, table.listofchoices td {
border-collapse: collapse; border-collapse: collapse;
padding: 4px; padding: 4px;
color: #000000; color: #000000;
@ -207,9 +207,6 @@ table.listofchoices, tr.listofchoices, td.listofchoices {
line-height: 18px; line-height: 18px;
} }
tr.listofchoices {
height: 42px;
}
.listofchoicesdesc { .listofchoicesdesc {
color: #999 !important; color: #999 !important;
} }
@ -230,7 +227,7 @@ tr.listofchoices {
div.ok { div.ok {
color: #114466; color: #114466;
} }
font.ok { span.ok {
color: #114466; color: #114466;
} }
@ -238,7 +235,7 @@ font.ok {
div.warning { div.warning {
color: #777711; color: #777711;
} }
font.warning { span.warning {
color: #777711; color: #777711;
} }
@ -249,7 +246,7 @@ div.error {
padding: 0.2em 0.2em 0.2em 0; padding: 0.2em 0.2em 0.2em 0;
margin: 0.5em 0 0.5em 0; margin: 0.5em 0 0.5em 0;
} }
font.error { span.error {
color: #550000; color: #550000;
font-weight: bold; font-weight: bold;
} }

View File

@ -24,7 +24,7 @@
/** /**
* \file htdocs/install/fileconf.php * \file htdocs/install/fileconf.php
* \ingroup install * \ingroup install
* \brief Ask all informations required to build Dolibarr htdocs/conf/conf.php file (will be wrote on disk on next page step1) * \brief Ask all information required to build Dolibarr htdocs/conf/conf.php file (will be written to disk on next page step1)
*/ */
include_once 'inc.php'; include_once 'inc.php';
@ -39,7 +39,7 @@ $langs->setDefaultLang($setuplang);
$langs->load("install"); $langs->load("install");
$langs->load("errors"); $langs->load("errors");
dolibarr_install_syslog("--- fileconf: entering fileconf.php page"); dolibarr_install_syslog("- fileconf: entering fileconf.php page");
// You can force preselected values of the config step of Dolibarr by adding a file // You can force preselected values of the config step of Dolibarr by adding a file
// install.forced.php into directory htdocs/install (This is the case with some wizard // install.forced.php into directory htdocs/install (This is the case with some wizard
@ -56,7 +56,7 @@ if (! isset($force_install_databaselogin)) $force_install_databaselogin='';
if (! isset($force_install_databasepass)) $force_install_databasepass=''; if (! isset($force_install_databasepass)) $force_install_databasepass='';
if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin='';
if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; if (! isset($force_install_databaserootpass)) $force_install_databaserootpass='';
// Now we load forced value from install.forced.php file. // Now we load forced values from install.forced.php file.
$useforcedwizard=false; $useforcedwizard=false;
$forcedfile="./install.forced.php"; $forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; // Must be after inc.php if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; // Must be after inc.php
@ -71,7 +71,7 @@ if (@file_exists($forcedfile)) {
* View * View
*/ */
session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters) session_start(); // To be able to keep info into session (used for not losing pass during navigation. pass must not transit through parmaeters)
pHeader($langs->trans("ConfigurationFile"), "step1", "set", "", (empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/'), 'main-inside-bis'); pHeader($langs->trans("ConfigurationFile"), "step1", "set", "", (empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/'), 'main-inside-bis');
@ -80,7 +80,7 @@ if (! is_writable($conffile))
{ {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow); print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
dolibarr_install_syslog("fileconf: config file is not writable", LOG_WARNING); dolibarr_install_syslog("fileconf: config file is not writable", LOG_WARNING);
dolibarr_install_syslog("--- fileconf: end"); dolibarr_install_syslog("- fileconf: end");
pFooter(1,$setuplang,'jscheckparam'); pFooter(1,$setuplang,'jscheckparam');
exit; exit;
} }
@ -117,20 +117,18 @@ if (! empty($force_install_message))
<!-- Documents root $dolibarr_main_document_root --> <!-- Documents root $dolibarr_main_document_root -->
<tr> <tr>
<?php <td class="label"><label for="main_dir"><b><?php print $langs->trans("WebPagesDirectory"); ?></b></label></td>
print '<td class="tdtop label"><b>'; <?php
print $langs->trans("WebPagesDirectory");
print "</b></td>";
if (empty($dolibarr_main_url_root)) { if (empty($dolibarr_main_url_root)) {
$dolibarr_main_document_root = detect_dolibarr_main_document_root(); $dolibarr_main_document_root = detect_dolibarr_main_document_root();
} }
?> ?>
<td class="label tdtop"> <td class="label">
<input type="text" <input type="text"
class="minwidth300" class="minwidth300"
value="<?php print $dolibarr_main_document_root ?>" id="main_dir"
name="main_dir" name="main_dir"
value="<?php print $dolibarr_main_document_root ?>"
<?php if (!empty($force_install_noedit)) { <?php if (!empty($force_install_noedit)) {
print ' disabled'; print ' disabled';
} ?> } ?>
@ -149,19 +147,19 @@ if (! empty($force_install_message))
<!-- Documents URL $dolibarr_main_data_root --> <!-- Documents URL $dolibarr_main_data_root -->
<tr> <tr>
<td class="tdtop label"><b> <?php print $langs->trans("DocumentsDirectory"); ?></b> <td class="label"><label for="main_data_dir"><b><?php print $langs->trans("DocumentsDirectory"); ?></b></label></td>
</td>
<?php <?php
$dolibarr_main_data_root = @$force_install_main_data_root; $dolibarr_main_data_root = @$force_install_main_data_root;
if (empty($dolibarr_main_data_root)) { if (empty($dolibarr_main_data_root)) {
$dolibarr_main_data_root = detect_dolibarr_main_data_root($dolibarr_main_document_root); $dolibarr_main_data_root = detect_dolibarr_main_data_root($dolibarr_main_document_root);
} }
?> ?>
<td class="label tdtop"> <td class="label">
<input type="text" <input type="text"
class="minwidth300" class="minwidth300"
value="<?php print $dolibarr_main_data_root ?>" id="main_data_dir"
name="main_data_dir" name="main_data_dir"
value="<?php print $dolibarr_main_data_root ?>"
<?php if (!empty($force_install_noedit)) { <?php if (!empty($force_install_noedit)) {
print ' disabled'; print ' disabled';
} ?> } ?>
@ -186,12 +184,13 @@ if (! empty($force_install_message))
} }
?> ?>
<tr> <tr>
<td class="tdtop label"><b> <?php echo $langs->trans("URLRoot"); ?></b> <td class="label"><label for="main_url"><b><?php echo $langs->trans("URLRoot"); ?></b></label>
</td> </td>
<td class="tdtop label"> <td class="label">
<input type="text" <input type="text"
class="minwidth300" class="minwidth300"
name="main_url" id="main_url"
name="main_url"
value="<?php print $dolibarr_main_url_root; ?> " value="<?php print $dolibarr_main_url_root; ?> "
<?php if (!empty($force_install_noedit)) { <?php if (!empty($force_install_noedit)) {
print ' disabled'; print ' disabled';
@ -210,10 +209,11 @@ if (! empty($force_install_message))
if (! empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') { // Enabled if the installation process is "https://" if (! empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') { // Enabled if the installation process is "https://"
?> ?>
<tr> <tr>
<td class="tdtop label"><?php echo $langs->trans("ForceHttps"); ?></td> <td class="label"><label for="main_force_https"><?php echo $langs->trans("ForceHttps"); ?></label></td>
<td class="label tdtop"> <td class="label">
<input type="checkbox" <input type="checkbox"
name="main_force_https" id="main_force_https"
name="main_force_https"
<?php if (!empty($force_install_mainforcehttps)) { <?php if (!empty($force_install_mainforcehttps)) {
print ' checked'; print ' checked';
} ?> } ?>
@ -239,11 +239,11 @@ if (! empty($force_install_message))
</tr> </tr>
<tr> <tr>
<td class="label tdtop"><b> <?php echo $langs->trans("DatabaseName"); ?> <td class="label"><label for="db_name"><b><?php echo $langs->trans("DatabaseName"); ?></b></label></td>
</b></td> <td class="label">
<td class="label tdtop"> <input type="text"
<input type="text" id="db_name" id="db_name"
name="db_name" name="db_name"
value="<?php echo (!empty($dolibarr_main_db_name)) ? $dolibarr_main_db_name : ($force_install_database ? $force_install_database : 'dolibarr'); ?>" value="<?php echo (!empty($dolibarr_main_db_name)) ? $dolibarr_main_db_name : ($force_install_database ? $force_install_database : 'dolibarr'); ?>"
<?php if ($force_install_noedit == 2 && $force_install_database !== null) { <?php if ($force_install_noedit == 2 && $force_install_database !== null) {
print ' disabled'; print ' disabled';
@ -262,8 +262,7 @@ if (! empty($force_install_message))
?> ?>
<tr> <tr>
<!-- Driver type --> <!-- Driver type -->
<td class="tdtop label"><b> <?php echo $langs->trans("DriverType"); ?> <td class="label"><label for="db_type"><b><?php echo $langs->trans("DriverType"); ?></b></label></td>
</b></td>
<td class="label"> <td class="label">
<?php <?php
@ -338,10 +337,10 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite"> <tr class="hidesqlite">
<td class="tdtop label"><b> <?php echo $langs->trans("DatabaseServer"); ?> <td class="label"><label for="db_host"><b><?php echo $langs->trans("DatabaseServer"); ?></b></label></td>
</b></td> <td class="label">
<td class="tdtop label">
<input type="text" <input type="text"
id="db_host"
name="db_host" name="db_host"
value="<?php print (!empty($force_install_dbserver) ? $force_install_dbserver : (!empty($dolibarr_main_db_host) ? $dolibarr_main_db_host : 'localhost')); ?>" value="<?php print (!empty($force_install_dbserver) ? $force_install_dbserver : (!empty($dolibarr_main_db_host) ? $dolibarr_main_db_host : 'localhost')); ?>"
<?php if ($force_install_noedit == 2 && $force_install_dbserver !== null) { <?php if ($force_install_noedit == 2 && $force_install_dbserver !== null) {
@ -355,8 +354,8 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite"> <tr class="hidesqlite">
<td class="tdtop label"><?php echo $langs->trans("Port"); ?></td> <td class="label"><label for="db_port"><?php echo $langs->trans("Port"); ?></label></td>
<td class="tdtop label"> <td class="label">
<input type="text" <input type="text"
name="db_port" name="db_port"
id="db_port" id="db_port"
@ -372,10 +371,10 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite"> <tr class="hidesqlite">
<td class="label tdtop"><?php echo $langs->trans("DatabasePrefix"); ?> <td class="label"><label for="db_prefix"><?php echo $langs->trans("DatabasePrefix"); ?></label></td>
</td> <td class="label">
<td class="label tdtop"> <input type="text"
<input type="text" id="db_prefix" id="db_prefix"
name="db_prefix" name="db_prefix"
value="<?php echo(!empty($force_install_prefix) ? $force_install_prefix : (!empty($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : 'llx_')); ?>" value="<?php echo(!empty($force_install_prefix) ? $force_install_prefix : (!empty($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : 'llx_')); ?>"
<?php if ($force_install_noedit == 2 && $force_install_prefix !== null) { <?php if ($force_install_noedit == 2 && $force_install_prefix !== null) {
@ -387,9 +386,8 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite"> <tr class="hidesqlite">
<td class="label tdtop"><?php echo $langs->trans("CreateDatabase"); ?> <td class="label"><label for="db_create_database"><?php echo $langs->trans("CreateDatabase"); ?></label></td>
</td> <td class="label">
<td class="label tdtop">
<input type="checkbox" <input type="checkbox"
id="db_create_database" id="db_create_database"
name="db_create_database" name="db_create_database"
@ -406,10 +404,10 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite"> <tr class="hidesqlite">
<td class="label tdtop"><b><?php echo $langs->trans("Login"); ?></b> <td class="label"><label for="db_user"><b><?php echo $langs->trans("Login"); ?></b></label></td>
</td> <td class="label">
<td class="label tdtop"> <input type="text"
<input type="text" id="db_user" id="db_user"
name="db_user" name="db_user"
value="<?php print (!empty($force_install_databaselogin)) ? $force_install_databaselogin : $dolibarr_main_db_user; ?>" value="<?php print (!empty($force_install_databaselogin)) ? $force_install_databaselogin : $dolibarr_main_db_user; ?>"
<?php if ($force_install_noedit == 2 && $force_install_databaselogin !== null) { <?php if ($force_install_noedit == 2 && $force_install_databaselogin !== null) {
@ -421,10 +419,10 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite"> <tr class="hidesqlite">
<td class="label tdtop"><b><?php echo $langs->trans("Password"); ?></b> <td class="label"><label for="db_pass"><b><?php echo $langs->trans("Password"); ?></b></label></td>
</td> <td class="label">
<td class="label tdtop"> <input type="password"
<input type="password" id="db_pass" autocomplete="off" id="db_pass" autocomplete="off"
name="db_pass" name="db_pass"
value="<?php value="<?php
// If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1. // If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1.
@ -443,11 +441,11 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite"> <tr class="hidesqlite">
<td class="label tdtop"><?php echo $langs->trans("CreateUser"); ?> <td class="label"><label for="db_create_user"><?php echo $langs->trans("CreateUser"); ?></label></td>
</td> <td class="label">
<td class="label tdtop">
<input type="checkbox" <input type="checkbox"
id="db_create_user" name="db_create_user" id="db_create_user"
name="db_create_user"
<?php if (!empty($force_install_createuser)) { <?php if (!empty($force_install_createuser)) {
print ' checked'; print ' checked';
} ?> } ?>
@ -473,8 +471,8 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite hideroot"> <tr class="hidesqlite hideroot">
<td class="label tdtop"><b><?php echo $langs->trans("Login"); ?></b></td> <td class="label"><label for="db_user_root"><b><?php echo $langs->trans("Login"); ?></b></label></td>
<td class="label tdtop"> <td class="label">
<input type="text" <input type="text"
id="db_user_root" id="db_user_root"
name="db_user_root" name="db_user_root"
@ -497,9 +495,8 @@ if (! empty($force_install_message))
</tr> </tr>
<tr class="hidesqlite hideroot"> <tr class="hidesqlite hideroot">
<td class="label tdtop"><b><?php echo $langs->trans("Password"); ?></b> <td class="label"><label for="db_pass_root"><b><?php echo $langs->trans("Password"); ?></b></label></td>
</td> <td class="label">
<td class="label tdtop">
<input type="password" <input type="password"
autocomplete="off" autocomplete="off"
id="db_pass_root" id="db_pass_root"
@ -648,5 +645,5 @@ function jscheckparam()
// $db->close(); Not database connexion yet // $db->close(); Not database connexion yet
dolibarr_install_syslog("--- fileconf: end"); dolibarr_install_syslog("- fileconf: end");
pFooter($err,$setuplang,'jscheckparam'); pFooter($err,$setuplang,'jscheckparam');

View File

@ -149,7 +149,7 @@ if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
if (empty($conf->file->character_set_client)) $conf->file->character_set_client="UTF-8"; if (empty($conf->file->character_set_client)) $conf->file->character_set_client="utf-8";
if (empty($conf->db->character_set)) $conf->db->character_set='utf8'; if (empty($conf->db->character_set)) $conf->db->character_set='utf8';
if (empty($conf->db->dolibarr_main_db_collation)) $conf->db->dolibarr_main_db_collation='utf8_unicode_ci'; if (empty($conf->db->dolibarr_main_db_collation)) $conf->db->dolibarr_main_db_collation='utf8_unicode_ci';
if (empty($conf->db->dolibarr_main_db_encryption)) $conf->db->dolibarr_main_db_encryption=0; if (empty($conf->db->dolibarr_main_db_encryption)) $conf->db->dolibarr_main_db_encryption=0;

View File

@ -55,7 +55,7 @@ print '<br><br><div class="center">';
print '<table>'; print '<table>';
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("DefaultLanguage").' : </td><td align="left">'; print '<td>'.$langs->trans("DefaultLanguage").' : </td><td>';
print $formadmin->select_language('auto','selectlang',1,0,0,1); print $formadmin->select_language('auto','selectlang',1,0,0,1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -549,11 +549,11 @@ if ($ok && GETPOST('clean_menus','alpha'))
dol_print_error($db); dol_print_error($db);
} }
else else
print ' - <font class="warning">Cleaned</font>'; print ' - <span class="warning">Cleaned</span>';
} }
else else
{ {
print ' - <font class="warning">Canceled (test mode)</font>'; print ' - <span class="warning">Canceled (test mode)</span>';
} }
} }
else else
@ -982,11 +982,11 @@ if ($ok && GETPOST('force_disable_of_modules_not_found','alpha'))
dol_print_error($db); dol_print_error($db);
} }
else else
print ' - <font class="warning">Cleaned</font>'; print ' - <span class="warning">Cleaned</span>';
} }
else else
{ {
print ' - <font class="warning">Canceled (test mode)</font>'; print ' - <span class="warning">Canceled (test mode)</span>';
} }
} }
else else

View File

@ -46,7 +46,7 @@ $main_dir = GETPOST('main_dir')?GETPOST('main_dir'):(empty($argv[3])?'':$argv[3]
$main_data_dir = GETPOST('main_data_dir') ? GETPOST('main_data_dir') : (empty($argv[4])? ($main_dir . '/documents') :$argv[4]); $main_data_dir = GETPOST('main_data_dir') ? GETPOST('main_data_dir') : (empty($argv[4])? ($main_dir . '/documents') :$argv[4]);
// Dolibarr root URL // Dolibarr root URL
$main_url = GETPOST('main_url')?GETPOST('main_url'):(empty($argv[5])?'':$argv[5]); $main_url = GETPOST('main_url')?GETPOST('main_url'):(empty($argv[5])?'':$argv[5]);
// Database login informations // Database login information
$userroot=GETPOST('db_user_root','alpha')?GETPOST('db_user_root','alpha'):(empty($argv[6])?'':$argv[6]); $userroot=GETPOST('db_user_root','alpha')?GETPOST('db_user_root','alpha'):(empty($argv[6])?'':$argv[6]);
$passroot=GETPOST('db_pass_root','none')?GETPOST('db_pass_root','none'):(empty($argv[7])?'':$argv[7]); $passroot=GETPOST('db_pass_root','none')?GETPOST('db_pass_root','none'):(empty($argv[7])?'':$argv[7]);
// Database server // Database server
@ -68,18 +68,18 @@ $main_alt_dir_name = ((GETPOST("main_alt_dir_name",'alpha') && GETPOST("main_alt
session_start(); // To be able to keep info into session (used for not losing password during navigation. The password must not transit through parameters) session_start(); // To be able to keep info into session (used for not losing password during navigation. The password must not transit through parameters)
// Save a flag to tell to restore input value if we do back // Save a flag to tell to restore input value if we go back
$_SESSION['dol_save_pass']=$db_pass; $_SESSION['dol_save_pass']=$db_pass;
//$_SESSION['dol_save_passroot']=$passroot; //$_SESSION['dol_save_passroot']=$passroot;
// Now we load forced value from install.forced.php file. // Now we load forced values from install.forced.php file.
$useforcedwizard=false; $useforcedwizard=false;
$forcedfile="./install.forced.php"; $forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { if (@file_exists($forcedfile)) {
$useforcedwizard = true; $useforcedwizard = true;
include_once $forcedfile; include_once $forcedfile;
// If forced install is enabled, let's replace post values. These are empty because form fields are disabled. // If forced install is enabled, replace the post values. These are empty because form fields are disabled.
if ($force_install_noedit) { if ($force_install_noedit) {
$main_dir = detect_dolibarr_main_document_root(); $main_dir = detect_dolibarr_main_document_root();
if (!empty($force_install_main_data_root)) { if (!empty($force_install_main_data_root)) {
@ -204,7 +204,7 @@ if (! $error) {
$result=@include_once $main_dir."/core/db/".$db_type.'.class.php'; $result=@include_once $main_dir."/core/db/".$db_type.'.class.php';
if ($result) if ($result)
{ {
// If we ask database or user creation we need to connect as root, so we need root login // If we require database or user creation we need to connect as root, so we need root login credentials
if (!empty($db_create_database) && !$userroot) { if (!empty($db_create_database) && !$userroot) {
print '<div class="error">'.$langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$db_name).'</div>'; print '<div class="error">'.$langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$db_name).'</div>';
print '<br>'; print '<br>';
@ -397,7 +397,7 @@ if (! $error && $db->connected && $action == "set")
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir); print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir);
print ' '.$langs->trans("YouMustCreateItAndAllowServerToWrite"); print ' '.$langs->trans("YouMustCreateItAndAllowServerToWrite");
print '</td><td>'; print '</td><td>';
print '<font class="error">'.$langs->trans("Error").'</font>'; print '<span class="error">'.$langs->trans("Error").'</span>';
print "</td></tr>"; print "</td></tr>";
print '<tr><td colspan="2"><br>'.$langs->trans("CorrectProblemAndReloadPage",$_SERVER['PHP_SELF'].'?testget=ok').'</td></tr>'; print '<tr><td colspan="2"><br>'.$langs->trans("CorrectProblemAndReloadPage",$_SERVER['PHP_SELF'].'?testget=ok').'</td></tr>';
$error++; $error++;
@ -420,7 +420,7 @@ if (! $error && $db->connected && $action == "set")
} }
} }
// Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre telecharges en passant outre l'authentification // Documents are stored above the web pages root to prevent being downloaded without authentification
$dir=array(); $dir=array();
$dir[] = $main_data_dir."/mycompany"; $dir[] = $main_data_dir."/mycompany";
$dir[] = $main_data_dir."/medias"; $dir[] = $main_data_dir."/medias";
@ -431,7 +431,7 @@ if (! $error && $db->connected && $action == "set")
$dir[] = $main_data_dir."/produit"; $dir[] = $main_data_dir."/produit";
$dir[] = $main_data_dir."/doctemplates"; $dir[] = $main_data_dir."/doctemplates";
// Boucle sur chaque repertoire de dir[] pour les creer s'ils nexistent pas // Loop on each directory of dir [] to create them if they do not exist
$num=count($dir); $num=count($dir);
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
@ -469,7 +469,7 @@ if (! $error && $db->connected && $action == "set")
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir); print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir);
print ' '.$langs->trans("YouMustCreateItAndAllowServerToWrite"); print ' '.$langs->trans("YouMustCreateItAndAllowServerToWrite");
print '</td><td>'; print '</td><td>';
print '<font class="error">'.$langs->trans("Error").'</font>'; print '<span class="error">'.$langs->trans("Error").'</span>';
print "</td></tr>"; print "</td></tr>";
print '<tr><td colspan="2"><br>'.$langs->trans("CorrectProblemAndReloadPage",$_SERVER['PHP_SELF'].'?testget=ok').'</td></tr>'; print '<tr><td colspan="2"><br>'.$langs->trans("CorrectProblemAndReloadPage",$_SERVER['PHP_SELF'].'?testget=ok').'</td></tr>';
} }
@ -519,7 +519,7 @@ if (! $error && $db->connected && $action == "set")
// Save old conf file on disk // Save old conf file on disk
if (file_exists("$conffile")) if (file_exists("$conffile"))
{ {
// We must ignore errors as an existing old file may already exists and not be replacable or // We must ignore errors as an existing old file may already exist and not be replaceable or
// the installer (like for ubuntu) may not have permission to create another file than conf.php. // the installer (like for ubuntu) may not have permission to create another file than conf.php.
// Also no other process must be able to read file or we expose the new file, so content with password. // Also no other process must be able to read file or we expose the new file, so content with password.
@dol_copy($conffile, $conffile.'.old', '0400'); @dol_copy($conffile, $conffile.'.old', '0400');
@ -539,7 +539,7 @@ if (! $error && $db->connected && $action == "set")
print '</td>'; print '</td>';
print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>'; print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>';
// Si creation utilisateur admin demandee, on le cree // Create database user if requested
if (isset($db_create_user) && ($db_create_user == "1" || $db_create_user == "on")) { if (isset($db_create_user) && ($db_create_user == "1" || $db_create_user == "on")) {
dolibarr_install_syslog("step1: create database user: " . $dolibarr_main_db_user); dolibarr_install_syslog("step1: create database user: " . $dolibarr_main_db_user);
@ -558,7 +558,7 @@ if (! $error && $db->connected && $action == "set")
$databasefortest='master'; $databasefortest='master';
} }
// Creation handler de base, verification du support et connexion // Check database connection
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest,$conf->db->port); $db=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest,$conf->db->port);
@ -629,7 +629,7 @@ if (! $error && $db->connected && $action == "set")
print '<td><img src="../theme/eldy/img/error.png" alt="Error"></td>'; print '<td><img src="../theme/eldy/img/error.png" alt="Error"></td>';
print '</tr>'; print '</tr>';
// Affiche aide diagnostique // warning message due to connection failure
print '<tr><td colspan="2"><br>'; print '<tr><td colspan="2"><br>';
print $langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$dolibarr_main_db_user,$dolibarr_main_db_host,$userroot); print $langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$dolibarr_main_db_user,$dolibarr_main_db_host,$userroot);
print '<br>'; print '<br>';
@ -640,10 +640,10 @@ if (! $error && $db->connected && $action == "set")
$error++; $error++;
} }
} }
} // Fin si "creation utilisateur" } // end of user account creation
// If database creation is asked, we create it // If database creation was asked, we create it
if (!$error && (isset($db_create_database) && ($db_create_database == "1" || $db_create_database == "on"))) { if (!$error && (isset($db_create_database) && ($db_create_database == "1" || $db_create_database == "on"))) {
dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user); dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user);
$newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port); $newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);
@ -672,7 +672,7 @@ if (! $error && $db->connected && $action == "set")
} }
else else
{ {
// Affiche aide diagnostique // warning message
print '<tr><td colspan="2"><br>'; print '<tr><td colspan="2"><br>';
print $langs->trans("ErrorFailedToCreateDatabase",$dolibarr_main_db_name).'<br>'; print $langs->trans("ErrorFailedToCreateDatabase",$dolibarr_main_db_name).'<br>';
print $newdb->lasterror().'<br>'; print $newdb->lasterror().'<br>';
@ -693,7 +693,7 @@ if (! $error && $db->connected && $action == "set")
print '<td><img src="../theme/eldy/img/error.png" alt="Error"></td>'; print '<td><img src="../theme/eldy/img/error.png" alt="Error"></td>';
print '</tr>'; print '</tr>';
// Affiche aide diagnostique // warning message
print '<tr><td colspan="2"><br>'; print '<tr><td colspan="2"><br>';
print $langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$dolibarr_main_db_user,$dolibarr_main_db_host,$userroot); print $langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$dolibarr_main_db_user,$dolibarr_main_db_host,$userroot);
print '<br>'; print '<br>';
@ -703,7 +703,7 @@ if (! $error && $db->connected && $action == "set")
$error++; $error++;
} }
} // Fin si "creation database" } // end of create database
// We test access with dolibarr database user (not admin) // We test access with dolibarr database user (not admin)
@ -724,7 +724,7 @@ if (! $error && $db->connected && $action == "set")
print '<img src="../theme/eldy/img/tick.png" alt="Ok">'; print '<img src="../theme/eldy/img/tick.png" alt="Ok">';
print "</td></tr>"; print "</td></tr>";
// si acces serveur ok et acces base ok, tout est ok, on ne va pas plus loin, on a meme pas utilise le compte root. // server access ok, basic access ok
if ($db->database_selected) if ($db->database_selected)
{ {
dolibarr_install_syslog("step1: connection to database " . $conf->db->name . " by user " . $conf->db->user . " ok"); dolibarr_install_syslog("step1: connection to database " . $conf->db->name . " by user " . $conf->db->user . " ok");
@ -747,7 +747,7 @@ if (! $error && $db->connected && $action == "set")
print '<img src="../theme/eldy/img/error.png" alt="Error">'; print '<img src="../theme/eldy/img/error.png" alt="Error">';
print "</td></tr>"; print "</td></tr>";
// Affiche aide diagnostique // warning message
print '<tr><td colspan="2"><br>'; print '<tr><td colspan="2"><br>';
print $langs->trans('CheckThatDatabasenameIsCorrect',$dolibarr_main_db_name).'<br>'; print $langs->trans('CheckThatDatabasenameIsCorrect',$dolibarr_main_db_name).'<br>';
print $langs->trans('IfAlreadyExistsCheckOption').'<br>'; print $langs->trans('IfAlreadyExistsCheckOption').'<br>';
@ -767,7 +767,7 @@ if (! $error && $db->connected && $action == "set")
print '<img src="../theme/eldy/img/error.png" alt="Error">'; print '<img src="../theme/eldy/img/error.png" alt="Error">';
print "</td></tr>"; print "</td></tr>";
// Affiche aide diagnostique // warning message
print '<tr><td colspan="2"><br>'; print '<tr><td colspan="2"><br>';
print $langs->trans("ErrorConnection",$conf->db->host,$conf->db->name,$conf->db->user); print $langs->trans("ErrorConnection",$conf->db->host,$conf->db->name,$conf->db->user);
print $langs->trans('IfLoginDoesNotExistsCheckCreateUser').'<br>'; print $langs->trans('IfLoginDoesNotExistsCheckCreateUser').'<br>';
@ -1023,7 +1023,7 @@ function write_conf_file($conffile)
if (file_exists("$conffile")) if (file_exists("$conffile"))
{ {
include $conffile; // On force rechargement. Ne pas mettre include_once ! include $conffile; // force config reload, do not put include_once
conf($dolibarr_main_document_root); conf($dolibarr_main_document_root);
print "<tr><td>"; print "<tr><td>";

View File

@ -58,7 +58,7 @@ if ($dolibarr_main_db_type == "sqlite3") $choix=5;
//if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into step2.php page'); //if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into step2.php page');
// Now we load forced value from install.forced.php file. // Now we load forced values from install.forced.php file.
$useforcedwizard=false; $useforcedwizard=false;
$forcedfile="./install.forced.php"; $forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
@ -67,7 +67,7 @@ if (@file_exists($forcedfile)) {
include_once $forcedfile; include_once $forcedfile;
} }
dolibarr_install_syslog("--- step2: entering step2.php page"); dolibarr_install_syslog("- step2: entering step2.php page");
/* /*
@ -88,7 +88,7 @@ if ($action == "set")
{ {
print '<h3><img class="valigntextbottom" src="../theme/common/octicons/build/svg/database.svg" width="20" alt="Database"> '.$langs->trans("Database").'</h3>'; print '<h3><img class="valigntextbottom" src="../theme/common/octicons/build/svg/database.svg" width="20" alt="Database"> '.$langs->trans("Database").'</h3>';
print '<table cellspacing="0" style="padding: 4px 4px 4px 0px" border="0" width="100%">'; print '<table cellspacing="0" style="padding: 4px 4px 4px 0" border="0" width="100%">';
$error=0; $error=0;
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port); $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
@ -237,7 +237,7 @@ if ($action == "set")
print "<tr><td>".$langs->trans("CreateTableAndPrimaryKey",$name); print "<tr><td>".$langs->trans("CreateTableAndPrimaryKey",$name);
print "<br>\n".$langs->trans("Request").' '.$requestnb.' : '.$buffer.' <br>Executed query : '.$db->lastquery; print "<br>\n".$langs->trans("Request").' '.$requestnb.' : '.$buffer.' <br>Executed query : '.$db->lastquery;
print "\n</td>"; print "\n</td>";
print '<td><font class="error">'.$langs->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</font></td></tr>'; print '<td><span class="error">'.$langs->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</span></td></tr>';
$error++; $error++;
} }
} }
@ -246,7 +246,7 @@ if ($action == "set")
{ {
print "<tr><td>".$langs->trans("CreateTableAndPrimaryKey",$name); print "<tr><td>".$langs->trans("CreateTableAndPrimaryKey",$name);
print "</td>"; print "</td>";
print '<td><font class="error">'.$langs->trans("Error").' Failed to open file '.$dir.$file.'</td></tr>'; print '<td><span class="error">'.$langs->trans("Error").' Failed to open file '.$dir.$file.'</span></td></tr>';
$error++; $error++;
dolibarr_install_syslog("step2: failed to open file " . $dir . $file, LOG_ERR); dolibarr_install_syslog("step2: failed to open file " . $dir . $file, LOG_ERR);
} }
@ -384,7 +384,7 @@ if ($action == "set")
print "<tr><td>".$langs->trans("CreateOtherKeysForTable",$name); print "<tr><td>".$langs->trans("CreateOtherKeysForTable",$name);
print "<br>\n".$langs->trans("Request").' '.$requestnb.' : '.$db->lastqueryerror(); print "<br>\n".$langs->trans("Request").' '.$requestnb.' : '.$db->lastqueryerror();
print "\n</td>"; print "\n</td>";
print '<td><font class="error">'.$langs->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</font></td></tr>'; print '<td><span class="error">'.$langs->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</span></td></tr>';
$error++; $error++;
} }
} }
@ -395,7 +395,7 @@ if ($action == "set")
{ {
print "<tr><td>".$langs->trans("CreateOtherKeysForTable",$name); print "<tr><td>".$langs->trans("CreateOtherKeysForTable",$name);
print "</td>"; print "</td>";
print '<td><font class="error">'.$langs->trans("Error")." Failed to open file ".$dir.$file."</font></td></tr>"; print '<td><span class="error">'.$langs->trans("Error")." Failed to open file ".$dir.$file."</span></td></tr>";
$error++; $error++;
dolibarr_install_syslog("step2: failed to open file " . $dir . $file, LOG_ERR); dolibarr_install_syslog("step2: failed to open file " . $dir . $file, LOG_ERR);
} }
@ -417,7 +417,7 @@ if ($action == "set")
***************************************************************************************/ ***************************************************************************************/
if ($ok && $createfunctions) if ($ok && $createfunctions)
{ {
// For this file, we use directory according to database type // For this file, we use a directory according to database type
if ($choix==1) $dir = "mysql/functions/"; if ($choix==1) $dir = "mysql/functions/";
elseif ($choix==2) $dir = "pgsql/functions/"; elseif ($choix==2) $dir = "pgsql/functions/";
elseif ($choix==3) $dir = "mssql/functions/"; elseif ($choix==3) $dir = "mssql/functions/";
@ -473,7 +473,7 @@ if ($action == "set")
print "<tr><td>".$langs->trans("FunctionsCreation"); print "<tr><td>".$langs->trans("FunctionsCreation");
print "<br>\n".$langs->trans("Request").' '.$requestnb.' : '.$buffer; print "<br>\n".$langs->trans("Request").' '.$requestnb.' : '.$buffer;
print "\n</td>"; print "\n</td>";
print '<td><font class="error">'.$langs->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</font></td></tr>'; print '<td><span class="error">'.$langs->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</span></td></tr>';
$error++; $error++;
} }
} }
@ -594,7 +594,7 @@ if ($action == "set")
{ {
$ok = 0; $ok = 0;
$okallfile = 0; $okallfile = 0;
print '<font class="error">'.$langs->trans("ErrorSQL")." : ".$db->lasterrno()." - ".$db->lastqueryerror()." - ".$db->lasterror()."</font><br>"; print '<span class="error">'.$langs->trans("ErrorSQL")." : ".$db->lasterrno()." - ".$db->lastqueryerror()." - ".$db->lasterror()."</span><br>";
} }
} }
} }
@ -627,7 +627,7 @@ $ret=0;
if (!$ok && isset($argv[1])) $ret=1; if (!$ok && isset($argv[1])) $ret=1;
dolibarr_install_syslog("Exit ".$ret); dolibarr_install_syslog("Exit ".$ret);
dolibarr_install_syslog("--- step2: end"); dolibarr_install_syslog("- step2: end");
pFooter($ok?0:1,$setuplang); pFooter($ok?0:1,$setuplang);
@ -635,4 +635,3 @@ if (isset($db) && is_object($db)) $db->close();
// Return code if ran from command line // Return code if ran from command line
if ($ret) exit($ret); if ($ret) exit($ret);

View File

@ -47,7 +47,7 @@ if (@file_exists($forcedfile)) {
include_once $forcedfile; include_once $forcedfile;
} }
dolibarr_install_syslog("--- step4: entering step4.php page"); dolibarr_install_syslog("- step4: entering step4.php page");
$error=0; $error=0;
$ok = 0; $ok = 0;
@ -74,18 +74,18 @@ print '<h3><img class="valigntextbottom" src="../theme/common/octicons/build/svg
print $langs->trans("LastStepDesc").'<br><br>'; print $langs->trans("LastStepDesc").'<br><br>';
print '<table cellspacing="0" cellpadding="2" width="100%">'; print '<table cellspacing="0" cellpadding="2">';
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port); $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
if ($db->ok) if ($db->ok)
{ {
print '<tr><td>'.$langs->trans("Login").' :</td><td>'; print '<tr><td><label for="login">'.$langs->trans("Login").' :</label></td><td>';
print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? GETPOST("login") : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . (@$force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>'; print '<input id="login" name="login" type="text" value="' . (!empty($_GET["login"]) ? GETPOST("login") : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . (@$force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>';
print '<tr><td>'.$langs->trans("Password").' :</td><td>'; print '<tr><td><label for="pass">'.$langs->trans("Password").' :</label></td><td>';
print '<input type="password" name="pass"></td></tr>'; print '<input type="password" id="pass" name="pass"></td></tr>';
print '<tr><td>'.$langs->trans("PasswordAgain").' :</td><td>'; print '<tr><td><label for="pass_verif">'.$langs->trans("PasswordAgain").' :</label></td><td>';
print '<input type="password" name="pass_verif"></td></tr>'; print '<input type="password" id="pass_verif" name="pass_verif"></td></tr>';
print '</table>'; print '</table>';
if (isset($_GET["error"]) && $_GET["error"] == 1) if (isset($_GET["error"]) && $_GET["error"] == 1)
@ -113,12 +113,11 @@ if ($db->ok)
} }
$ret=0; $ret=0;
if ($error && isset($argv[1])) $ret=1; if ($error && isset($argv[1])) $ret=1;
dolibarr_install_syslog("Exit ".$ret); dolibarr_install_syslog("Exit ".$ret);
dolibarr_install_syslog("--- step4: end"); dolibarr_install_syslog("- step4: end");
pFooter($error,$setuplang); pFooter($error,$setuplang);

View File

@ -23,7 +23,7 @@
/** /**
* \file htdocs/install/step5.php * \file htdocs/install/step5.php
* \ingroup install * \ingroup install
* \brief Last page of upgrade or install process * \brief Last page of upgrade / install process
*/ */
include_once 'inc.php'; include_once 'inc.php';
@ -67,7 +67,7 @@ if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.fo
if (@file_exists($forcedfile)) { if (@file_exists($forcedfile)) {
$useforcedwizard = true; $useforcedwizard = true;
include_once $forcedfile; include_once $forcedfile;
// If forced install is enabled, let's replace post values. These are empty because form fields are disabled. // If forced install is enabled, replace post values. These are empty because form fields are disabled.
if ($force_install_noedit == 2) { if ($force_install_noedit == 2) {
if (!empty($force_install_dolibarrlogin)) { if (!empty($force_install_dolibarrlogin)) {
$login = $force_install_dolibarrlogin; $login = $force_install_dolibarrlogin;
@ -75,16 +75,15 @@ if (@file_exists($forcedfile)) {
} }
} }
dolibarr_install_syslog("--- step5: entering step5.php page"); dolibarr_install_syslog("- step5: entering step5.php page");
$error=0; $error=0;
/* /*
* Actions * Actions
*/ */
// If install, check pass and pass_verif used to create admin account // If install, check password and password_verification used to create admin account
if ($action == "set") { if ($action == "set") {
if ($pass <> $pass_verif) { if ($pass <> $pass_verif) {
header("Location: step4.php?error=1&selectlang=$setuplang" . (isset($login) ? '&login=' . $login : '')); header("Location: step4.php?error=1&selectlang=$setuplang" . (isset($login) ? '&login=' . $login : ''));
@ -394,8 +393,8 @@ if ($action == "set" && $success)
else else
{ {
// If here MAIN_VERSION_LAST_UPGRADE is not empty // If here MAIN_VERSION_LAST_UPGRADE is not empty
print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</font></b><br>'; print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b><br>'; print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b><br>';
print $langs->trans("MigrationNotFinished").'<br>'; print $langs->trans("MigrationNotFinished").'<br>';
print "<br>"; print "<br>";
@ -442,8 +441,8 @@ elseif (empty($action) || preg_match('/upgrade/i',$action))
else else
{ {
// If here MAIN_VERSION_LAST_UPGRADE is not empty // If here MAIN_VERSION_LAST_UPGRADE is not empty
print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</font></b><br>'; print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b>'; print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b>';
print "<br>"; print "<br>";
@ -457,17 +456,14 @@ else
dol_print_error('','step5.php: unknown choice of action'); dol_print_error('','step5.php: unknown choice of action');
} }
// Clear cache files // Clear cache files
clearstatcache(); clearstatcache();
$ret=0; $ret=0;
if ($error && isset($argv[1])) $ret=1; if ($error && isset($argv[1])) $ret=1;
dolibarr_install_syslog("Exit ".$ret); dolibarr_install_syslog("Exit ".$ret);
dolibarr_install_syslog("--- step5: Dolibarr setup finished"); dolibarr_install_syslog("- step5: Dolibarr setup finished");
pFooter(1,$setuplang); pFooter(1,$setuplang);

View File

@ -297,7 +297,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
{ {
if ($db->lasterrno() != 'DB_ERROR_NOSUCHTABLE') if ($db->lasterrno() != 'DB_ERROR_NOSUCHTABLE')
{ {
print '<tr><td colspan="2"><font class="error">'.$sql.' : '.$db->lasterror()."</font></td></tr>\n"; print '<tr><td colspan="2"><span class="error">'.$sql.' : '.$db->lasterror()."</font></td></tr>\n";
} }
} }
} }