2021-04-09 11:32:45 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2021 Joas Schilling <coding@schilljs.com>
|
|
|
|
*
|
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-04-09 13:50:02 +03:00
|
|
|
namespace OCP\Log\Audit;
|
2021-04-09 11:32:45 +03:00
|
|
|
|
|
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Emitted when the admin_audit app should log an entry
|
|
|
|
*
|
|
|
|
* @since 22.0.0
|
|
|
|
*/
|
2021-04-09 13:50:02 +03:00
|
|
|
class CriticalActionPerformedEvent extends Event {
|
2021-04-09 11:32:45 +03:00
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
private $logMessage;
|
|
|
|
|
|
|
|
/** @var array */
|
|
|
|
private $parameters;
|
|
|
|
|
|
|
|
/** @var bool */
|
|
|
|
private $obfuscateParameters;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $logMessage
|
|
|
|
* @param array $parameters
|
|
|
|
* @param bool $obfuscateParameters
|
2021-04-12 11:31:10 +03:00
|
|
|
* @since 22.0.0
|
2021-04-09 11:32:45 +03:00
|
|
|
*/
|
|
|
|
public function __construct(string $logMessage,
|
|
|
|
array $parameters = [],
|
|
|
|
bool $obfuscateParameters = false) {
|
|
|
|
parent::__construct();
|
|
|
|
$this->logMessage = $logMessage;
|
|
|
|
$this->parameters = $parameters;
|
|
|
|
$this->obfuscateParameters = $obfuscateParameters;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
* @since 22.0.0
|
|
|
|
*/
|
|
|
|
public function getLogMessage(): string {
|
|
|
|
return $this->logMessage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
* @since 22.0.0
|
|
|
|
*/
|
|
|
|
public function getParameters(): array {
|
|
|
|
return $this->parameters;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @since 22.0.0
|
|
|
|
*/
|
|
|
|
public function getObfuscateParameters(): bool {
|
|
|
|
return $this->obfuscateParameters;
|
|
|
|
}
|
|
|
|
}
|