Skip to content
Snippets Groups Projects
Commit 55fd180c authored by Regis Houssin's avatar Regis Houssin
Browse files

Test d'utilisation de php5-clamavlib

parent b1192946
No related branches found
No related tags found
No related merge requests found
......@@ -188,7 +188,7 @@ print "<tr ".$bc[$var].">";
print '<td colspan="3">'.$langs->trans("UseAvToScanUploadedFiles");
if($conf->global->MAIN_USE_AVSCAN == 1)
{
print '<br>';
print ' : ';
// Clamav
if (function_exists("cl_scanfile"))
{
......
......@@ -68,6 +68,7 @@ if ( $_POST["sendit"] && $conf->upload != 0)
}
else
{
// Fichier infect par un virus
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>';
}
}
......
......@@ -35,6 +35,7 @@ MustBeLowerThanPHPLimit=Note: your PHP limits upload size to <b>%s</b> %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
......
......@@ -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 <b>%s</b>.<br>In this mode, Dolibarr can't know nor change your password.<br>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
......
......@@ -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
......
......@@ -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é à "<b>%s</b>".<br>Dans ce mode, Dolibarr n'a pas la possibilité de connaitre ni modifier votre mot de passe.<br>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
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment