| '.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").') | '.DOL_VERSION;
// If current version differs from last upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
@@ -139,7 +139,7 @@ print ' ';
// Session
print '';
print ' ';
-print '| '.$langs->trans("Session").' | '.$langs->trans("Value").' | '."\n";
+print '| '.$langs->trans("Session").' | '.$langs->trans("Value").' | '."\n";
print '| '.$langs->trans("SessionSavePath").' | '.session_save_path().' | '."\n";
print '| '.$langs->trans("SessionName").' | '.session_name().' | '."\n";
print '| '.$langs->trans("SessionId").' | '.session_id().' | '."\n";
@@ -180,7 +180,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
print '';
print ' ';
print '';
- print '| '.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").' | ';
+ print ''.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").' | ';
print ''.$langs->trans("NbOfEntries").' | ';
print ''.$langs->trans("Address").' | ';
print ' '."\n";
@@ -202,7 +202,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
// Localisation
print '';
print ' ';
-print '| '.$langs->trans("LocalisationDolibarrParameters").' | '.$langs->trans("Value").' | '."\n";
+print '| '.$langs->trans("LocalisationDolibarrParameters").' | '.$langs->trans("Value").' | '."\n";
print '| '.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").' | '.$_SERVER["HTTP_ACCEPT_LANGUAGE"].' | '."\n";
print '| '.$langs->trans("CurrentUserLanguage").' | '.$langs->getDefaultLang().' | '."\n";
// Thousands
@@ -222,7 +222,22 @@ if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
print "\n";
}
print '| => price(1234.56) | '.price(1234.56).' | '."\n";
-// Timezone
+
+// Timezones
+
+// Database timezone
+if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
+{
+ print '| '.$langs->trans("MySQLTimeZone").' (database) | '; // Timezone server base
+ $sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ $obj = $db->fetch_object($resql);
+ print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
+ }
+ print ' | '."\n";
+}
$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).' '."\n";
$txt .= $langs->trans("PHPTZ").' (date_default_timezone_get() / php.ini date.timezone): '.(getServerTimeZoneString()." / ".(ini_get("date.timezone") ? ini_get("date.timezone") : $langs->trans("NotDefined")))." \n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ) ? $langs->trans("NotDefined") : $conf->global->MAIN_SERVER_TZ);
@@ -238,23 +253,10 @@ $val .= ' '.getServerTimeZoneString();
$val .= ' '.$langs->trans("DaylingSavingTime").': '.($daylight === 'unknown' ? 'unknown' : ($a == $c ?yn($daylight) : yn(0).($daylight ? ' ('.$langs->trans('YesInSummer').')' : '')));
print $form->textwithtooltip($val, $txt, 2, 1, img_info(''));
print ''."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
-print '| => '.$langs->trans("CurrentHour").' | '.dol_print_date(dol_now(), 'dayhour', 'tzserver').' | '."\n";
+print '| => '.$langs->trans("CurrentHour").' | '.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver').' | '."\n";
print '| => dol_print_date(0,"dayhourtext") | '.dol_print_date(0, "dayhourtext").' | ';
print ' | => dol_get_first_day(1970,1,false) | '.dol_get_first_day(1970, 1, false).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, false), 'dayhour').') | ';
print ' | => dol_get_first_day(1970,1,true) | '.dol_get_first_day(1970, 1, true).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, true), 'dayhour').') | ';
-// Database timezone
-if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
-{
- print ' | '.$langs->trans("MySQLTimeZone").' (database) | '; // Timezone server base
- $sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
- $resql = $db->query($sql);
- if ($resql)
- {
- $obj = $db->fetch_object($resql);
- print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
- }
- print ' | '."\n";
-}
// Client
$tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
print '| '.$langs->trans("ClientTZ").' | '.($tz ? ($tz >= 0 ? '+' : '').$tz : '').' ('.($tz >= 0 ? '+' : '').($tz * 60 * 60).')';
@@ -265,7 +267,7 @@ else print yn(0);
if (!empty($_SESSION['dol_dst_first'])) print ' ('.dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']), 'dayhour', 'gmt').' - '.dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']), 'dayhour', 'gmt').')';
print ' | '."\n";
print ''."\n";
-print '| => '.$langs->trans("ClientHour").' | '.dol_print_date(dol_now(), 'dayhour', 'tzuser').' | '."\n";
+print '| => '.$langs->trans("ClientHour").' | '.dol_print_date(dol_now('gmt'), 'dayhour', 'tzuser').' | '."\n";
$filesystemencoding = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
print '| '.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding) | '.$filesystemencoding.' | '."\n";
@@ -340,7 +342,7 @@ $configfileparameters = array(
print '';
print ' ';
print '';
-print '| '.$langs->trans("Parameters").' ';
+print ' | '.$langs->trans("Parameters").' ';
print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
print ' | ';
print ''.$langs->trans("Parameter").' | ';
diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php
index cf38687f66f..b6160d2d2e9 100644
--- a/htdocs/admin/system/phpinfo.php
+++ b/htdocs/admin/system/phpinfo.php
@@ -69,13 +69,13 @@ if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2)
print '';
-print '| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' | ';
+print '| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' | ';
$ErrorPicturePath = "../../theme/eldy/img/error.png";
$WarningPicturePath = "../../theme/eldy/img/warning.png";
$OkayPicturePath = "../../theme/eldy/img/tick.png";
-print '| '.$langs->trans("Version").' | ';
+print ' | | '.$langs->trans("Version").' | ';
$arrayphpminversionerror = array(5, 5, 0);
$arrayphpminversionwarning = array(5, 6, 0);
@@ -129,11 +129,8 @@ $loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
print '';
print '';
-print '| '.$langs->trans("Extension").' | ';
-//print ''.$langs->trans("EnabledInSetup").' | ';
-print ''.$langs->trans("Loaded").' | ';
-print ''.$langs->trans("FunctionTest").' | ';
-print ''.$langs->trans("Result").' | ';
+print ''.$langs->trans("Extension").' | ';
+print ''.$langs->trans("Test").' | ';
print ' ';
$functions = ["mb_check_encoding"];
@@ -141,9 +138,6 @@ $name = "MBString";
print "";
print "| ".$name." | ";
-//print getTableColumn($name, $activatedExtensions);
-print getTableColumn($name, $loadedExtensions);
-print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print " ";
@@ -152,9 +146,6 @@ $name = "JSON";
print "";
print "| ".$name." | ";
-//print getTableColumn($name, $activatedExtensions);
-print getTableColumn($name, $loadedExtensions);
-print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print " ";
@@ -163,8 +154,6 @@ $name = "GD";
print "";
print "| ".$name." | ";
-print getTableColumn($name, $loadedExtensions);
-print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print " ";
@@ -173,8 +162,6 @@ $name = "Curl";
print "";
print "| ".$name." | ";
-print getTableColumn($name, $loadedExtensions);
-print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print " ";
@@ -185,8 +172,6 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
print "";
print "| ".$name." | ";
- print getTableColumn($name, $loadedExtensions);
- print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print " ";
}
@@ -196,8 +181,6 @@ $name = "IMAP";
print "";
print "| ".$name." | ";
-print getTableColumn($name, $loadedExtensions);
-print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print " ";
@@ -206,8 +189,6 @@ $name = "xDebug";
print "";
print "| ".$name." | ";
-print getTableColumn($name, $loadedExtensions);
-print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print " ";
@@ -222,7 +203,7 @@ foreach ($phparray as $key => $value)
print '';
print ' ';
print '';
- print '| '.$key.' | ';
+ print ''.$key.' | ';
print ''.$langs->trans("Value").' | ';
print " \n";
@@ -269,69 +250,6 @@ llxFooter();
$db->close();
-/**
- * Return a table column with a indicator (okay or warning), based on the given name and list
- *
- * @param string $name The name to check inside the given list
- * @param array $list A list that should contains the given name
- *
- * @return string
- */
-function getTableColumn($name, array $list)
-{
- global $langs;
-
- $name = strtolower($name);
- $html = "";
-
- if (in_array($name, $list))
- {
- if ($name == 'xdebug') $html .= ' ';
- else $html .= ' ';
- } else {
- if ($name == 'xdebug') $html .= yn(0);
- else $html .= ' ';
- }
-
- $html .= " | ";
-
- return $html;
-}
-
-/**
- * Return a table column with a indicator (okay or warning), based on the given functions to check
- *
- * @param array $functions A list with functions to check
- *
- * @return string
- */
-function getTableColumnFunction(array $functions)
-{
- if (count($functions) < 1)
- {
- return "- | ";
- }
-
- $result = true;
- $html = "";
-
- foreach ($functions as $function)
- {
- $result = $result && function_exists($function);
- }
-
- if ($result)
- {
- $html .= ' ';
- } else {
- $html .= ' ';
- }
-
- $html .= " | ";
-
- return $html;
-}
-
/**
* Return a result column with a translated result text
*
@@ -339,7 +257,6 @@ function getTableColumnFunction(array $functions)
* @param array $activated A list with all activated PHP extensions. Deprecated.
* @param array $loaded A list with all loaded PHP extensions
* @param array $functions A list with all PHP functions to check
- *
* @return string
*/
function getResultColumn($name, array $activated, array $loaded, array $functions)
@@ -347,6 +264,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function
global $langs;
$result = true;
+
//$result = $result && in_array(strtolower($name), $activated);
$result = $result && in_array(strtolower($name), $loaded);
@@ -356,7 +274,29 @@ function getResultColumn($name, array $activated, array $loaded, array $function
}
$html = "";
- $html .= $result ? $langs->trans("PHPSupport", $name) : $langs->trans("ErrorPHPDoesNotSupport", $name);
+ if ($result) {
+ if (strtolower($name) == 'xdebug') $html .= img_warning($langs->trans("ModuleActivated", "xdebug"));
+ else $html .= img_picto($langs->trans("Ok"), 'tick');
+ if (in_array(strtolower($name), $loaded)) {
+ $html .= ' '.$langs->trans("Loaded").' - ';
+ } else {
+ //$html .= ' '.$langs->trans("NotLoaded").' - ';
+ }
+ if (strtolower($name) == 'xdebug') {
+ $html .= ' '.$langs->trans("ModuleActivated", "xdebug");
+ } else {
+ $html .= ' '.$langs->trans("PHPSupport", $name);
+ }
+ } else {
+ if (strtolower($name) == 'xdebug') $html .= yn(0).' - ';
+ else $html .= img_warning($langs->trans("ModuleActivated", "xdebug"));
+ if (in_array(strtolower($name), $loaded)) {
+ $html .= ' '.$langs->trans("Loaded").' - ';
+ } else {
+ //$html .= ' '.$langs->trans("NotLoaded").' - ';
+ }
+ $html .= ' '.$langs->trans("ErrorPHPDoesNotSupport", $name);
+ }
$html .= " | ";
return $html;
diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php
index f978c0dcd81..f0ada86a393 100644
--- a/htdocs/admin/system/security.php
+++ b/htdocs/admin/system/security.php
@@ -43,9 +43,6 @@ if (GETPOST('action', 'aZ09') == 'donothing')
* View
*/
-$form = new Form($db);
-$nowstring = dol_print_date(dol_now(), 'dayhourlog');
-
llxHeader();
print load_fiche_titre($langs->trans("Security"), '', 'title_setup');
@@ -78,7 +75,7 @@ else {
print ' ';
print ' ';
-print load_fiche_titre($langs->trans("ConfigFile"), '', 'folder');
+print load_fiche_titre($langs->trans("ConfigurationFile"), '', 'folder');
print ''.$langs->trans("dolibarr_main_prod").': '.$dolibarr_main_prod;
if (empty($dolibarr_main_prod)) {
@@ -90,7 +87,12 @@ print ''.$langs->trans("dolibarr_nocsrfcheck").': '.$dolibarr_n
if (!empty($dolibarr_nocsrfcheck)) {
print img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
}
+print ' ';
+print ''.$langs->trans("dolibarr_main_restrict_ip").': '.$dolibarr_main_restrict_ip;
+/*if (empty($dolibarr_main_restrict_ip)) {
+ print ' '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1);
+}*/
print ' ';
print ' ';
@@ -102,9 +104,17 @@ print ''.$langs->trans("PermissionsOnFilesInWebRoot").': ';
print 'TODO';
print ' ';
-print ''.$langs->trans("PermissionsOnFile", 'conf.php').': ';
-// TODO Check permission on file conf.php (read only for the web user)
-print 'TODO';
+print ''.$langs->trans("PermissionsOnFile", $conffile).': '; // $conffile is defined into filefunc.inc.php
+$perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
+if ($perms) {
+ if (($perms & 0x0004) || ($perms & 0x0002)) {
+ print img_warning().' '.$langs->trans("ConfFileIsReadableOrWritableByAnyUsers");
+ } else {
+ print img_picto('', 'tick');
+ }
+} else {
+ print img_warning().' '.$langs->trans("FailedToReadFile", $conffile);
+}
print ' ';
print ' ';
@@ -137,14 +147,15 @@ print ' ';
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
//print ''.$langs->trans("PasswordEncryption").': ';
-print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? 'unset' : '')." ";
+print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? $langs->trans("Undefined") : '')." ";
print ' If unset: \'md5\' ';
print ' - Recommanded value: \'password_hash\' ';
-print 'MAIN_SECURITY_SALT = '.$conf->global->MAIN_SECURITY_SALT.' ';
+print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : '').' ';
print ' ';
// TODO
print ''.$langs->trans("AntivirusEnabledOnUpload").': ';
+print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0);
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
print ' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php
index 8a513034a4a..2a3a13cca69 100644
--- a/htdocs/barcode/printsheet.php
+++ b/htdocs/barcode/printsheet.php
@@ -22,6 +22,11 @@
* \ingroup member
* \brief Page to print sheets with barcodes using the document templates into core/modules/printsheets
*/
+
+if (!empty($_POST['mode']) && $_POST['mode'] === 'label') { // Page is called to build a PDF and output, we must ne renew the token.
+ if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
+}
+
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -237,16 +242,22 @@ if ($action == 'builddoc')
$outfile = $langs->trans("BarCode").'_sheets_'.dol_print_date(dol_now(), 'dayhourlog').'.pdf';
- if (!$mesg) $result = doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, dol_sanitizeFileName($outfile));
+ if (!$mesg) {
+ $outputlangs = $langs;
+
+ // This generates and send PDF to output
+ // TODO Move
+ $result = doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, dol_sanitizeFileName($outfile));
+ }
}
- if ($result <= 0)
- {
- dol_print_error('', $result);
- }
+ if ($result <= 0 || $mesg) {
+ if (empty($mesg)) {
+ $mesg = 'Error '.$result;
+ }
- if (!$mesg)
- {
+ setEventMessages($mesg, null, 'errors');
+ } else {
$db->close();
exit;
}
@@ -275,10 +286,10 @@ dol_htmloutput_errors($mesg);
//print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").' ';
//print ' ';
-print ' | |