PHPackages                             fbeen/userbundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fbeen/userbundle

ActiveSymfony-bundle

fbeen/userbundle
================

This Bundle adds complete user integration on top of the Symfony security bundle. It lets you register and manage users for your website and let the users login with or without providers such as Facebook or Google, edit their profiles, change or reset their passwords.

V1.0.8(8y ago)0941MITPHPPHP ^5.5.9|^7.0

Since Oct 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Fbeen/UserBundle)[ Packagist](https://packagist.org/packages/fbeen/userbundle)[ RSS](/packages/fbeen-userbundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (3)Versions (10)Used By (0)

FbeenUserBundle
===============

[](#fbeenuserbundle)

This Bundle adds complete user integration on top of the Symfony security bundle. It lets you register and manage users for your website and let the users login with or without providers such as Facebook or Google, edit their profiles, change or reset their passwords.

### Features include:

[](#features-include)

- Doctrine ORM database storage of your own user class
- Bootstrap ready pages and forms
- Login with traditional login form or with OAuth providers such as Facebook, Google or Twitter
- Login with just their mailaddress and password
- Registrate with or without email verification
- Registrate with or without admin approval
- Registrate with or without confirmation emails
- Show and edit profile (with or without password security)
- Change password
- Reset password
- Use your own User entity
- Use your own form types
- Configurable password constraints

Installation
------------

[](#installation)

Using composer:

1. Add `"fbeen/userbundle": "dev-master"` to the require section of your composer.json project file.

```
    "require": {
        ...
        "fbeen/userbundle": "dev-master"
    },

```

2. run composer update:

    $ composer update
3. Add the bundles to the app/AppKernel.php:

```
        $bundles = array(
            ...
            new Fbeen\MailerBundle\FbeenMailerBundle(),
            new Fbeen\UserBundle\FbeenUserBundle(),
        );

```

4. add routes to app/config/routing.yml

```
fbeen_user:
    resource: "@FbeenUserBundle/Resources/config/routing.yml"
    prefix:   /

```

5. Place a empty `{% block fbeen_user %}` in your twig layout there where the content should appear. Typically between the {% block body %} and the {% endblock %} tags.

```

        {% block title %}Welcome!{% endblock %}
        {% block stylesheets %}{% endblock %}

        {% block body %}
            {% block fbeen_user %}{% endblock %}
        {% endblock %}
        {% block javascripts %}{% endblock %}

```

6. Enable Translation in `app/config/config.yml`

```
parameters:
    locale: en

framework:
    translator:      { fallbacks: ["%locale%"] }

```

7. Configure `app/config/security.yml` like below:

```
security:

    encoders:
        AppBundle\Entity\User:
            algorithm: bcrypt
            cost: 12

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN

    providers:
        our_db_provider:
            entity:
                class: AppBundle: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: ~
            pattern:    ^/
            provider: our_db_provider
            form_login:
                login_path: /login
                check_path: /login_check
                csrf_token_generator: security.csrf.token_manager       # FOR SYMFONY 2.7 OR BELOW USE:   csrf_provider: security.csrf.token_manager
            logout:
                path:   /logout
                target: /

    access_control:
        # require ROLE_SUPER_ADMIN for /admin/app/user*
        - { path: ^/admin/app/user, roles: ROLE_SUPER_ADMIN }
        # require ROLE_ADMIN for /admin*
        - { path: ^/admin, roles: ROLE_ADMIN }

```

8. add an User entity to your AppBundle `src/AppBundle/Entity/User.php`

```
