| '.$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
@@ -342,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..a7bce7a3025 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/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index bba6966fa45..cc10b054606 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2095,3 +2095,4 @@ SeeLinkToOnlineDocumentation=See link to online documention on top menu for exam
SHOW_SUBPRODUCT_REF_IN_PDF=If the feature "%s" of module %s is used, show details of subproducts of a kit on PDF.
AskThisIDToYourBank=Contact your bank to get this ID
AdvancedModeOnly=Permision available in Advanced permission mode only
+ConfFileIsReadableOrWritableByAnyUsers=The conf file is reabable or writable by any users. Give permission to web server user and group only.
| |