11 require_once
"./Services/VirusScanner/classes/class.ilVirusScanner.php";
22 parent::__construct($a_scancommand, $a_cleancommand);
23 $this->type =
"sophos";
24 $this->scanZipFiles =
true;
34 public 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);
57 if (preg_match(
"/FILE INFECTED/", $this->scanResult)) {
58 $this->scanFileIsInfected =
true;
62 $this->scanFileIsInfected =
false;
68 $this->log->write(
"ERROR (Virus Scanner failed): " 70 .
"; COMMAMD=" . $cmd);
76 $cmd = $this->cleanCommand .
" -ss -archive " . $a_filepath .
" 2>&1";
78 $this->scanResult = implode(
"\n",
$out) .
" [" .
$ret .
"]";
86 $this->scanFileIsCleaned =
false;
88 } elseif (
$ret == 3) {
89 $this->scanFileIsInfected =
true;
93 $this->
ilias->raiseError(
94 $this->lng->txt(
"virus_scan_error") .
" " 95 . $this->lng->txt(
"virus_scan_message") .
" " 97 $this->
ilias->error_obj->WARNING
109 public function cleanFile($a_filepath, $a_origname =
"")
121 $this->cleanFilePath = $a_filepath;
122 $this->cleanFileOrigName = $a_origname;
131 $cmd = $this->cleanCommand .
" -di -nc -ss -eec -archive " . $a_filepath .
" 2>&1";
133 $this->cleanResult = implode(
"\n",
$out) .
" [" .
$ret .
"]";
150 $this->cleanFileIsCleaned =
true;
153 $this->cleanFileIsCleaned =
false;
cleanFile($a_filepath, $a_origname="")
clean an infected file
logScanResult()
write the result of the last scan to the log public
__construct($a_scancommand, $a_cleancommand)
Constructor public.
logCleanResult()
write the result of the last clean to the log public
redirection script todo: (a better solution should control the processing via a xml 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...
Interface to the sophos virus protector.