Secure admin

This commit is contained in:
2025-04-21 19:12:48 +02:00
parent daeda4a9b5
commit 66b57ea84a
4 changed files with 7 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ security:
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
when@test:

View File

@@ -95,7 +95,7 @@ final class QuizController extends AbstractController
$candidate = $candidateRepository->getCandidateByHash($season, $nameHash);
if (!$candidate instanceof Candidate) {
$this->addFlash(FlashType::Danger, 'Candidate not found');
$this->addFlash(FlashType::Danger, $this->translator->trans('Candidate not found'));
return $this->redirectToRoute('app_quiz_entername', ['seasonCode' => $season->getSeasonCode()]);
}
@@ -117,7 +117,7 @@ final class QuizController extends AbstractController
$question = $questionRepository->findNextQuestionForCandidate($candidate);
if (!$question instanceof Question) {
$this->addFlash(FlashType::Success, 'Quiz completed');
$this->addFlash(FlashType::Success, $this->translator->trans('Quiz completed'));
return $this->redirectToRoute('app_quiz_entername', ['seasonCode' => $season->getSeasonCode()]);
}

View File

@@ -86,7 +86,7 @@ final class RegistrationController extends AbstractController
return $this->redirectToRoute('app_register');
}
$this->addFlash('success', 'Your email address has been verified.');
$this->addFlash('success', $this->translator->trans('Your email address has been verified.'));
return $this->redirectToRoute('app_backoffice_index');
}

View File

@@ -2,6 +2,7 @@
'All Seasons': 'Alle seizoenen'
'Already have an account? Log in': 'Heb je al een account? Log in'
Candidate: Kandidaat
'Candidate not found': 'Kandidaat niet gevonden'
Candidates: Kandidaten
'Correct Answers': 'Goede antwoorden'
Corrections: Jokers
@@ -22,6 +23,7 @@ Password: Wachtwoord
'Prepare Custom Elimination': 'Bereid aangepaste eliminatie voor'
Questions: Vragen
Quiz: Test
'Quiz completed': 'Test voltooid'
Quizzes: Tests
Register: Registreren
'Remember me': 'Onthoud mij'
@@ -34,3 +36,4 @@ Seasons: Seizoenen
'There are no answers for this question': 'Er zijn geen antwoorden voor deze vraag'
Time: Tijd
'Your Seasons': 'Jouw seizoenen'
'Your email address has been verified.': 'Je e-mailadres is geverifieerd.'