11require_once
"./Services/VirusScanner/classes/class.ilVirusScanner.php";
22 parent::__construct($a_scancommand, $a_cleancommand);
23 $this->type =
"sophos";
24 $this->scanZipFiles =
true;
34 function scanFile($a_filepath, $a_origname =
"")
46 $this->scanFilePath = $a_filepath;
47 $this->scanFileOrigName = $a_origname;
51 $cmd = $this->scanCommand .
" " . $a_filepath .
" 2>&1";
53 $this->scanResult = implode(
"\n",
$out);
58 if(preg_match(
"/FILE INFECTED/", $this->scanResult))
60 $this->scanFileIsInfected =
true;
66 $this->scanFileIsInfected =
false;
72 $this->log->write(
"ERROR (Virus Scanner failed): "
74 .
"; COMMAMD=" .
$cmd);
80 $cmd = $this->cleanCommand .
" -ss -archive " . $a_filepath .
" 2>&1";
82 $this->scanResult = implode(
"\n",
$out) .
" [" .
$ret .
"]";
91 $this->scanFileIsCleaned =
false;
96 $this->scanFileIsInfected =
true;
102 $this->
ilias->raiseError($this->lng->txt(
"virus_scan_error") .
" "
103 . $this->lng->txt(
"virus_scan_message") .
" "
105 $this->ilias->error_obj->WARNING);
128 $this->cleanFilePath = $a_filepath;
129 $this->cleanFileOrigName = $a_origname;
138 $cmd = $this->cleanCommand .
" -di -nc -ss -eec -archive " . $a_filepath .
" 2>&1";
140 $this->cleanResult = implode(
"\n",
$out) .
" [" .
$ret .
"]";
158 $this->cleanFileIsCleaned =
true;
163 $this->cleanFileIsCleaned =
false;
An exception for terminatinating execution or to throw for unit testing.
Interface to the sophos virus protector.
__construct($a_scancommand, $a_cleancommand)
Constructor @access public.
cleanFile($a_filepath, $a_origname="")
clean an infected file
scanFile($a_filepath, $a_origname="")
scan a file for viruses
Base class for the interface to an external virus scanner This class is abstract and needs to be exte...
logScanResult()
write the result of the last scan to the log @access public
logCleanResult()
write the result of the last clean to the log @access public
redirection script todo: (a better solution should control the processing via a xml file)