mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Log AccessDeniedExceptions to event log.
This commit is contained in:
parent
26737f4b46
commit
f116c2f09e
4 changed files with 98 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue