itk-dev / user-management-bundle
User management made easier
Installs: 333
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 9
Type:symfony-bundle
Requires
- friendsofsymfony/user-bundle: ^2.1
- symfony/framework-bundle: ^4.0
- twig/twig: ^2.11
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- friendsoftwig/twigcs: ^3.1
- dev-master
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- dev-dependabot/composer/twig/twig-2.15.3
- dev-dependabot/composer/symfony/http-kernel-4.4.18
- dev-dependabot/composer/symfony/security-core-4.4.23
- dev-dependabot/composer/symfony/security-http-4.4.22
- dev-dependabot/composer/symfony/security-guard-4.4.23
- dev-dependabot/composer/symfony/var-exporter-4.4.4
- dev-dependabot/composer/symfony/mime-4.4.1
- dev-dependabot/composer/symfony/http-foundation-4.4.1
- dev-dependabot/composer/symfony/cache-4.3.9
This package is auto-updated.
Last update: 2024-10-29 05:47:05 UTC
README
Installation
composer config repositories.itk-dev/user-management-bundle vcs https://github.com/itk-dev/user-management-bundle composer require itk-dev/user-management-bundle:dev-master
Register the bundle in config/bundles.php
:
<?php return [ … ItkDev\UserManagementBundle\ItkDevUserManagementBundle::class => ['all' => true], ];
Configuration
Use bin/console config:dump-reference ItkDevUserManagementBundle
to see the
configuration reference.
Example
itk_dev_user_management: site_name: '%env(SITE_NAME)%' site_url: '%env(SITE_URL)%' sender: email: '%env(MAILER_EMAIL)%' name: '%env(MAILER_NAME)%' # Template for mails sent to new users user_created: subject: '{{ site_name }} – new user created' header: 'User created on {{ site_name }}' body: | <p style='margin: 0;'> You have been registered as user on {{ site_name }} with email address {{ user.email }}. </p> <p style='margin: 0;'> To get started, you have to choose a password. </p> <p style='margin: 0;'> After choosing a password, you can sign in with your email address ({{ user.email }}) and the choosen password. </p> button: text: 'Choose password' footer: '<p style="margin: 0;">Best regards,<br/> {{ site_name }}</p>' # Set to true to automatically notify users on creation. # Otherwise, use the `itk-dev:user-management:notify-users-created` console # command or call `UserManager::notifyUserCreated` to notify new users. notify_user_on_create: false
Configure FOSUserBundle and make sure to use the user manager from this bundle:
fos_user: … service: user_manager: ItkDev\UserManagementBundle\Doctrine\UserManager …
Commands
bin/console itk-dev:user-management:notify-users-created --help
Controller
For convenience, you can use
ItkDev\UserManagementBundle\Controller\UserController
in your EasyAdminBundle configuration:
easy_admin: entities: User: class: App\Entity\User controller: ItkDev\UserManagementBundle\Controller\UserController
User roles form type
When editing user roles, you can use
ItkDev\UserManagementBundle\Form\Type\UserRolesType
to get a list of roles in the role hierarchy (only roles reachable from
options.base_roles
, which defaults to [ROLE_ADMIN]
, are listed):
easy_admin: entities: User: … form: fields: … - property: roles type: ItkDev\UserManagementBundle\Form\Type\UserRolesType # Optionally, specify base roles: type_options: base_roles: [ROLE_ADMIN] # default