diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index 87522846cc8..b949790ab22 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -188,7 +188,7 @@ print "
";
print ''.$langs->trans("UseAvToScanUploadedFiles");
if($conf->global->MAIN_USE_AVSCAN == 1)
{
- print ' ';
+ print ' : ';
// Clamav
if (function_exists("cl_scanfile"))
{
diff --git a/htdocs/docsoc.php b/htdocs/docsoc.php
index 903cacefeeb..7225978356b 100644
--- a/htdocs/docsoc.php
+++ b/htdocs/docsoc.php
@@ -68,6 +68,7 @@ if ( $_POST["sendit"] && $conf->upload != 0)
}
else
{
+ // Fichier infecté par un virus
$mesg = ''.$langs->trans("ErrorFileIsInfectedWith",$result).' ';
}
}
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 43928d9e62e..36bdcf4cb94 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -35,6 +35,7 @@ MustBeLowerThanPHPLimit=Note: your PHP limits upload size to %s %s, whate
NoMaxSizeByPHPLimit=Note: No limit are built in your PHP
MaxSizeForUploadedFiles=Maximum size for uploaded files (0 to disallow any upload)
UseCaptchaCode=Use graphical code on logon page
+UseAvToScanUploadedFiles=Use anti-virus to scan uploaded files
ComptaSetup=Accounting module setup
UserSetup=Users' management setup
MenuSetup=Menus management setup
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index 6c51ca148fc..e18df43f4f2 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -81,6 +81,7 @@ SendNewPasswordDesc=This form allows you to request a new passord. It will be se
BackToLoginPage=Back to login page
AuthenticationDoesNotAllowSendNewPassword=Authentication mode is %s. In this mode, Dolibarr can't know nor change your password. Contact your system administrator if you want to change your password.
EnableGDLibraryDesc=Install or enable GD library with your PHP for use this option.
+EnablePhpAVModuleDesc=You need to install a module compatible with your anti-virus. (Clamav : php4-clamavlib ou php5-clamavlib)
##### Webcal #####
LoginWebcal=Login for Webcalendar
AddCalendarEntry=Add entry in calendar
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 0d7ce61cb85..4212d783403 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -35,6 +35,7 @@ MustBeLowerThanPHPLimit=Remarque: Votre PHP limite naturellement la taille
NoMaxSizeByPHPLimit=Aucune limite interne à votre serveur PHP
MaxSizeForUploadedFiles=Taille maximum des documents uploadés (0 pour interdire l'upload)
UseCaptchaCode=Utilisation du code graphique sur la page de login
+UseAvToScanUploadedFiles=Utilisation d'un anti-virus pour scanner les fichiers uploadés
ComptaSetup=Configuration du module Comptabilité
UserSetup=Configuration gestion des utilisateurs
MenuSetup=Administration des menus par base de données
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 6d5b852452b..cfd45c0ce62 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -81,6 +81,7 @@ SendNewPasswordDesc=Ce formulaire permet d'envoyer un nouveau mot de passe. Il s
BackToLoginPage=Retour page de connexion
AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "%s". Dans ce mode, Dolibarr n'a pas la possibilité de connaitre ni modifier votre mot de passe. Contacter votre administrateur pour connaitre les modalités de changement.
EnableGDLibraryDesc=Vous devez activer ou installer la librairie GD avec votre PHP pour pouvoir activer cette option.
+EnablePhpAVModuleDesc=Vous devez installer un module PHP compatible avec votre anti-virus. (Clamav : php4-clamavlib ou php5-clamavlib)
##### Webcal #####
LoginWebcal=Login Webcalendar
AddCalendarEntry=Ajouter entrée dans le calendrier
diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php
index 108624e8a22..776c5b120b3 100644
--- a/htdocs/lib/functions.inc.php
+++ b/htdocs/lib/functions.inc.php
@@ -2079,21 +2079,26 @@ function dol_delete_dir_recursive($dir,$count=0)
}
/**
- \brief Scan les fichiers avec Clamav
+ \brief Scan les fichiers avec un anti-virus
\param file Fichier a scanner
\return malware Nom du virus si infecté sinon retourne "null"
*/
function dol_avscan_file($file)
{
$malware = '';
- $maxreclevel = 5 ; // maximal recursion level
- $maxfiles = 1000; // maximal number of files to be scanned within archive
- $maxratio = 200; // maximal compression ratio
- $archivememlim = 0; // limit memory usage for bzip2 (0/1)
- $maxfilesize = 10485760; // archived files larger than this value (in bytes) will not be scanned
+
+ // Clamav
+ if (function_exists("cl_scanfile"))
+ {
+ $maxreclevel = 5 ; // maximal recursion level
+ $maxfiles = 1000; // maximal number of files to be scanned within archive
+ $maxratio = 200; // maximal compression ratio
+ $archivememlim = 0; // limit memory usage for bzip2 (0/1)
+ $maxfilesize = 10485760; // archived files larger than this value (in bytes) will not be scanned
- cl_setlimits($maxreclevel, $maxfiles, $maxratio, $archivememlim, $maxfilesize);
- $malware = cl_scanfile($file);
+ cl_setlimits($maxreclevel, $maxfiles, $maxratio, $archivememlim, $maxfilesize);
+ $malware = cl_scanfile($file);
+ }
return $malware;
}
|