-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing Antivirus from config.xml #247
- Loading branch information
1 parent
e2921d6
commit 0d2fed6
Showing
7 changed files
with
63 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
parameters: | ||
universibo: | ||
antivirus: | ||
enabled: false | ||
type: clamav | ||
cmd: /usr/bin/clamscan | ||
opts: '--quiet --recursive' | ||
antivirus_enabled: false | ||
antivirus_cmd: /usr/bin/clamscan | ||
antivirus_opts: '--quiet --recursive' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,11 +294,5 @@ | |
<regolamento>../universibo/files/regolamento.txt</regolamento> | ||
<staffEmail>[email protected]</staffEmail> | ||
<defaultAnnoAccademico>2011</defaultAnnoAccademico> | ||
|
||
<!--<antiVirusEnable>true</antiVirusEnable> --> | ||
<antiVirusEnable>false</antiVirusEnable> | ||
<antiVirusType>clamav</antiVirusType> | ||
<antiVirusClamavCmd>/usr/local/bin/clamscan</antiVirusClamavCmd> | ||
<antiVirusClamavOpts>--quiet --recursive</antiVirusClamavOpts> | ||
</appSettings> | ||
</config> |
29 changes: 0 additions & 29 deletions
29
src/Universibo/Bundle/LegacyBundle/App/AntiVirus/AntiVirusFactory.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,42 +4,59 @@ | |
/** | ||
* Classe antivirus per clamav | ||
* | ||
* @package universibo | ||
* @author Ilias Bartolini <[email protected]> | ||
* @author Davide Bellettini <[email protected]> | ||
* @license GPL, http://www.opensource.org/licenses/gpl-license.php | ||
* @copyright CopyLeft UniversiBO 2001-2005 | ||
* @copyright CopyLeft UniversiBO 2001-2013 | ||
*/ | ||
|
||
class Clamav | ||
{ | ||
|
||
/** | ||
* Command line options | ||
* | ||
* @var type | ||
*/ | ||
private $opts = ''; | ||
|
||
/** | ||
* Clamav command | ||
* | ||
* @var string | ||
*/ | ||
private $cmd = ''; | ||
|
||
public function __construct($cmd, $opts) | ||
/** | ||
* class constructor | ||
* | ||
* @param string $cmd | ||
* @param string $opts | ||
* @param boolean $enabled | ||
*/ | ||
public function __construct($cmd, $opts, $enabled) | ||
{ | ||
$this->cmd = $cmd; | ||
$this->opts = $opts; | ||
$this->cmd = $cmd; | ||
$this->opts = $opts; | ||
$this->enabled = $enabled; | ||
} | ||
|
||
/** | ||
* @return true se ci sono virus, false se _non_ ci sono virus | ||
*/ | ||
public function checkFile($filename) | ||
{ | ||
if(!$this->enabled) { | ||
return false; | ||
} | ||
|
||
$filename = escapeshellarg($filename); | ||
|
||
$fullCommand = $this->cmd.' '.$this->opts.' '.$filename; | ||
|
||
$output = array(); | ||
unset($output); | ||
$returnval = null; | ||
|
||
exec ( $fullCommand, $output, $returnval ); | ||
|
||
if ($returnval == 1) return true; | ||
if ($returnval == 0) return false; | ||
|
||
|
||
return $returnval != 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters