2017 © Pedro Peláez
 

symfony-bundle user-bundle

FOSUserBundle extension with admin for use with Symfony2

image

twinpeaks/user-bundle

FOSUserBundle extension with admin for use with Symfony2

  • Monday, April 7, 2014
  • by omarmilhouse
  • Repository
  • 3 Watchers
  • 1 Stars
  • 128 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

TPUserBundle

FOSUserBundle extension with admin gui, (*1)

Installation

Add TPUserBundle in your composer.json, TPUserBundle require also FOSUserBundle:, (*2)

{
    "require": {
        "friendsofsymfony/user-bundle": "~2.0@dev",
        "twinpeaks/user-bundle": "dev-master"
    }
}

Enable the bundle in the kernel:, (*3)

``` php // app/AppKernel.php, (*4)

public function registerBundles() { $bundles = array( // ... new FOS\UserBundle\FOSUserBundle(), new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(), new Twinpeaks\UserBundle\TPUserBundle(), ); }, (*5)


Configure your application's security.yml ``` yaml # app/config/security.yml security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_USER: ROLE_USER ROLE_ADMIN: [ROLE_USER] ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] providers: fos_userbundle: id: fos_user.user_provider.username in_memory: memory: users: user: { password: user, roles: [ 'ROLE_USER' ] } admin: { password: admin, roles: [ 'ROLE_ADMIN' ] } firewalls: main: pattern: ^/ form_login: #login_path: / provider: fos_userbundle csrf_provider: form.csrf_provider logout: true anonymous: true access_control: - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/admin, role: ROLE_ADMIN }

Configure the FOSUserBundle, (*6)

``` yaml, (*7)

app/config/config.yml

FOSUser Configuration

fos_user: db_driver: orm firewall_name: main user_class: Twinpeaks\UserBundle\Entity\User group: group_class: Twinpeaks\UserBundle\Entity\UserGroup, (*8)


Add TPUserBundle to assetic ``` yaml # app/config/config.yml bundles: [ "TPUserBundle" ]

Import routing files ``` yaml, (*9)

app/config/routing.yml

twinpeaks_user: resource: "@TPUserBundle/Resources/config/routing.xml" prefix: /admin, (*10)

fos_user_security: resource: "@FOSUserBundle/Resources/config/routing/security.xml", (*11)

fos_user_profile: resource: "@FOSUserBundle/Resources/config/routing/profile.xml" prefix: /profile, (*12)

fos_user_register: resource: "@FOSUserBundle/Resources/config/routing/registration.xml" prefix: /register, (*13)

fos_user_resetting: resource: "@FOSUserBundle/Resources/config/routing/resetting.xml" prefix: /resetting, (*14)

fos_user_change_password: resource: "@FOSUserBundle/Resources/config/routing/change_password.xml" prefix: /profile, (*15)


Update the schema database ``` php #console php app/console doctrine:schema:update --force

Create user ``` php, (*16)

console

php app/console fos:user:create, (*17)


Promote user to SuperAdmin Create user ``` php #console php app/console fos:user:promote username ROLE_SUPER_ADMIN

The Versions

07/04 2014

dev-master

9999999-dev https://github.com/omarmilhouse/TPUserBundle

FOSUserBundle extension with admin for use with Symfony2

  Sources   Download

MIT

The Requires

 

by Omar Milini
by Mosè Raguzzini

bundle fos_user user_admin