PHPackages                             zf-commons/zfc-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. zf-commons/zfc-user

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

zf-commons/zfc-user
===================

A generic user registration and authentication module for ZF2. Supports Zend\\Db and Doctrine2.

3.0.0(9y ago)4951.1M↓46%334[45 issues](https://github.com/ZF-Commons/ZfcUser/issues)[13 PRs](https://github.com/ZF-Commons/ZfcUser/pulls)20BSD-3-ClausePHPPHP ^5.5|^7.0CI failing

Since Feb 7Pushed 5y ago83 watchersCompare

[ Source](https://github.com/ZF-Commons/ZfcUser)[ Packagist](https://packagist.org/packages/zf-commons/zfc-user)[ Docs](https://github.com/ZF-Commons/ZfcUser)[ RSS](/packages/zf-commons-zfc-user/feed)WikiDiscussions 3.x Synced 1w ago

READMEChangelog (10)Dependencies (22)Versions (25)Used By (20)Security (1)

ZfcUser
=======

[](#zfcuser)

[![Build Status](https://camo.githubusercontent.com/fe823368bb7fff09018754c1724b385f8b648186e8a9075e9535c57c428d31d7/68747470733a2f2f7472617669732d63692e6f72672f5a462d436f6d6d6f6e732f5a6663557365722e706e67)](https://travis-ci.org/ZF-Commons/ZfcUser)[![Code Coverage](https://camo.githubusercontent.com/817e714fd61f29c4ab4ac17279dbdc50b294f07b86a58ad4ef702960c20430c6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5a462d436f6d6d6f6e732f5a6663557365722f6261646765732f636f7665726167652e706e673f733d37643539333263373762656136346134313761633865336461353164636136646131666362323265)](https://scrutinizer-ci.com/g/ZF-Commons/ZfcUser/)[![Latest Stable Version](https://camo.githubusercontent.com/f220fc339c9e17b0296d38f22d76b76f624d0ea618b290d73829f7dae499c19f/68747470733a2f2f706f7365722e707567782e6f72672f7a662d636f6d6d6f6e732f7a66632d757365722f762f737461626c652e706e67)](https://packagist.org/packages/zf-commons/zfc-user)[![Latest Unstable Version](https://camo.githubusercontent.com/c4d5d0eac905504152eb01be81502b3f65823d1f8d25327540924620a561af8e/68747470733a2f2f706f7365722e707567782e6f72672f7a662d636f6d6d6f6e732f7a66632d757365722f762f756e737461626c652e706e67)](https://packagist.org/packages/zf-commons/zfc-user)

Created by Evan Coury and the ZF-Commons team

Introduction
------------

[](#introduction)

ZfcUser is a user registration and authentication module for Zend Framework 2. Out of the box, ZfcUser works with Zend\\Db, however alternative storage adapter modules are available (see below). ZfcUser provides the foundations for adding user authentication and registration to your ZF2 site. It is designed to be very simple and easy to extend.

More information and examples are available on the [ZfcUser Wiki](https://github.com/ZF-Commons/ZfcUser/wiki)

Versions
--------

[](#versions)

Please use below table to figure out what version of ZfcUser you should use.

ZfcUser versionSupported Zend Framework versionStatus1.x&lt;= 2.5Security-fixes only2.x&gt;= 2.6 &lt; 3bug-fixes, security-fixes3.x&gt;= 3New features, bug-fixes, security-fixesStorage Adapter Modules
-----------------------

[](#storage-adapter-modules)

By default, ZfcUser ships with support for using Zend\\Db for persisting users. However, by installing an optional alternative storage adapter module, you can take advantage of other methods of persisting users:

- [ZfcUserDoctrineORM](https://github.com/ZF-Commons/ZfcUserDoctrineORM) - Doctrine2 ORM
- [ZfcUserDoctrineMongoODM](https://github.com/ZF-Commons/ZfcUserDoctrineMongoODM) - Doctrine2 MongoDB ODM

Requirements
------------

[](#requirements)

- [Zend Framework 2](https://github.com/zendframework/zf2) (latest master)
- [ZfcBase](https://github.com/ZF-Commons/ZfcBase) (latest master).

Features / Goals
----------------

[](#features--goals)

- Authenticate via username, email, or both (can opt out of the concept of username and use strictly email) \[COMPLETE\]
- User registration \[COMPLETE\]
- Forms protected against CSRF \[COMPLETE\]
- Out-of-the-box support for Doctrine2 *and* Zend\\Db \[COMPLETE\]
- Robust event system to allow for extending \[COMPLETE\]
- Provide ActionController plugin and view helper \[COMPLETE\]

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

[](#installation)

### Main Setup

[](#main-setup)

#### By cloning project

[](#by-cloning-project)

1. Install the [ZfcBase](https://github.com/ZF-Commons/ZfcBase) ZF2 module by cloning it into `./vendor/`.
2. Clone this project into your `./vendor/` directory.

#### With composer

[](#with-composer)

1. Add this project and [ZfcBase](https://github.com/ZF-Commons/ZfcBase) in your composer.json:

    ```
    "require": {
        "zf-commons/zfc-user": "^3.0"
    }
    ```
2. Now tell composer to download ZfcUser by running the command:

    ```
    $ php composer.phar update
    ```

#### Post installation

[](#post-installation)

1. Enabling it in your `application.config.php`file.

    ```
