@@ -12,11 +12,11 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | private $container; |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * GuidAwareListener constructor. |
|
| 17 | - * @param ContainerInterface $container |
|
| 18 | - */ |
|
| 19 | - public function __construct(ContainerInterface $container) |
|
| 15 | + /** |
|
| 16 | + * GuidAwareListener constructor. |
|
| 17 | + * @param ContainerInterface $container |
|
| 18 | + */ |
|
| 19 | + public function __construct(ContainerInterface $container) |
|
| 20 | 20 | { |
| 21 | 21 | $this->container = $container; |
| 22 | 22 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * method that return all infos needed in access right management page |
|
| 25 | + * method that return all infos needed in access right management page |
|
| 26 | 26 | * @return array |
| 27 | 27 | */ |
| 28 | 28 | public function getAllInfosModules() |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * function that return all modules rights |
|
| 47 | + * function that return all modules rights |
|
| 48 | 48 | * @return object |
| 49 | 49 | */ |
| 50 | 50 | public function getModuleRights() |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | class Jwt |
| 8 | 8 | { |
| 9 | 9 | /** |
| 10 | - * encode an array in jwt |
|
| 10 | + * encode an array in jwt |
|
| 11 | 11 | * @param array $values |
| 12 | 12 | * @param string $token |
| 13 | 13 | * @return string |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * encode a jwt in array |
|
| 21 | + * encode a jwt in array |
|
| 22 | 22 | * @param string $encoded_json |
| 23 | 23 | * @param string $token |
| 24 | 24 | * @return bool|object |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | ]); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @Route("/accounts/create/", name="ribsadmin_accounts_create") |
|
| 38 | - * @Route("/accounts/edit/{guid}", name="ribsadmin_accounts_edit") |
|
| 39 | - * @param Request $request |
|
| 40 | - * @param string|null $guid |
|
| 41 | - * @return Response |
|
| 42 | - */ |
|
| 36 | + /** |
|
| 37 | + * @Route("/accounts/create/", name="ribsadmin_accounts_create") |
|
| 38 | + * @Route("/accounts/edit/{guid}", name="ribsadmin_accounts_edit") |
|
| 39 | + * @param Request $request |
|
| 40 | + * @param string|null $guid |
|
| 41 | + * @return Response |
|
| 42 | + */ |
|
| 43 | 43 | public function editUserAction(Request $request, string $guid = null): Response |
| 44 | 44 | { |
| 45 | 45 | $em = $this->getDoctrine()->getManager(); |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | if ($guid === null) { |
| 48 | 48 | $account = new Account(); |
| 49 | 49 | $old_password = null; |
| 50 | - $user = null; |
|
| 50 | + $user = null; |
|
| 51 | 51 | } else { |
| 52 | 52 | $user = $em->getRepository(User::class)->findOneBy(["guid" => $guid]); |
| 53 | 53 | $account = $em->getRepository(Account::class)->findOneBy(["user" => $user->getId()]); |
| 54 | - $old_password = $account->getPassword(); |
|
| 54 | + $old_password = $account->getPassword(); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $form = $this->createForm("PiouPiou\RibsAdminBundle\Form\Account", $account); |
@@ -71,15 +71,15 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | if (!$account_exist) { |
| 74 | - if ($guid === null) { |
|
| 75 | - $temp_password = $this->get("security.password_encoder")->encodePassword($data, $form->get("password")->getData()); |
|
| 76 | - $data->setPassword($temp_password); |
|
| 77 | - } else if ($form->get("password")->getData()) { |
|
| 78 | - $temp_password = $this->get("security.password_encoder")->encodePassword($data, $form->get("password")->getData()); |
|
| 79 | - $data->setPassword($temp_password); |
|
| 80 | - } else { |
|
| 81 | - $data->setPassword($old_password); |
|
| 82 | - } |
|
| 74 | + if ($guid === null) { |
|
| 75 | + $temp_password = $this->get("security.password_encoder")->encodePassword($data, $form->get("password")->getData()); |
|
| 76 | + $data->setPassword($temp_password); |
|
| 77 | + } else if ($form->get("password")->getData()) { |
|
| 78 | + $temp_password = $this->get("security.password_encoder")->encodePassword($data, $form->get("password")->getData()); |
|
| 79 | + $data->setPassword($temp_password); |
|
| 80 | + } else { |
|
| 81 | + $data->setPassword($old_password); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | $em->persist($data); |
| 85 | 85 | $em->flush(); |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | return $this->render("@RibsAdmin/accounts/edit.html.twig", [ |
| 103 | 103 | "form" => $form->createView(), |
| 104 | - "form_errors" => $form->getErrors(), |
|
| 105 | - "user" => $user |
|
| 104 | + "form_errors" => $form->getErrors(), |
|
| 105 | + "user" => $user |
|
| 106 | 106 | ]); |
| 107 | 107 | } |
| 108 | 108 | //-------------------------------------------- END DISPLAY VIEWS -----------------------------------------------------------// |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageController extends AbstractController |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * method to show index page of content management |
|
| 13 | - * @Route("/contents", name="ribsadmin_contents") |
|
| 14 | - * @return Response |
|
| 15 | - */ |
|
| 11 | + /** |
|
| 12 | + * method to show index page of content management |
|
| 13 | + * @Route("/contents", name="ribsadmin_contents") |
|
| 14 | + * @return Response |
|
| 15 | + */ |
|
| 16 | 16 | public function indexAction(): Response |
| 17 | 17 | { |
| 18 | 18 | $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage(); |
@@ -9,11 +9,11 @@ |
||
| 9 | 9 | |
| 10 | 10 | class RenderPageController extends AbstractController |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * @Route("/page/{url}", name="page", requirements={"url" = "[a-zA-Z0-9\-\_\/]*"}) |
|
| 14 | - * @param string $url |
|
| 15 | - * @return Response |
|
| 16 | - */ |
|
| 12 | + /** |
|
| 13 | + * @Route("/page/{url}", name="page", requirements={"url" = "[a-zA-Z0-9\-\_\/]*"}) |
|
| 14 | + * @param string $url |
|
| 15 | + * @return Response |
|
| 16 | + */ |
|
| 17 | 17 | public function renderPageAction(string $url): Response |
| 18 | 18 | { |
| 19 | 19 | $em = $this->getDoctrine()->getManager(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | private $nav = []; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * function that display the left navigation mapped by user rights |
|
| 16 | + * function that display the left navigation mapped by user rights |
|
| 17 | 17 | * @return Response |
| 18 | 18 | */ |
| 19 | 19 | public function getLeftNavigation(Globals $globals, AccessRights $access_rights): Response |
@@ -28,15 +28,15 @@ |
||
| 28 | 28 | ]); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @Route("/access-rights-management/create/", name="ribsadmin_access_rights_create") |
|
| 33 | - * @Route("/access-rights-management/edit/{guid}", name="ribsadmin_access_rights_edit") |
|
| 34 | - * @param Request $request |
|
| 35 | - * @param Globals $globals |
|
| 36 | - * @param ModuleService $module |
|
| 37 | - * @param string|null $guid |
|
| 38 | - * @return Response |
|
| 39 | - */ |
|
| 31 | + /** |
|
| 32 | + * @Route("/access-rights-management/create/", name="ribsadmin_access_rights_create") |
|
| 33 | + * @Route("/access-rights-management/edit/{guid}", name="ribsadmin_access_rights_edit") |
|
| 34 | + * @param Request $request |
|
| 35 | + * @param Globals $globals |
|
| 36 | + * @param ModuleService $module |
|
| 37 | + * @param string|null $guid |
|
| 38 | + * @return Response |
|
| 39 | + */ |
|
| 40 | 40 | public function editAction(Request $request, Globals $globals, ModuleService $module, string $guid = null): Response |
| 41 | 41 | { |
| 42 | 42 | $em = $this->getDoctrine()->getManager(); |
@@ -11,17 +11,17 @@ |
||
| 11 | 11 | |
| 12 | 12 | class LoginController extends AbstractController |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * @Route("/login/", name="ribsadmin_login") |
|
| 16 | - * @param CsrfTokenManagerInterface $token |
|
| 17 | - * @param AuthenticationUtils $auth_utils |
|
| 18 | - * @return Response |
|
| 19 | - */ |
|
| 14 | + /** |
|
| 15 | + * @Route("/login/", name="ribsadmin_login") |
|
| 16 | + * @param CsrfTokenManagerInterface $token |
|
| 17 | + * @param AuthenticationUtils $auth_utils |
|
| 18 | + * @return Response |
|
| 19 | + */ |
|
| 20 | 20 | public function loginAction(AuthenticationUtils $auth_utils): Response |
| 21 | 21 | { |
| 22 | - $csrf_token = $this->has('security.csrf.token_manager') |
|
| 23 | - ? $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue() |
|
| 24 | - : null; |
|
| 22 | + $csrf_token = $this->has('security.csrf.token_manager') |
|
| 23 | + ? $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue() |
|
| 24 | + : null; |
|
| 25 | 25 | |
| 26 | 26 | if ($auth_utils->getLastAuthenticationError()) { |
| 27 | 27 | $this->addFlash("error-flash", "Your login or password are incorrect"); |