SecurityFilter.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OC\Settings\Activity;
  22. use OCP\Activity\IFilter;
  23. use OCP\IL10N;
  24. use OCP\IURLGenerator;
  25. class SecurityFilter implements IFilter {
  26. /** @var IURLGenerator */
  27. private $urlGenerator;
  28. /** @var IL10N */
  29. private $l10n;
  30. public function __construct(IURLGenerator $urlGenerator, IL10N $l10n) {
  31. $this->urlGenerator = $urlGenerator;
  32. $this->l10n = $l10n;
  33. }
  34. public function allowedApps() {
  35. return [];
  36. }
  37. public function filterTypes(array $types) {
  38. return array_intersect(['security'], $types);
  39. }
  40. public function getIcon() {
  41. return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg'));
  42. }
  43. public function getIdentifier() {
  44. return 'security';
  45. }
  46. public function getName() {
  47. return $this->l10n->t('Security');
  48. }
  49. public function getPriority() {
  50. return 30;
  51. }
  52. }