CriticalActionPerformedEvent.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Log\Audit;
  8. use OCP\EventDispatcher\Event;
  9. /**
  10. * Emitted when the admin_audit app should log an entry
  11. *
  12. * @since 22.0.0
  13. */
  14. class CriticalActionPerformedEvent extends Event {
  15. /** @var string */
  16. private $logMessage;
  17. /** @var array */
  18. private $parameters;
  19. /** @var bool */
  20. private $obfuscateParameters;
  21. /**
  22. * @param string $logMessage
  23. * @param array $parameters
  24. * @param bool $obfuscateParameters
  25. * @since 22.0.0
  26. */
  27. public function __construct(string $logMessage,
  28. array $parameters = [],
  29. bool $obfuscateParameters = false) {
  30. parent::__construct();
  31. $this->logMessage = $logMessage;
  32. $this->parameters = $parameters;
  33. $this->obfuscateParameters = $obfuscateParameters;
  34. }
  35. /**
  36. * @return string
  37. * @since 22.0.0
  38. */
  39. public function getLogMessage(): string {
  40. return $this->logMessage;
  41. }
  42. /**
  43. * @return array
  44. * @since 22.0.0
  45. */
  46. public function getParameters(): array {
  47. return $this->parameters;
  48. }
  49. /**
  50. * @return bool
  51. * @since 22.0.0
  52. */
  53. public function getObfuscateParameters(): bool {
  54. return $this->obfuscateParameters;
  55. }
  56. }