1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @copyright Copyright (c) 2017 Matthias Held <[email protected]> |
5
|
|
|
* @author Matthias Held <[email protected]> |
6
|
|
|
* @license GNU AGPL version 3 or any later version |
7
|
|
|
* |
8
|
|
|
* This program is free software: you can redistribute it and/or modify |
9
|
|
|
* it under the terms of the GNU Affero General Public License as |
10
|
|
|
* published by the Free Software Foundation, either version 3 of the |
11
|
|
|
* License, or (at your option) any later version. |
12
|
|
|
* |
13
|
|
|
* This program is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
|
|
|
* GNU Affero General Public License for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Affero General Public License |
19
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
namespace OCA\RansomwareDetection\Settings; |
23
|
|
|
|
24
|
|
|
use OCA\RansomwareDetection\AppInfo\Application; |
25
|
|
|
use OCP\IL10N; |
|
|
|
|
26
|
|
|
use OCP\IURLGenerator; |
|
|
|
|
27
|
|
|
use OCP\Settings\IIconSection; |
|
|
|
|
28
|
|
|
|
29
|
|
|
class PersonalSection implements IIconSection |
30
|
|
|
{ |
31
|
|
|
/** @var IURLGenerator */ |
32
|
|
|
private $urlGenerator; |
33
|
|
|
|
34
|
|
|
/** @var IL10N */ |
35
|
|
|
private $l; |
36
|
|
|
|
37
|
|
|
public function __construct( |
38
|
|
|
IURLGenerator $urlGenerator, |
39
|
|
|
IL10N $l |
40
|
|
|
) { |
41
|
|
|
$this->urlGenerator = $urlGenerator; |
42
|
|
|
$this->l = $l; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* returns the relative path to an 16*16 icon describing the section. |
47
|
|
|
* e.g. '/core/img/places/files.svg'. |
48
|
|
|
* |
49
|
|
|
* @returns string |
50
|
|
|
* |
51
|
|
|
* @since 13.0.0 |
52
|
|
|
*/ |
53
|
|
|
public function getIcon() |
54
|
|
|
{ |
55
|
|
|
return $this->urlGenerator->imagePath('ransomware_detection', 'app-dark.svg'); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* returns the ID of the section. It is supposed to be a lower case string, |
60
|
|
|
* e.g. 'ldap'. |
61
|
|
|
* |
62
|
|
|
* @returns string |
63
|
|
|
* |
64
|
|
|
* @since 9.1 |
65
|
|
|
*/ |
66
|
|
|
public function getID() |
67
|
|
|
{ |
68
|
|
|
return Application::APP_ID; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* returns the translated name as it should be displayed, e.g. 'LDAP / AD |
73
|
|
|
* integration'. Use the L10N service to translate it. |
74
|
|
|
* |
75
|
|
|
* @return string |
76
|
|
|
* |
77
|
|
|
* @since 9.1 |
78
|
|
|
*/ |
79
|
|
|
public function getName() |
80
|
|
|
{ |
81
|
|
|
return $this->l->t('Ransomware recovery'); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return int whether the form should be rather on the top or bottom of |
86
|
|
|
* the settings navigation. The sections are arranged in ascending order of |
87
|
|
|
* the priority values. It is required to return a value between 0 and 99. |
88
|
|
|
* |
89
|
|
|
* E.g.: 70 |
90
|
|
|
* |
91
|
|
|
* @since 9.1 |
92
|
|
|
*/ |
93
|
|
|
public function getPriority() |
94
|
|
|
{ |
95
|
|
|
return 15; |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths