PHPackages                             playground/user - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. playground/user

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

playground/user
===============

Module user

6.0.2(3y ago)18.6k64MITPHPPHP &gt;=7.3.0

Since Nov 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/gregorybesson/PlaygroundUser)[ Packagist](https://packagist.org/packages/playground/user)[ Docs](https://github.com/gregorybesson/PlaygroundUser)[ RSS](/packages/playground-user/feed)WikiDiscussions develop Synced 4d ago

READMEChangelog (10)Dependencies (9)Versions (109)Used By (4)

PlaygroundUser
==============

[](#playgrounduser)

[![Develop Branch Build Status](https://camo.githubusercontent.com/b8c25a2fb015fe1f36af552550b72f5271f7c8234ba116193029e04d9e22e816/68747470733a2f2f7472617669732d63692e6f72672f677265676f7279626573736f6e2f506c617967726f756e64557365722e737667)](http://travis-ci.org/gregorybesson/PlaygroundUser)

\#Introduction

Ce module étend LmcUser qui permet de nombreuses fonctionnalités liées à la gestion d'un compte client.

Le fonctionnalités apportées par PgUser sont :

- Gestion des autorisations via BjyAuthorize
- Mot de passe oublié
- Activation de compte par mail
- Remember me
- Gestion d'un avatar
- Authentification Facebook (basée sur HybridAuth)
- Login via Ajax
- Gestion de son profil par lutilisateur
- Gestion des comptes en back-office
- Blocage de son compte (== soft delete)

\#Installation

Utilisation de Doctrine
-----------------------

[](#utilisation-de-doctrine)

Se positionner via shell dans le répertoire vendor/doctrine/doctrine-module/bin.

La commande php doctrine-module.php orm:schema-tool:create permet d'installer les tables de ce module dans la base de données

La commande php doctrine-module.php data-fixture:import --append permet d'installer les rôles 'user' et 'admin' ainsi que l'utilisateur '' (mot de passe 'admin') avec les droits d'administration.

\#Extending PgUser

Use your own User entity
------------------------

[](#use-your-own-user-entity)

If you want to use your own entity :

1. Change the value of 'user\_entity\_class' in the lmcuser.global.php file.

    ```
     'user_entity_class' => 'MyUser\Entity\User',

    ```
2. Put your doctrine definition in your module.config.php Module (the one extending the user entity)

    ```
     'doctrine' => array(
     'driver' => array(
     	'lmcuser_entity' => array(
     		'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
     		'cache' => 'array',
     		'paths' => __DIR__ . '/../src/MyUser/Entity'
     	),

     	'orm_default' => array(
     		'drivers' => array(
     		    'MyUser\Entity'  => 'lmcuser_entity'
     		)
     	)
     )
     ),

    ```
3. Create your entity (using the doctrine annotation) in your Module. You'll have to implement the interface PgUser\\Entity\\UserInterface (see below for the explanation)

    ```
     class User implements \PgUser\Entity\UserInterface, ProviderInterface, InputFilterAwareInterface

    ```
4. The entities of other Adfab modules which need to link PgUser entity base the relationship on an interface : PgUser\\Entity\\UserInterface. So that, in case you extend the User entity, you can replace this relationship easily. To be able to do that, your user entity needs to implement PgUser\\Entity\\UserInterface. And in your Module.php onBootstrap method, You have then to use the doctrine listener feature to replace the interface with the correct class

    ```
     public function onBootstrap($e)
     {
     $sm = $e->getApplication()->getServiceManager();
     $doctrine = $sm->get('application_doctrine_em');
     $evm = $doctrine->getEventManager();

     $listener = new  \Doctrine\ORM\Tools\ResolveTargetEntityListener();
     $listener->addResolveTargetEntity(
     	'PgUser\Entity\UserInterface',
     	'MyUser\Entity\User',
     	array()
     );
     $evm->addEventListener(\Doctrine\ORM\Events::loadClassMetadata, $listener);
     }

    ```

**BEWARE : Your Module extending the entity must be placed after the other modules that have a link to the entity extended in application.config.php**

Use your own Form
-----------------

[](#use-your-own-form)

If you want to change the ChangeInfo Form for example (ie. you want to add a 'children' select list to persist in your user database table). First extend the entity as explained previously. Then :

1. Create the Form class in your Module, which extends the PgUser Form

    ```
     class ChangeInfo extends \PgUser\Form\ChangeInfo

    ```

    If you want to use the default fields of the PgUser Form, you can do this by using the parent constructor

    ```
      parent::__construct($name, $createOptions, $translator);

    ```

    And then you add the Form elements you want

    ```
     $this->add(array(
         'type' => 'Laminas\Form\Element\Select',
         'name' => 'children',
         'attributes' =>  array(
             'id' => 'children',
             'options' => array(
                 '0' => 0,
                 '1' => 1,
                 '2' => 2,
                 '3' => 3,
             ),
         ),
         'options' => array(
             'empty_option' => $translator->translate('Select', 'pguser'),
             'label' => $translator->translate('Children', 'pguser'),
         ),
     ));

    ```
2. Declare your Form in your Module.php factories definition by reusing the same form name used in PgUser (as your module is loaded after PgUser, your definition will be taken instead of the PgUser definition)

    ```
     public function getServiceConfig()
     {
     return array(
     	'factories' => array(
     		'pguser_change_info_form' => function($sm) {
     			$translator = $sm->get('MvcTranslator');
     			$options = $sm->get('pguser_module_options');
     			$form = new Form\ChangeInfo(null, $options, $translator);
     			return $form;
     		},
     	)
     );
     }

    ```

Use your own User controller
----------------------------

[](#use-your-own-user-controller)

If you want to add an action or modify an existing one.

1. Create the controller in your Module (extend the PgUser one if you want to use its methods)

    ```
     class UserController extends \PgUser\Controller\Frontend\UserController
     {
         public function profileAction ()
         {
             ...
         }
     }

    ```
2. Define your controller and associate the route with your controller in your module.config.php file. Don't forget to define the view name and adjust the core layout definition if you need to

    ```
     'core_layout' => array(
     'MyUser' => array(
     	'default_layout' => 'layout/2columns-left',
     	'children_views' => array(
     	'col_left'  => 'adfab-user/layout/col-user.phtml',
     ),
     ),
     ),
     'controllers' => array(
     'invokables' => array(
     	'myuser_user'    => 'MyUser\Controller\UserController',
     ),
     ),
     'router' => array(
     'routes' => array(
     	'lmcuser' => array(
     		'child_routes' => array(
     			'profile' => array(
     				'type' => 'Laminas\Router\Http\Literal',
     				'options' => array(
     					'route' => '/mes-coordonnees',
     					'defaults' => array(
     						'controller' => 'myuser_user',
     						'action'     => 'profile',
     					),
     				),
     			),
     		),
     	),
     ),
     ),
     'view_manager' => array(
     'template_path_stack' => array(
         'pguser' => __DIR__ . '/../view',
     ),
     'template_map' => array(
         'adfab-user/header/login.phtml' => __DIR__ . '/../view/adfab-user/frontend/header/login.phtml',
         'my-user/user/profile'       => __DIR__ . '/../view/adfab-user/frontend/account/profile.phtml',
     ),
     ),

    ```
3. You'll have to declare this new controller to bjyauthorize.global.php

    ```
     'guards' => array(
         'BjyAuthorize\Guard\Controller' => array(
         	//Front Area
         	array('controller' => 'myuser_user', 'roles' => array('guest', 'user')),

    ```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 94.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~268 days

Total

107

Last Release

1429d ago

Major Versions

1.2.0 → 2.0.02014-08-23

2.6.19 → 3.0.02018-03-14

3.1.0 → 4.0.02018-06-20

4.9.5 → 5.0.02021-06-26

5.0.0 → 6.0.02022-06-08

PHP version history (3 changes)1.1.1PHP &gt;=5.3.3

2.3.0PHP &gt;=5.5.0

5.0.0PHP &gt;=7.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/53dfe6859d871262a06bcfdc5607c9c48c79bb1d52426bfc00bf0d0f2b464a99?d=identicon)[gregorybesson](/maintainers/gregorybesson)

---

Top Contributors

[![gregorybesson](https://avatars.githubusercontent.com/u/2585805?v=4)](https://github.com/gregorybesson "gregorybesson (254 commits)")[![guillaumedeplanque](https://avatars.githubusercontent.com/u/5496682?v=4)](https://github.com/guillaumedeplanque "guillaumedeplanque (7 commits)")[![coralienoulette](https://avatars.githubusercontent.com/u/5680769?v=4)](https://github.com/coralienoulette "coralienoulette (5 commits)")[![bruweb](https://avatars.githubusercontent.com/u/4990989?v=4)](https://github.com/bruweb "bruweb (1 commits)")[![fozeek](https://avatars.githubusercontent.com/u/1671274?v=4)](https://github.com/fozeek "fozeek (1 commits)")

---

Tags

laminasuserplayground

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/playground-user/health.svg)

```
[![Health](https://phpackages.com/badges/playground-user/health.svg)](https://phpackages.com/packages/playground-user)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[laminas/laminas-permissions-acl

Provides a lightweight and flexible access control list (ACL) implementation for privileges management

3212.3M81](/packages/laminas-laminas-permissions-acl)[saeven/zf3-circlical-user

Complete user entity, rights, and access module for Laminas

3718.7k](/packages/saeven-zf3-circlical-user)[crada/phalcon-user-plugin

User plugin for Phalcon PHP framework

1832.5k1](/packages/crada-phalcon-user-plugin)[org_heigl/hybridauth

Lightweight Authentication Module for Zend-Framework 2 using the hybridauth-library

211.9k](/packages/org-heigl-hybridauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
