Merge branch 'MDL-53366-master' of https://github.com/lucisgit/moodle

This commit is contained in:
Dan Poltawski 2016-10-25 19:05:00 +01:00
commit 607bdc3829
4 changed files with 7 additions and 5 deletions

View File

@ -34,5 +34,11 @@ function xmldb_antivirus_clamav_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2016101700) {
// Remove setting that has been deprecated long time ago at MDL-44260.
unset_config('quarantinedir', 'antivirus_clamav');
upgrade_plugin_savepoint(true, 2016101700, 'antivirus', 'clamav');
}
return true;
}

View File

@ -26,11 +26,9 @@ $string['configclamactlikevirus'] = 'Treat files like viruses';
$string['configclamdonothing'] = 'Treat files as OK';
$string['configclamfailureonupload'] = 'If you have configured clam to scan uploaded files, but it is configured incorrectly or fails to run for some unknown reason, how should it behave? If you choose \'Treat files like viruses\', they\'ll be moved into the quarantine area, or deleted. If you choose \'Treat files as OK\', the files will be moved to the destination directory like normal. Either way, admins will be alerted that clam has failed. If you choose \'Treat files like viruses\' and for some reason clam fails to run (usually because you have entered an invalid pathtoclam), ALL files that are uploaded will be moved to the given quarantine area, or deleted. Be careful with this setting.';
$string['configpathtoclam'] = 'Path to ClamAV. Probably something like /usr/bin/clamscan or /usr/bin/clamdscan. You need this in order for ClamAV to run.';
$string['configquarantinedir'] = 'If you want ClamAV to move infected files to a quarantine directory, enter it here. It must be writable by the webserver. If you leave this blank, or if you enter a directory that doesn\'t exist or isn\'t writable, infected files will be deleted. Do not include a trailing slash.';
$string['clamfailed'] = 'ClamAV has failed to run. The return error message was "{$a}". Here is the output from ClamAV:';
$string['clamfailureonupload'] = 'On ClamAV failure';
$string['invalidpathtoclam'] = 'Path to ClamAV, {$a}, is invalid.';
$string['pathtoclam'] = 'ClamAV path';
$string['pluginname'] = 'ClamAV antivirus';
$string['quarantinedir'] = 'Quarantine directory';
$string['unknownerror'] = 'There was an unknown error with ClamAV.';

View File

@ -27,8 +27,6 @@ defined('MOODLE_INTERNAL') || die();
if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configexecutable('antivirus_clamav/pathtoclam',
new lang_string('pathtoclam', 'antivirus_clamav'), new lang_string('configpathtoclam', 'antivirus_clamav'), ''));
$settings->add(new admin_setting_configdirectory('antivirus_clamav/quarantinedir',
new lang_string('quarantinedir', 'antivirus_clamav'), new lang_string('configquarantinedir', 'antivirus_clamav'), ''));
$options = array(
'donothing' => new lang_string('configclamdonothing', 'antivirus_clamav'),
'actlikevirus' => new lang_string('configclamactlikevirus', 'antivirus_clamav'),

View File

@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2016052300; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2016101700; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016051900; // Requires this Moodle version.
$plugin->component = 'antivirus_clamav'; // Full name of the plugin (used for diagnostics).