134 $this->scanCommand = $a_scancommand;
135 $this->cleanCommand = $a_cleancommand;
137 $this->type =
"simulate";
138 $this->scanZipFiles =
false;
157 $isInfected = $this->
scanFile($bufferFile);
169 file_put_contents($bufferFile, $buffer);
204 $this->scanFilePath = $a_filepath;
205 $this->scanFileOrigName = $a_origname;
207 if($a_origname ==
"infected.txt" or $a_origname ==
"cleanable.txt")
209 $this->scanFileIsInfected =
true;
211 "FILE INFECTED: [" . $a_filepath .
"] (VIRUS: simulated)";
217 $this->scanFileIsInfected =
false;
218 $this->scanResult =
"";
246 $this->cleanFilePath = $a_filepath;
247 $this->cleanFileOrigName = $a_origname;
249 if($a_origname ==
"cleanable.txt")
251 $this->cleanFileIsCleaned =
true;
253 "FILE CLEANED: [" . $a_filepath .
"] (VIRUS: simulated)";
259 $this->cleanFileIsCleaned =
false;
261 "FILE NOT CLEANED: [" . $a_filepath .
"] (VIRUS: simulated)";
282 $mess =
"Virus Scanner (" . $this->type .
")";
283 if($this->scanFileOrigName)
285 $mess .=
" (File " . $this->scanFileOrigName .
")";
287 $mess .=
": " . preg_replace(
'/[\r\n]+/',
"; ", $this->scanResult);
289 $this->log->write($mess);
298 $mess =
"Virus Cleaner (" . $this->type .
")";
299 if($this->cleanFileOrigName)
301 $mess .=
" (File " . $this->cleanFileOrigName .
")";
303 $mess .=
": " . preg_replace(
'/[\r\n]+/',
"; ", $this->cleanResult);
305 $this->log->write($mess);
335 if($this->scanFileIsInfected)
344 if($this->scanResult)
346 $ret .=
" " . $this->lng->txt(
"virus_scan_message")
348 . str_replace($this->scanFilePath, $this->scanFileOrigName,
349 nl2br($this->scanResult));
361 if($this->cleanFileIsCleaned)
370 if($this->cleanResult)
372 $ret .=
" " . $this->lng->txt(
"virus_clean_message")
374 . str_replace($this->cleanFilePath, $this->cleanFileOrigName,
375 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 needs to be redefined in child classes here it simulates a scan "infected...
logScanResult()
write the result of the last scan to the log public
logCleanResult()
write the result of the last clean to the log public
scanFileFromBuffer($buffer)
cleanFile($a_filepath, $a_origname="")
clean an infected file needs to be redefined in child classes here it simulates a clean "cleanable...
redirection script todo: (a better solution should control the processing via a xml file) ...
getScanMessage()
get a located message with the result from the last scan
Base class for the interface to an external virus scanner This class is abstract and needs to be exte...
getCleanResult()
get the pure output of the external scan
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
__construct($a_scancommand, $a_cleancommand)
Constructor public.
getCleanMessage()
get a located message with the result from the last clean
getScanResult()
get the pure output of the external scan