foreverglory / user-bundle
Symfony UserBundle
Installs: 24
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- friendsofsymfony/user-bundle: v2.0.0-beta1
- knplabs/knp-paginator-bundle: ~2.5
- symfony/framework-bundle: ~2.3|~3.0
This package is not auto-updated.
Last update: 2024-12-21 20:57:37 UTC
README
UserBundle 基于 friendsofsymfony/user-bundle 进行整合管理用户 重写用户登陆、注册、资料 用户、用户组管理
介绍
Composer
添加 composer.json
到你的项目依赖
{ "foreverglory/user-bundle": "~0.1" }
Kernel
添加 Kernel
依赖,并启用 Bundle
//app/AppKernel.php public function registerBundles() { return array( // ... new FOS\UserBundle\FOSUserBundle(), new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(), new Glory\Bundle\UserBundle\GloryUserBundle(), // ... ); }
Configure
#app/config/config.yml fos_user: db_driver: orm # 对应 security.firewalls 值 firewall_name: main user_class: Glory\Bundle\UserBundle\Entity\User group: group_class: Glory\Bundle\UserBundle\Entity\Group # 更多配置,参考 `friendsofsymfony/user-bundle` glory_user: # 未实现
#app/config/routing.yml glory_user: resource: "@GloryUserBundle/Resources/config/routing.yml" prefix: / # 警告 不需要引用 `friendsofsymfony/user-bundle` 的路由配置
#app/config/security.yml security: encoders: Glory\Bundle\UserBundle\Model\UserInterface: sha256 providers: fos_user: id: fos_user.user_provider.username firewalls: # fos_user.firewall_name, hwi_oauth.firewall_name 对应值 main: pattern: /.* form_login: # 对应其中一个 security.providers provider: fos_user # 登录地址,不要修改 login_path: glory_user_login # 登录验证 check_path: glory_user_check #...more... remember_me: key: "%secret%" lifetime: 31536000 path: / domain: ~ logout: # 退出地址 path: glory_user_logout anonymous: true
Code
extends Glory\Bundle\UserBundle\Entity\User
extends Glory\Bundle\UserBundle\Entity\Group
More
todo: