Show special icon in users menu when a user is locked

This commit is contained in:
Jan Böhmer 2022-11-14 23:52:10 +01:00
parent a3aa8ec2ef
commit 37fde77b8e

View file

@ -43,6 +43,7 @@ declare(strict_types=1);
namespace App\Repository;
use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\UserSystem\User;
use App\Helpers\Trees\TreeViewNode;
class NamedDBElementRepository extends DBElementRepository
@ -63,6 +64,11 @@ class NamedDBElementRepository extends DBElementRepository
$node = new TreeViewNode($entity->getName(), null, null);
$node->setId($entity->getID());
$result[] = $node;
if ($entity instanceof User && $entity->isDisabled()) {
//If this is an user, then add a badge when it is disabled
$node->setIcon('fa-fw fa-treeview fa-solid fa-user-lock text-muted');
}
}
return $result;