Releases: sumocoders/Framework-User-Implementation-Example
v9.1.2
v9.1.1
What's Changed
- Fix resend confirmation route by @jonasdekeukelaere in #31
- Make sure you switch to a route that user can visit by @jonasdekeukelaere in #32
- Fix console command description by @jonasdekeukelaere in #30
Full Changelog: v9.1.0...v9.1.1
v9.1.0
What's Changed
- Use routes in access control by @jonasdekeukelaere in #26
- Add forgot password to backend by @jonasdekeukelaere in #27
- Add users to menu listener by @jonasdekeukelaere in #28
- Add console command to add user by @jonasdekeukelaere in #29
Full Changelog: v9.0.1...v9.1.0
v9.0.1
What's Changed
- Password strength for register by @jonasdekeukelaere in #25
Full Changelog: v9.0.0...v9.0.1
v9.0.0
What's Changed
- removed js translation by @PiroozMor in #23
- Update symfony config by @jonasdekeukelaere in #24
New Contributors
- @PiroozMor made their first contribution in #23
Full Changelog: v8.0.1...v9.0.0
v8.0.1
V8.0.0
What's Changed
- 298 confirm button behind email links by @bjorvack in #16
- Show remember me checkbox on login by @absumo in #17
- Symfony 7.1 by @jonasdekeukelaere in #18
- 316 route fixes by @absumo in #19
- 297 password reset weak password by @daphneslootmans in #20
- 324 audit trail by @jonasdekeukelaere in #21
New Contributors
Full Changelog: v7.0...V8.0.0
v7.0
Changes
Logout no longer needs a controller
Symfony 6.4 and up no longer need a controller and route for logout functionality. Use the following config in the security.yaml file to enable the logout
firewalls:
main:
logout:
path: app_logout
# target: app_any_routeDo make sure the routes/security.yaml file isn't empty
_security_logout:
resource: security.route_loader.logout
type: serviceMap $_GET params using #[MapQueryParameters]
GET params no longer need to be got from the query parameters in request. Just add the MapQueryParameter attribute to the controller action parameter to populate it dynamically
#[Route('/admin/users')]
#[Breadcrumb('users')]
public function __invoke(
Request $request,
UserRepository $userRepository,
): Response {
$page = $request->query->getInt('page', 1);
$form = $this->createForm(FilterType::class, new FilterDataTransferObject() );
$form->handleRequest($request);
$paginatedUsers = $userRepository->getAllFilteredUsers($form->getData());
$paginatedUsers->paginate($page);
return $this->render('user/admin/overview.html.twig', [
'form' => $form->createView(),
'users' => $paginatedUsers,
]);
}becomes
#[Route('/admin/users')]
#[Breadcrumb('users')]
public function __invoke(
Request $request,
UserRepository $userRepository,
#[MapQueryParameter] ?int $page = 1
): Response {
$form = $this->createForm(FilterType::class, new FilterDataTransferObject() );
$form->handleRequest($request);
$paginatedUsers = $userRepository->getAllFilteredUsers($form->getData());
$paginatedUsers->paginate($page);
return $this->render('user/admin/overview.html.twig', [
'form' => $form->createView(),
'users' => $paginatedUsers,
]);
}Impersonating users
When impersonating users we no longer need to manually need to define magic get properties in the path. We kan now use the build in twig methods to generate te correct links
Impersonate
<a class="text-nowrap" href="{{ path('profile', {'_switch_user': user.username}) }}">
<i class="fas fa-sign-in-alt" title="{{ 'Switch to user'|trans }}" data-toggle="tooltip" data-placement="top"></i>
</a>becomes
<a class="text-nowrap" href="{{ impersonation_path(user.username) }}">
<i class="fas fa-sign-in-alt" title="{{ 'Switch to user'|trans }}" data-toggle="tooltip" data-placement="top"></i>
</a>Exit impersonation
<a href="{{ path('user_overview', {'_switch_user': '_exit'}) }}">{{ 'user.actions.switchback'|trans|ucfirst }}</a>becomes
<a href="{{ impersonation_exit_path(path('user_overview')) }}" class="dropdown-item">{{'user.actions.switchback'|trans|ucfirst }}</a>Routes can be accessed by their FQCN
Routes no longer need to define a name to be accessed bij the router. When no name is provided a generated name based on the FQCN is used.
For example the App\Controller\User\Admin\OverviewController file would us the path name user_overview since it's defined
#[Route('/admin/users', name: 'user_overview')]
#[Breadcrumb('users')]
public function __invoke(
Request $request,
UserRepository $userRepository,
#[MapQueryParameter]
?int $page = 1
): Response ...If the name isn't defined it would be app_user_admin_overview
#[Route('/admin/users')]
#[Breadcrumb('users')]
public function __invoke(
Request $request,
UserRepository $userRepository,
#[MapQueryParameter]
?int $page = 1
): Response ...In both cases the FQCN can be used in the router to point at the correct path
return $this->redirectToRoute(OverviewController::class);if a specific method needs to be called this can be added as well
return $this->redirectToRoute(OverviewController::class.'::index');New Contributors
- @jonasdekeukelaere made their first contribution in #2
- @sanderdlm made their first contribution in #3
- @daphneslootmans made their first contribution in #4
- @tijsverkoyen made their first contribution in #5
- @bjorvack made their first contribution in #13
Full Changelog: https://github.com/sumocoders/Framework-User-Implementation-Example/commits/v7.0