Log AccessDeniedExceptions to event log.

This commit is contained in:
Jan Böhmer 2020-04-10 12:28:15 +02:00
parent 26737f4b46
commit f116c2f09e
4 changed files with 98 additions and 3 deletions

View file

@ -52,11 +52,21 @@ class UserNotAllowedLogEntry extends AbstractLogEntry
{
protected $typeString = 'user_not_allowed';
public function __construct()
public function __construct(string $path)
{
parent::__construct();
//Obsolete, use server log now.
throw new LogEntryObsoleteException();
$this->level = static::LEVEL_WARNING;
$this->extra['a'] = $path;
}
/**
* Returns the path the user tried to accessed and what was denied.
* @return string
*/
public function getPath(): string
{
return $this->extra['a'] ?? 'legacy';
}
public function getMessage(): string