kematjaya / user-bundle
Installs: 2 303
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- doctrine/common: ^2.0|^3.0
- doctrine/doctrine-bundle: ^2.3
- doctrine/orm: ^2.8
- gregwar/captcha-bundle: ^2.1
- symfony/doctrine-bridge: ^5.3
- symfony/form: ^5.3
- symfony/framework-bundle: ^5.3
- symfony/http-foundation: ^5.3
- symfony/routing: ^5.3
- symfony/security-bundle: ^5.3
- symfony/security-core: ^5.3
- symfony/twig-bundle: ^5.3
- symfony/uid: ^5.3
- symfony/yaml: ^5.3
Requires (Dev)
- doctrine/doctrine-fixtures-bundle: ^3.3
- phpunit/phpunit: ^9.0
- symfony/browser-kit: ^5.3
- symfony/var-dumper: ^5.3
- dev-master
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.14
- 4.3.13
- 4.3.12
- 4.3.11
- 4.3.10
- 4.3.9
- 4.3.8
- 4.3.7
- 4.3.6
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0
- 1.3
- 1.2
- 1.0
This package is auto-updated.
Last update: 2024-11-12 17:06:20 UTC
README
- Install
composer require kematjaya/user-bundle
- Enable Bundle
add to config/bundles.php
Kematjaya\User\KmjUserBundle::class => ['all' => true]
- create file config/packages/kmj_user.yml
user: route: login: kmj_user_login login_success: ## ----- default redirect page ---- default: dashboard_index ## ----- if multiple redirect ---- roles: - { role: ROLE_USER, path: homepage } - { role: ROLE_SUPER_USER, path: backend_dashboard }
- update config/packages/security.yml
security: role_hierarchy: # kmj_user default rule is (ROLE_SUPER_USER, ROLE_ADMINISTRATOR, ROLE_USER) ROLE_ADMINISTRATOR: ROLE_USER ROLE_SUPER_USER: ROLE_ADMINISTRATOR password_hashers: Kematjaya\UserBundle\Entity\KmjUser: auto enable_authenticator_manager: true providers: app_user_provider: entity: class: Kematjaya\UserBundle\Entity\KmjUser property: username firewalls: main: logout: path: kmj_user_logout custom_authenticators: - Kematjaya\UserBundle\Security\FormLoginAuthenticator
- import route, update file config/routes/annotations.yaml
kmj_user: resource: '@UserBundle/Resources/config/routing/all.xml'
- create entity
// src/Entity/MyUser.php .. use Kematjaya\UserBundle\Entity\DefaultUser; ... class MyUser extends DefaultUser { /** * @ORM\Column(type="string", length=255, nullable=true) */ private $email; public function getEmail(): ?string { return $this->email; } public function setEmail(?string $email): self { $this->email = $email; return $this; } }
- update schema:
php bin/console doctrine:schema:update --force
- for insert demo user, then run on command :
then, use root and admin for login and password: admin123php bin/console doctrine:fixtures:load
- other route :
{{ path('kmj_user_user') }} {{ path('kmj_user_profile') }} // for profile user {{ path('kmj_user_change_password') }} // for open change password form {{ path('kmj_user_logout') }} // for logout
10, password form theme:
twig: form_themes: ## .... for bootstrap 3 - '@User/form/bootstrap_3_password.html.twig' ## .... for bootstrap 4 - '@User/form/bootstrap_4_password.html.twig'