This is a symfony bundle for user bundle.
========================
"repositories": [
{
"type": "package",
"package": {
"name": "dtw/user",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://bitbucket.org/dtw_apac_php/user_bundle.git",
"reference": "origin/master"
}
}
}
],
composer require dtw/user:dev-master
"Dtw\\UserBundle\\": "vendor/dtw/user/"
composer update
orm:
mappings:
User:
type: annotation
is_bundle: false
dir: %kernel.root_dir%/../vendor/dtw/user/Entity
prefix: Dtw\UserBundle\Entity
alias: User
php bin/console doctrine:schema:update --force
new Dtw\UserBundle\DtwUserBundle(),
dtw_user:
resource: "../vendor/dtw/user/Resources/config/routing.yml"
prefix: /user
security:
encoders:
Dtw\UserBundle\Entity\User:
algorithm: bcrypt
cost: 12
providers:
database_users:
entity:
class: Dtw\UserBundle\Entity\User
property: email
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
form_login:
login_path: dtw_user_login
check_path: dtw_user_login
default_target_path: dtw_user_index
always_use_default_target_path: true
logout:
path: dtw_user_logout
target: dtw_user_login
access_control:
- { path: ^/user/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/forgot-password, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/send-email, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/email-sent, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/resetpassword/, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/updatepassword/, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/registered/, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/, roles: ROLE_ADMIN }
access_denied_url: login
user_directory: '%kernel.project_dir%/web/uploads/images/users'
user-hover_directory: '%kernel.project_dir%/web/uploads/images/users/hover'
mailer_transport: smtp
mailer_host: smtp.gmail.com
mailer_user: <email>
mailer_password: <password>
mailer_user_name: <Email sender alias name>
mailer_port: 587
mailer_encryption: tls
========================
Now you can use the user bundle for add,show,update and delete a user. You can use also the login module.