Logos, robots and some fixs

This commit is contained in:
Xbird
2022-08-08 17:19:06 +00:00
parent 9918c6bad9
commit 4f00470223
54 changed files with 235 additions and 59 deletions

View File

@@ -10,6 +10,7 @@ use App\Form\AdminRankType;
use App\Form\AdminUserType;
use App\Form\SearchBarType;
use App\Form\AdminGroupType;
use Psr\Log\LoggerInterface;
use App\Form\AdminSubGroupType;
use App\Repository\UserRepository;
use App\Repository\GroupRepository;
@@ -33,10 +34,12 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class AdminController extends AbstractController
{
private Security $security;
private LoggerInterface $logger;
public function __construct(Security $security)
public function __construct(Security $security, LoggerInterface $logger)
{
$this->security = $security;
$this->logger = $logger;
}
#[Route('/', name: 'index')]
@@ -172,6 +175,8 @@ class AdminController extends AbstractController
} catch (\Throwable $th) {
if ($_ENV['APP_ENV'] === 'dev') {
throw $th; //DEBUG
} else {
$this->logger->error($th);
}
$this->addFlash('danger', 'alert_error_saving_user');
return $this->redirectToRoute('admin_user_edit', ['id' => $User->getId()]);
@@ -274,6 +279,8 @@ class AdminController extends AbstractController
} catch (\Throwable $th) {
if ($_ENV['APP_ENV'] === 'dev') {
throw $th; //DEBUG
} else {
$this->logger->error($th);
}
$this->addFlash('danger', 'alert_error_creating_group');
}
@@ -302,6 +309,8 @@ class AdminController extends AbstractController
} catch (\Throwable $th) {
if ($_ENV['APP_ENV'] === 'dev') {
throw $th; //DEBUG
} else {
$this->logger->error($th);
}
$this->addFlash('danger', 'alert_error_editing_group');
}
@@ -363,6 +372,8 @@ class AdminController extends AbstractController
} catch (\Throwable $th) {
if ($_ENV['APP_ENV'] === 'dev') {
throw $th; //DEBUG
} else {
$this->logger->error($th);
}
$this->addFlash('danger', 'alert_error_editing_rank');
}
@@ -395,6 +406,8 @@ class AdminController extends AbstractController
} catch (\Throwable $th) {
if ($_ENV['APP_ENV'] === 'dev') {
throw $th; //DEBUG
} else {
$this->logger->error($th);
}
$this->addFlash('danger', 'alert_error_creating_rank');
}
@@ -478,6 +491,8 @@ class AdminController extends AbstractController
} catch (\Throwable $th) {
if ($_ENV['APP_ENV'] === 'dev') {
throw $th; //DEBUG
} else {
$this->logger->error($th);
}
$this->addFlash('danger', 'alert_error_editing_subgroup');
}
@@ -510,6 +525,8 @@ class AdminController extends AbstractController
} catch (\Throwable $th) {
if ($_ENV['APP_ENV'] === 'dev') {
throw $th; //DEBUG
} else {
$this->logger->error($th);
}
$this->addFlash('danger', 'alert_error_creating_subgroup');
}