diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index 88ebf1d9456..9280a8391e9 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -182,19 +182,25 @@ foreach ($syslogModules as $moduleName)
{
$module = new $moduleName;
+ $moduleactive=$module->isActive();
+ if ($moduleactive == -1 && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
+
$var=!$var;
print '
';
- if ($module->configure())
+ $setuparray=$module->configure();
+ if ($setuparray)
{
- foreach ($module->configure() as $option)
+ foreach ($setuparray as $option)
{
if (defined($option['constant'])) $value = constant($option['constant']);
else $value = (isset($option['default']) ? $option['default'] : '');
-
+
print $option['name'].': ';
}
}
diff --git a/htdocs/core/modules/syslog/logHandler.php b/htdocs/core/modules/syslog/logHandler.php
index 8825e26bb68..cc9a209d106 100644
--- a/htdocs/core/modules/syslog/logHandler.php
+++ b/htdocs/core/modules/syslog/logHandler.php
@@ -2,6 +2,9 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandlerInterface.php';
+/**
+ * Parent class for log handlers
+ */
class LogHandler
{
const STABLE = 'stable';
@@ -10,6 +13,7 @@ class LogHandler
/**
* Content of the info tooltip.
+ *
* @return false|string
*/
public function getInfo()
@@ -19,6 +23,7 @@ class LogHandler
/**
* Version of the module
+ *
* @return string
*/
public function getVersion()
@@ -28,6 +33,7 @@ class LogHandler
/**
* ¿Is the module active?
+ *
* @return boolean
*/
public function isActive()
@@ -37,6 +43,7 @@ class LogHandler
/**
* Configuration variables of the module
+ *
* @return array
*/
public function configure()
@@ -48,6 +55,7 @@ class LogHandler
* Function that checks if the configuration is valid.
* It will be called after setting the configuration.
* The function returns an array with error messages
+ *
* @return array
*/
public function checkConfiguration()
diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php
index 49f6ed5299f..ff07301207c 100644
--- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php
+++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php
@@ -27,7 +27,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
{
global $langs;
- return $langs->trans('ChromePHPIncludePathWarning');
+ return $this->isActive()?'':$langs->trans('ClassNotFoundIntoPathWarning','ChromePhp.class.php');
}
/**
@@ -35,22 +35,24 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
*/
public function isActive()
{
+ global $conf;
try
{
- set_include_path(SYSLOG_CHROMEPHP_INCLUDEPATH);
+ if (empty($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH)) $conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH='/usr/share/php';
+ set_include_path($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH);
$res = @include_once 'ChromePhp.class.php';
restore_include_path();
if ($res)
{
- return true;
+ return 1;
}
}
catch(Exception $e)
{
- print ''."\n";
+ print ''."\n";
}
- return false;
+ return -1;
}
/**
@@ -59,7 +61,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
public function configure()
{
global $langs;
-
+
return array(
array(
'name' => $langs->trans('IncludePath'),
@@ -82,11 +84,11 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
$oldinclude = get_include_path();
set_include_path(SYSLOG_CHROMEPHP_INCLUDEPATH);
- if (!file_exists('ChromePhp.php'))
+ if (!file_exists('ChromePhp.class.php'))
{
- $errors[] = $langs->trans("ErrorFailedToOpenFile", 'ChromePhp.php');
+ $errors[] = $langs->trans("ErrorFailedToOpenFile", 'ChromePhp.class.php');
}
-
+
set_include_path($oldinclude);
return $errors;
@@ -106,7 +108,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
// database or config file because we must be able to log data before database or config file read.
$oldinclude=get_include_path();
set_include_path(SYSLOG_CHROMEPHP_INCLUDEPATH);
- include_once 'ChromePhp.php';
+ include_once 'ChromePhp.class.php';
set_include_path($oldinclude);
ob_start(); // To be sure headers are not flushed until all page is completely processed
if ($level == LOG_ERR) ChromePhp::error($message);
diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php
index 1d541dfb195..08bc9360c7e 100644
--- a/htdocs/core/modules/syslog/mod_syslog_file.php
+++ b/htdocs/core/modules/syslog/mod_syslog_file.php
@@ -37,7 +37,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
*/
public function isActive()
{
- return true;
+ return 1;
}
/**
@@ -46,7 +46,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
public function configure()
{
global $langs;
-
+
return array(
array(
'name' => $langs->trans('SyslogFilename'),
@@ -67,7 +67,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
$errors = array();
$filename = $this->getFilename();
-
+
if (file_exists($filename) && is_writable($filename))
{
dol_syslog('admin/syslog: file '.$filename);
@@ -112,7 +112,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
LOG_INFO => 'INFO',
LOG_DEBUG => 'DEBUG'
);
-
+
$message = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".sprintf("%-5s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".$content['message'];
fwrite($filefd, $message."\n");
diff --git a/htdocs/core/modules/syslog/mod_syslog_firephp.php b/htdocs/core/modules/syslog/mod_syslog_firephp.php
index ca6396db50d..48b0b2cffaa 100644
--- a/htdocs/core/modules/syslog/mod_syslog_firephp.php
+++ b/htdocs/core/modules/syslog/mod_syslog_firephp.php
@@ -27,7 +27,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
{
global $langs;
- return $langs->trans('FirePHPIncludePathWarning');
+ return $langs->trans('ClassNotFoundIntoPathWarning','FirePHPCore/FirePHP.class.php');
}
/**
@@ -42,7 +42,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
restore_include_path();
if ($res)
{
- return true;
+ return 1;
}
}
catch(Exception $e)
@@ -50,7 +50,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
print ''."\n";
}
- return false;
+ return -1;
}
// /**
@@ -59,7 +59,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
// public function configure()
// {
// global $langs;
-
+
// return array(
// array(
// 'name' => $langs->trans('IncludePath'),
@@ -86,7 +86,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
{
$errors[] = $langs->trans("ErrorFailedToOpenFile", 'FirePhp.php');
}
-
+
set_include_path($oldinclude);
return $errors;
diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php
index d2befc42844..bd93d4f36ba 100644
--- a/htdocs/core/modules/syslog/mod_syslog_syslog.php
+++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php
@@ -38,10 +38,10 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
// This function does not exists on some ISP (Ex: Free in France)
if (!function_exists('openlog'))
{
- return false;
+ return 0;
}
-
- return true;
+
+ return 1;
}
/**
@@ -66,7 +66,7 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
public function checkConfiguration()
{
global $langs;
-
+
$errors = array();
$facility = SYSLOG_FACILITY;
@@ -81,10 +81,10 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
{
$errors[] = $langs->trans("ErrorUnknownSyslogConstant", $facility);
}
-
+
return $errors;
}
-
+
/**
* Export the message
* @param array $content Array containing the info about the message
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index fb02f0a2e0e..bab83dda585 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -911,6 +911,7 @@ TranslationSetup=Configuration de la traduction
TranslationDesc=Choice of language visible on screen can be modified: * Globally from menu Home - Setup - Display * For user only from tab User display of user card (click on login on top of screen).
TotalNumberOfActivatedModules=Total number of activated feature modules: %s
YouMustEnableOneModule=You must at least enable 1 module
+ClassNotFoundIntoPathWarning=Class %s not found into PHP path
##### Module password generation
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 98f2a9df43d..7fdf4f44945 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -918,6 +918,8 @@ PathDirectory= Répertoire
SendmailOptionMayHurtBuggedMTA=La fonction d'envoi de mails par la méthode "PHP mail directe" génère une requete mail qui peut être mal interprété par certains serveurs buggués de réception de mail. Cela se traduit par des mails non lisibles chez les personnes hebergés par ces plateformes bugguées. C'est le cas des clients de certains fournisseurs d'accès internet (Ex: Orange). Ce n'est pas un problème ni dans Dolibarr ni dans PHP mais sur le serveur de réception. Vous pouvez toutefois ajouter l'option MAIN_FIX_FOR_BUGGED_MTA à 1 dans configuration - divers pour modifier Dolibarr afin de compenser le bug. Toutefois ce sont les serveurs respectueux du standard d'envoi de mail qui pourront avoir des problèmes. L'autre solution (recommandée) est d'utiliser la méthode d'envoi SMTP socket library qui n'a aucun de ces inconvénients.
TranslationSetup=Translation setup
TranslationDesc=Le choix de la langue affichée à l'écran se modifie: * Soit de manière globale depuis le menu Accueil - Configuration - Affichage * Soit de manière spécifique à l'utilisateur depuis l'onglet Interface utilisateur de sa fiche utilisateur (cliquer sur le login en haut de l'écran).
+ClassNotFoundIntoPathWarning=La class %s n'a pas été trouvée dans le path PHP
+
##### Module password generation= undefined
PasswordGenerationStandard= Renvoie un mot de passe généré selon algorithme interne Dolibarr: 8 caractères, chiffres et caractères en minuscules mélangés.
PasswordGenerationNone= Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement.