|
@@ -26,9 +26,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|
|
|
|
|
class SecurityController extends AbstractController
|
|
|
{
|
|
|
- /**
|
|
|
- * @Route("/login", name="app_login")
|
|
|
- */
|
|
|
+ #[Route("/login", name: "app_login")]
|
|
|
public function login(AuthenticationUtils $authenticationUtils): Response
|
|
|
{
|
|
|
// get the login error if there is one
|
|
@@ -39,17 +37,13 @@ class SecurityController extends AbstractController
|
|
|
return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/logout", name="app_logout")
|
|
|
- */
|
|
|
+ #[Route("/logout", name: "app_logout")]
|
|
|
public function logout()
|
|
|
{
|
|
|
throw new \Exception('Don\'t forget to activate logout in security.yaml');
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/admin/createuser", name="admin_createuser")
|
|
|
- */
|
|
|
+ #[Route("/admin/createuser", name: "admin_createuser")]
|
|
|
public function createUserAction(Request $request, UserManager $userManager)
|
|
|
{
|
|
|
$user = new User;
|
|
@@ -67,9 +61,7 @@ class SecurityController extends AbstractController
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/admin/edituser/{id}", name="admin_edituser")
|
|
|
- */
|
|
|
+ #[Route("/admin/edituser/{id}", name: "admin_edituser")]
|
|
|
public function editUserAction(Request $request, User $user, EntityManagerInterface $em)
|
|
|
{
|
|
|
$form = $this->createForm(UserEditType::class, $user);
|
|
@@ -85,9 +77,7 @@ class SecurityController extends AbstractController
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/admin/edituseroptions/{id}", name="admin_edituseroptions")
|
|
|
- */
|
|
|
+ #[Route("/admin/edituseroptions/{id}", name: "admin_edituseroptions")]
|
|
|
public function editUseroptions (Request $request, Profile $options, EntityManagerInterface $em)
|
|
|
{
|
|
|
$form = $this->createForm(ProfileType::class, $options);
|
|
@@ -106,9 +96,7 @@ class SecurityController extends AbstractController
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/admin", name="admin_index")
|
|
|
- */
|
|
|
+ #[Route("/admin", name: "admin_index")]
|
|
|
public function indexAction(Request $request, UserRepository $repo)
|
|
|
{
|
|
|
$users = $repo->findAll();
|
|
@@ -118,9 +106,7 @@ class SecurityController extends AbstractController
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/admin/deluser/{id}", name="admin_deluser")
|
|
|
- */
|
|
|
+ #[Route("/admin/deluser/{id}", name: "admin_deluser")]
|
|
|
public function delUserAction (Request $request, User $user, UserManager $userManager, FormFactoryInterface $ffi)
|
|
|
{
|
|
|
$form = $ffi->create();
|
|
@@ -136,9 +122,7 @@ class SecurityController extends AbstractController
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/register", name="security_register")
|
|
|
- */
|
|
|
+ #[Route("/register", name: "security_register")]
|
|
|
public function registerAction(Request $request, UserManager $userManager, Mail $mail)
|
|
|
{
|
|
|
$user = new User();
|
|
@@ -161,9 +145,7 @@ class SecurityController extends AbstractController
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/motdepasseoublie", name="security_envoyertoken")
|
|
|
- */
|
|
|
+ #[Route("/motdepasseoublie", name: "security_envoyertoken")]
|
|
|
public function recupMdpAction(Request $request, UserManager $userManager, Mail $mail, EntityManagerInterface $em, UserRepository $userRepo)
|
|
|
{
|
|
|
$form = $this->createFormBuilder()
|
|
@@ -194,9 +176,7 @@ class SecurityController extends AbstractController
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/resetpassword/token={token}", name="security_resetpassword")
|
|
|
- */
|
|
|
+ #[Route("/resetpassword/token={token}", name: "security_resetpassword")]
|
|
|
public function resetPasswordAction(Request $request, UserManager $userManager, User $user = null)
|
|
|
{
|
|
|
if ($user != null) {
|
|
@@ -218,10 +198,7 @@ class SecurityController extends AbstractController
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Ne pas utiliser
|
|
|
- * @Route("/admin/resettokens", name="admin_resettokens")
|
|
|
- */
|
|
|
+ #[Route("/admin/resettokens", name: "admin_resettokens")]
|
|
|
public function resetTokensAction(UserManager $userManager, EntityManagerInterface $em, UserRepository $userRepo)
|
|
|
{
|
|
|
$users = $userRepo->findAll();
|
|
@@ -233,9 +210,7 @@ class SecurityController extends AbstractController
|
|
|
return $this->redirectToRoute('admin_index');
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Route("/activate/token={token}", name="security_activate")
|
|
|
- */
|
|
|
+ #[Route("/activate/token={token}", name: "security_activate")]
|
|
|
public function activateAction(Request $request, EntityManagerInterface $em, User $user = null)
|
|
|
{
|
|
|
if ($user != null)
|