Download the PHP package sidus/user-bundle without Composer
On this page you can find all versions of the php package sidus/user-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sidus/user-bundle
More information about sidus/user-bundle
Files in sidus/user-bundle
Package user-bundle
Short Description User management for Symfony 6.3+
License MIT
Homepage https://github.com/VincentChalnot/SidusUserBundle
Informations about the package user-bundle
Sidus User Bundle
User management for Symfony 6.3+: authentication, password reset/recovery, user profile
editing, roles/permissions with a proper hierarchy tree, and optional group management —
plus an optional CRUD admin backend when sidus/admin-bundle is available.
- License: MIT
- Author: Vincent Chalnot (sidus.fr)
- Repository: https://github.com/VincentChalnot/SidusUserBundle
Features
UserandGroupDoctrine entities (ULID identifiers, bigint PK,ROLE_USER/ROLE_ADMINbuilt in, many-to-many groups).- Login / logout, "lost password", and "reset password" flows out of the box, each with
HTML views and translated flash messages (
en/frincluded). - Self-service profile edition and password change actions for authenticated users.
- A role hierarchy service (
Sidus\UserBundle\Security\Core\Role\RoleHierarchy) that exposessecurity.role_hierarchy.rolesas a browsable tree (LeafRole), used by the role-picker form type. - Transactional email (new account + password reset) via
symfony/mailer, with an event (MailEvent) to customize the generatedTemplatedEmailbefore sending. - Console commands to create, promote/demote and change the password of users without going through the UI.
AuthorableInterface+ a Doctrine subscriber that auto-fillscreatedBy/updatedByon any entity that implements it.- Optional admin CRUD screens for users/groups, built on
sidus/admin-bundle.
Requirements
- PHP >= 8.1
- Symfony >= 6.3 (
dependency-injection,http-foundation,http-kernel,security-core,translation,console,uid,validator,options-resolver,password-hasher) doctrine/orm>= 2.9
Optional, depending on which features you use:
symfony/mailer+symfony/mime— sending account/reset emails.symfony/form— all the bundle's forms (login, profile, password, roles...).symfony/routing+symfony/twig-bridge+sidus/template-bundle+sidus/admin-bundle— the admin backend (enable_admin: true).
Installation
Register the bundle (skip if you use Symfony Flex, which does this automatically):
The bundle prepends its own Doctrine attribute mapping and (when
sidus/template-bundle is present) registers its login/lost-password/reset-password/
profile templates with sidus_template — no extra Doctrine or template config needed.
Update your schema (or generate a migration) once User/Group are mapped:
Configuration
mailer.* is required as soon as the mailer key is present — the extension loads
Resources/config/mailer.yaml (registering UserMailer) only if the section is set, so
omit it entirely for setups that never send mail (e.g. admin-created users with a
manually assigned password).
Wire the security firewall to the bundle's routes and to Doctrine's user provider, e.g.:
Import the routes:
Routes
| Name | Path | Purpose |
|---|---|---|
sidus.user.login |
/login |
Login form |
sidus.user.login_check |
/login_check |
Firewall check target (intercepted by form_login; falls back to redirecting to sidus.user.login if hit directly) |
sidus.user.logout |
/logout |
Firewall logout target |
sidus.user.lost_password |
/login/lost-password |
Request a password reset email |
sidus.user.reset_password |
/login/reset-password |
Consume the reset token, set a new password |
sidus.user.profile |
/profile |
Edit own email/profile |
sidus.user.profile.change_password |
/profile/change-password |
Change own password |
Admin routes are provided by Resources/config/admin.yaml (Action\Admin\*) and only
tag the controllers as services — actual route definitions/registration are driven by
sidus/admin-bundle's own admin configuration, which is out of scope for this bundle.
Console commands
All arguments/options are prompted interactively when omitted (non-interactive shells
require them explicitly). Leaving --password blank triggers a "reset password" email
request instead of setting a password directly.
Domain model
Sidus\UserBundle\Model\AdvancedUserInterface— extends Symfony'sPasswordAuthenticatedUserInterface/UserInterface/EquatableInterfacewith role/admin helpers. Implement this (or reuseEntity\User+Entity\RoleCollectionTrait) if you need a custom user entity.Sidus\UserBundle\Domain\Manager\UserManagerInterface— the single entry point for creating/persisting users, hashing passwords, and issuing password-reset requests (Infrastructure\Manager\UserManageris the Doctrine-backed implementation).Sidus\UserBundle\Model\AuthorableInterface— implement on any Doctrine entity to getcreatedBy/updatedByauto-populated from the current security token (Event\AuthorableSubscriber).Sidus\UserBundle\Model\Event\MailEvent— dispatched before every transactional email is sent; listen to it to add headers, attachments, or override recipients.
License
MIT — see LICENSE.
All versions of user-bundle with dependencies
symfony/dependency-injection Version >=6.3
symfony/http-foundation Version >=6.3
symfony/http-kernel Version >=6.3
symfony/security-core Version >=6.3
symfony/translation Version >=6.3
symfony/console Version >=6.3
symfony/uid Version >=6.3
symfony/validator Version >=6.3
symfony/options-resolver Version >=6.3
symfony/password-hasher Version >=6.3
symfony/messenger Version >=6.3
doctrine/orm Version >=2.9