-
Notifications
You must be signed in to change notification settings - Fork 5
/
ClamavVersionHandler.inc.php
44 lines (41 loc) · 1.09 KB
/
ClamavVersionHandler.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* @file plugins/generic/clamav/ClamavVersionHandler.inc.php
*
* Copyright (c) 2018 University of Pittsburgh
* Distributed under the GNU GPL v2 or later. For full terms see the LICENSE file.
*
* @class ClamavVersionHandler
* @ingroup plugins_generic_clamav
*
* @brief ClamAV version handler class.
*
* @class ClamavVersionHandler
* @ingroup plugins_generic_clamavplugin
*
* @brief Handle router requests for the clam AV version for the clam AV plugin.
*/
import('classes.handler.Handler');
class ClamavVersionHandler extends Handler {
/**
* Return the Clam AV version
*
* @param $args array
* @param $request PKPRequest
* @return null|JSONMessage
*/
public function clamavVersion($args, $request) {
if(Validation::isSiteAdmin()) {
$plugin = PluginRegistry::getPlugin('generic', 'clamavplugin');
$userVars = $request->getUserVars();
$path = $userVars['path'];
$type = $userVars['type'];
if ($path && $type) {
$clamVersion = $plugin->getClamVersion($path, $type);
} else {
$clamVersion = '';
}
return new JSONMessage(true, $clamVersion);
}
}
}