mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Give user creation/deletions a NOTICE level.
This commit is contained in:
parent
70abc47ae0
commit
b2f751644a
2 changed files with 14 additions and 0 deletions
|
@ -45,6 +45,8 @@ namespace App\Entity\LogSystem;
|
||||||
use App\Entity\Base\AbstractDBElement;
|
use App\Entity\Base\AbstractDBElement;
|
||||||
use App\Entity\Contracts\LogWithCommentInterface;
|
use App\Entity\Contracts\LogWithCommentInterface;
|
||||||
use App\Entity\Contracts\LogWithEventUndoInterface;
|
use App\Entity\Contracts\LogWithEventUndoInterface;
|
||||||
|
use App\Entity\UserSystem\Group;
|
||||||
|
use App\Entity\UserSystem\User;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,6 +61,11 @@ class ElementCreatedLogEntry extends AbstractLogEntry implements LogWithCommentI
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->level = self::LEVEL_INFO;
|
$this->level = self::LEVEL_INFO;
|
||||||
$this->setTargetElement($new_element);
|
$this->setTargetElement($new_element);
|
||||||
|
|
||||||
|
//Creation of new users is maybe more interesting...
|
||||||
|
if ($new_element instanceof User || $new_element instanceof Group) {
|
||||||
|
$this->level = self::LEVEL_NOTICE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -47,6 +47,8 @@ use App\Entity\Contracts\LogWithCommentInterface;
|
||||||
use App\Entity\Contracts\LogWithEventUndoInterface;
|
use App\Entity\Contracts\LogWithEventUndoInterface;
|
||||||
use App\Entity\Contracts\NamedElementInterface;
|
use App\Entity\Contracts\NamedElementInterface;
|
||||||
use App\Entity\Contracts\TimeTravelInterface;
|
use App\Entity\Contracts\TimeTravelInterface;
|
||||||
|
use App\Entity\UserSystem\Group;
|
||||||
|
use App\Entity\UserSystem\User;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,6 +63,11 @@ class ElementDeletedLogEntry extends AbstractLogEntry implements TimeTravelInter
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->level = self::LEVEL_INFO;
|
$this->level = self::LEVEL_INFO;
|
||||||
$this->setTargetElement($deleted_element);
|
$this->setTargetElement($deleted_element);
|
||||||
|
|
||||||
|
//Deletion of a user is maybe more interesting...
|
||||||
|
if ($deleted_element instanceof User || $deleted_element instanceof Group) {
|
||||||
|
$this->level = self::LEVEL_NOTICE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue