138 $this->scanCommand = $a_scancommand;
139 $this->cleanCommand = $a_cleancommand;
141 $this->type =
"simulate";
142 $this->scanZipFiles =
false;
161 $isInfected = $this->
scanFile($bufferFile);
173 file_put_contents($bufferFile, $buffer);
210 $this->scanFilePath = $a_filepath;
211 $this->scanFileOrigName = $a_origname;
213 if ($a_origname ==
"infected.txt" or $a_origname ==
"cleanable.txt")
215 $this->scanFileIsInfected =
true;
217 "FILE INFECTED: [". $a_filepath.
"] (VIRUS: simulated)";
223 $this->scanFileIsInfected =
false;
224 $this->scanResult =
"";
255 $this->cleanFilePath = $a_filepath;
256 $this->cleanFileOrigName = $a_origname;
258 if ($a_origname ==
"cleanable.txt")
260 $this->cleanFileIsCleaned =
true;
262 "FILE CLEANED: [". $a_filepath.
"] (VIRUS: simulated)";
268 $this->cleanFileIsCleaned =
false;
270 "FILE NOT CLEANED: [". $a_filepath.
"] (VIRUS: simulated)";
293 $mess =
"Virus Scanner (". $this->type.
")";
294 if ($this->scanFileOrigName)
296 $mess .=
" (File " . $this->scanFileOrigName .
")";
298 $mess .=
": " . ereg_replace(
"(\r|\n)+",
"; ", $this->scanResult);
300 $this->log->write($mess);
310 $mess =
"Virus Cleaner (". $this->type.
")";
311 if ($this->cleanFileOrigName)
313 $mess .=
" (File ". $this->cleanFileOrigName.
")";
315 $mess .=
": " . ereg_replace(
"(\r|\n)+",
"; ", $this->cleanResult);
317 $this->log->write($mess);
350 if ($this->scanFileIsInfected)
359 if ($this->scanResult)
361 $ret .=
" ". $this->lng->txt(
"virus_scan_message")
363 . str_replace($this->scanFilePath, $this->scanFileOrigName,
364 nl2br($this->scanResult));
377 if ($this->cleanFileIsCleaned)
386 if ($this->cleanResult)
388 $ret .=
" ". $this->lng->txt(
"virus_clean_message")
390 . str_replace($this->cleanFilePath, $this->cleanFileOrigName,
391 nl2br($this->cleanResult));
fileCleaned()
returns wether file has been cleaned successfully or not
createBufferFile($buffer)
getScanZipFiles()
get info if class can scan ZIP files
removeBufferFile($bufferFile)
scanFile($a_filepath, $a_origname="")
scan a file for viruses
logScanResult()
write the result of the last scan to the log
logCleanResult()
write the result of the last clean to the log
scanFileFromBuffer($buffer)
cleanFile($a_filepath, $a_origname="")
clean an infected file
redirection script todo: (a better solution should control the processing via a xml file) ...
ilVirusScanner($a_scancommand, $a_cleancommand)
Constructor public.
getScanMessage()
get a located message with the result from the last scan
Base class for the interface to an external virus scanner.
getCleanResult()
get the pure output of the external scan
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
getCleanMessage()
get a located message with the result from the last clean
getScanResult()
get the pure output of the external scan