79 Commits

Author SHA1 Message Date
Helen Foster
970c1a4bf1 MDL-62181 lang: Merge English strings from the en_fix language pack
Significant string changes:

* sitepolicies, core_admin - 'Site policies' changed to 'Site security
  settings'
* processexpirationstask, enrol_paypal - more explanatory name
* sitepolicy_help and sitepolicyguest_help, core_admin - setting will
  only have an effect if the site policy handler is set to default
* sitepolicyhandler_desc,core_admin - improved wording
* pathtodot_help, core_admin - Windows and Mac paths
* debugstringids_desc, core_admin - improved explanation
2018-04-24 22:05:30 +02:00
Ruslan Kabalin
30e1797f29 MDL-50907 antivirus_clamav: Add test coverage for scan_data. 2018-04-12 10:30:25 +08:00
Ruslan Kabalin
ddf14b32fe MDL-50907 antivirus_clamav: Implement data scanning using unix sockets.
We use clamav data stream scanning functionality.
2018-04-12 10:30:25 +08:00
Andrew Nicols
658f84ab0c MDL-61818 antivirus: Implement core_privacy API 2018-04-02 13:47:17 +08:00
Eloy Lafuente (stronk7)
e4eba4c346 MDL-59159 upgrade: clean < 3.1.0 upgrade steps
LTS (3.5) requires previous LTS (3.1)

This just deletes all the upgrade steps previous to 3.1.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2016052300 (v3.1.0) as anti-cheating measure.

Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase.
2017-12-04 01:18:57 +01:00
Eloy Lafuente (stronk7)
6499085f36 MDL-60784 upgrade: add 3.4.0 separation line to all upgrade scripts 2017-11-12 18:43:30 +01:00
Eloy Lafuente (stronk7)
ba854606e6 MDL-60764 versions: bump all versions and requires near release
version = 2017111300 release version
requires= 2017110800 current rc2 version
2017-11-10 02:52:53 +01:00
Eloy Lafuente (stronk7)
5e27228335 MDL-58933 upgrade: add 3.3.0 separation line to all upgrade scripts 2017-05-19 19:22:07 +02:00
Eloy Lafuente (stronk7)
d989ee1e03 MDL-58853 versions: bump all versions and requires near release
version = 2017051500 release version
requires= 2017050500 current rc1 version
2017-05-09 02:58:28 +02:00
Eloy Lafuente (stronk7)
75c57a08fb MDL-57266 upgrade: add 3.2.0 separation line to all upgrade scripts 2016-12-05 17:10:20 +01:00
Eloy Lafuente (stronk7)
04649747a4 MDL-57197 versions: bump all versions and requires near release
version = 2016120500 release version
requires= 2016112900 current rc4 version
2016-11-29 22:57:05 +01:00
Ankit Agarwal
ff67562eca MDL-53366 antivirus_clamav: Remove Quarantine directory setting 2016-10-26 09:47:27 +05:30
Andrew Nicols
8d3c33c693 Merge branch 'MDL-50888-master' of https://github.com/lucisgit/moodle 2016-10-26 08:19:23 +08:00
Ruslan Kabalin
19f8cd61b0 MDL-53366 antivirus_clamav: Remove "Quarantine directory" setting. 2016-10-21 11:49:44 +01:00
Ruslan Kabalin
f8927a7cde MDL-50888 antivirus: Unit test refactoring.
Remove all cleanup and exception test references. We expect plugin just to
respond with scanning result constant and notice where applicable.

Add tests for \core\antivirus\manager.
2016-10-21 11:48:49 +01:00
Ruslan Kabalin
4cc1b5bc0c MDL-50888 antivirus: Move post-scan logic to manager.
In the initial implementation, infected file cleanup and exception throwing
was done at the plugin level. This is somewhat incorrect from plugin
responsibility perspective. The patch moves cleanup and exception logic to
the manager. Antivirus plugin responsibility is limited to perform scanning
and respond with one of the result statuses defined in the
\core\antivirus\scanner.
2016-10-21 11:48:49 +01:00
Ruslan Kabalin
83a43b88fe MDL-50888 antivirus_clamav: Unit tests refactoring.
Due to configurable nature of scanning method selection, unit test needs to
be updated to always point to commadline method. There is no need to write
separate tests for socket scanning method, as the scanning method needs to
be mocked anyway (i.e. will be identical to commandline scanning from test
perspective).
2016-10-21 11:48:48 +01:00
Ruslan Kabalin
7be0d4292a MDL-50888 antivirus_clamav: Implement scan using Unix domain sockets.
This is a faster way of scanning files than using command line exec call,
but only available on unix-like systems.
2016-10-21 11:48:48 +01:00
Eloy Lafuente (stronk7)
4da854a68b MDL-54677 upgrade: add 3.1.0 separation line to all upgrade scripts 2016-05-23 01:31:34 +02:00
Eloy Lafuente (stronk7)
1abca11e0a MDL-54638 versions: bump all versions and requires near release
version = 2016052300 release version
requires= 2016051900 current rc1 version
2016-05-19 02:16:15 +02:00
Ruslan Kabalin
71f74dd165 MDL-50887 antivirus_clamav: Add unit tests for scanner class.
We are using "stubbing" method to replace real component (clamav) control
points with doubles in order to avoid direct calls to clamav. For more
details, please refer to https://phpunit.de/manual/4.8/en/test-doubles.html

Notice, that while it is possible to use setExpectedException in the tests,
this does not seem play correctly with consecutive assertions in the same
test after exception is thrown (they seem omitted). Explicit try/catch
construction has been used in testing instead.

To run just this test, use:
vendor/bin/phpunit antivirus_clamav_scanner_testcase lib/antivirus/clamav/tests/scanner_test.php
2016-02-29 09:31:30 +00:00
Ruslan Kabalin
d08667a271 MDL-50887 antivirus_clamav: Access config properties using getter. 2016-02-29 09:31:29 +00:00
Ruslan Kabalin
5b6a0f2c15 MDL-50887 antivirus_clamav: Split scanning logic and results processing.
This refactoring will make possible to assert scan results processing
behaviour in unit testing.
2016-02-29 09:31:29 +00:00
Ruslan Kabalin
b6bb4e81bb MDL-50887 antivirus: Use autoloaded classes.
This implements the use of class autoloading for antivirus plugin. Base
abstract class, exception class and manager are using namespace
core\antivirus, this is because all three class files are located in
/lib/classes/antivirus/ (see \core_component::classloader for convention
details).
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
1a980fdadb MDL-50887 antivirus: Fix style issues. 2016-02-25 09:55:45 +00:00
Ruslan Kabalin
001feb6649 MDL-50887 antivirus: Refactor antivirus scanning to use new plugin.
This patch moves existing scanning functionality to plugin level. It does
not add anything new, just refactors the existing functionality.

AMOS BEGIN
  MOV [clamemailsubject,core],[emailsubject,antivirus]
  MOV [clamfailed,core],[clamfailed,antivirus_clamav]
  MOV [clamlost,core],[invalidpathtoclam,antivirus_clamav]
  MOV [clamunknownerror,core],[unknownerror,antivirus_clamav]
  MOV [virusfounduser,core],[virusfounduser,antivirus]
AMOS END
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
1a1d249a70 MDL-50887 antivirus_clamav: Implement file scanning functionality.
This also removes runclamonupload config setting. It is implied that files
will be scanned if plugin is enabled, no need to have a separate setting.

In addition to that, some language strings are updated. It is 'ClamAV', not
'clam AV' (see http://www.clamav.net/index.html).
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
7d19e0e33d MDL-50887 antivirus_clamav: Move global clamav settings to plugin level.
AMOS BEGIN
 MOV [clamfailureonupload,core],[clamfailureonupload,antivirus_clamav]
 MOV [configclamactlikevirus,core],[configclamactlikevirus,antivirus_clamav]
 MOV [configclamdonothing,core],[configclamdonothing,antivirus_clamav]
 MOV [configclamfailureonupload,core],[configclamfailureonupload,antivirus_clamav]
 MOV [configpathtoclam,core],[configpathtoclam,antivirus_clamav]
 MOV [configquarantinedir,core],[configquarantinedir,antivirus_clamav]
 MOV [configrunclamavonupload,core],[configrunclamavonupload,antivirus_clamav]
 MOV [pathtoclam,core],[pathtoclam,antivirus_clamav]
 MOV [quarantinedir,core],[quarantinedir,antivirus_clamav]
 MOV [runclamavonupload,core],[runclamavonupload,antivirus_clamav]
AMOS END
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
89a5878e3f MDL-50887 antivirus_clamav: Initial commit. 2016-02-25 09:54:05 +00:00