<commit_before>ZfcUser
=======
Version 0.0.1 Created by <NAME> and the ZF-Commons team

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 easily to extend.

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
------------

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

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]
* Registration form protected with CAPTCHA [IN PROGRESS] \(Needs more options\)
* Robust event system to allow for extending [IN PROGRESS]
* Support for additional authentication mechanisms via plugins (Google,
  Facebook, LDAP, etc) [INCOMPLETE]
* Optional E-mail address verification [INCOMPLETE]
* Forgot Password [INCOMPLETE]
* Provide ActionController plugin and view helper [INCOMPLETE]

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

### Main Setup

1. Install the [ZfcBase](https://github.com/ZF-Commons/ZfcBase) ZF2 module
   by cloning it into `./vendor/` and enabling it in your
   `application.config.php` file.
2. Clone this project into your `./vendor/` directory and enable it in your
   `application.config.php` file.
3. Import the SQL schema located in `./vendor/ZfcUser/data/schema.sql`.
4. Copy `./vendor/ZfcUser/config/module.zfcuser.config.php.dist` to
   `./config/autoload/module.zfcuser.config.php`.

### Post-Install: Doctrine2 ORM

Coming soon...

### Post-Install: Doctrine2 MongoDB ODM

Coming soon...

### Post-Install: Zend\Db

1. If you do not already have a connection set up via DI, put the following
   in `./config/autoload/database.config.php`:

        <?php
        // ./config/autoload/database.config.php

        $mdb = array(
            'dbname' => 'CHANGEME',
            'user'   => 'CHANGEME',
            'pass'   => '<PASSWORD>',
            'host'   => 'CHANGEME',
        );

        /**
         * No need to edit below this line 
         */
        return array(
            'di' => array(
                'instance' => array(
                    'alias' => array(
                        'masterdb' => 'PDO',
                    ),
                    'masterdb' => array(
                        'parameters' => array(
                            'dsn'            => "mysql:dbname={$mdb['dbname']};host={$mdb['host']}",
                            'username'       => $mdb['user'],
                            'passwd'         => $<PASSWORD>['<PASSWORD>'],
                            'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''),
                        ),
                    ),
                    'Zend\Db\Adapter\Adapter' => array(
                        'parameters' => array(
                            'driver' => 'Zend\Db\Adapter\Driver\Pdo\Pdo',
                        ),
                    ),
                    'Zend\Db\Adapter\Driver\Pdo\Pdo' => array(
                        'parameters' => array(
                            'connection' => 'Zend\Db\Adapter\Driver\Pdo\Connection',
                        ),
                    ),
                    'Zend\Db\Adapter\Driver\Pdo\Connection' => array(
                        'parameters' => array(
                            'connectionInfo' => 'masterdb',
                        ),
                    ),
                ),
            ),
        );

2. Now, specify the DI alias for your connection in
   `./configs/autoload/module.zfcuser.config.php`, under the 'zend_db_adapter' setting.
   If you created the `./config/autoload/database.config.php` file in the
   previous step, the alias you'll specify is 'masterdb'.

Navigate to http://yourproject/user and you should land on a login page.

Password Security
-----------------<commit_msg>[#28] Revert phrase "connection" back to "PDO connection"<commit_after>ZfcUser
=======
Version 0.0.1 Created by <NAME> and the ZF-Commons team

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 easily to extend.

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
------------

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

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]
* Registration form protected with CAPTCHA [IN PROGRESS] \(Needs more options\)
* Robust event system to allow for extending [IN PROGRESS]
* Support for additional authentication mechanisms via plugins (Google,
  Facebook, LDAP, etc) [INCOMPLETE]
* Optional E-mail address verification [INCOMPLETE]
* Forgot Password [INCOMPLETE]
* Provide ActionController plugin and view helper [INCOMPLETE]

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

### Main Setup

1. Install the [ZfcBase](https://github.com/ZF-Commons/ZfcBase) ZF2 module
   by cloning it into `./vendor/` and enabling it in your
   `application.config.php` file.
2. Clone this project into your `./vendor/` directory and enable it in your
   `application.config.php` file.
3. Import the SQL schema located in `./vendor/ZfcUser/data/schema.sql`.
4. Copy `./vendor/ZfcUser/config/module.zfcuser.config.php.dist` to
   `./config/autoload/module.zfcuser.config.php`.

### Post-Install: Doctrine2 ORM

Coming soon...

### Post-Install: Doctrine2 MongoDB ODM

Coming soon...

### Post-Install: Zend\Db

1. If you do not already have a PDO connection set up via DI, put the following
   in `./config/autoload/database.config.php`:

        <?php
        // ./config/autoload/database.config.php

        $mdb = array(
            'dbname' => 'CHANGEME',
            'user'   => 'CHANGEME',
            'pass'   => '<PASSWORD>',
            'host'   => 'CHANGEME',
        );

        /**
         * No need to edit below this line 
         */
        return array(
            'di' => array(
                'instance' => array(
                    'alias' => array(
                        'masterdb' => 'PDO',
                    ),
                    'masterdb' => array(
                        'parameters' => array(
                            'dsn'            => "mysql:dbname={$mdb['dbname']};host={$mdb['host']}",
                            'username'       => $mdb['user'],
                            'passwd'         => $<PASSWORD>['<PASSWORD>'],
                            'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''),
                        ),
                    ),
                    'Zend\Db\Adapter\Adapter' => array(
                        'parameters' => array(
                            'driver' => 'Zend\Db\Adapter\Driver\Pdo\Pdo',
                        ),
                    ),
                    'Zend\Db\Adapter\Driver\Pdo\Pdo' => array(
                        'parameters' => array(
                            'connection' => 'Zend\Db\Adapter\Driver\Pdo\Connection',
                        ),
                    ),
                    'Zend\Db\Adapter\Driver\Pdo\Connection' => array(
                        'parameters' => array(
                            'connectionInfo' => 'masterdb',
                        ),
                    ),
                ),
            ),
        );

2. Now, specify the DI alias for your PDO connection in
   `./configs/autoload/module.zfcuser.config.php`, under the 'zend_db_adapter' setting.
   If you created the `./config/autoload/database.config.php` file in the
   previous step, the alias you'll specify is 'masterdb'.

Navigate to http://yourproject/user and you should land on a login page.

Password Security
-----------------
{'fraction_non_alphanumeric': 0.1298383666524883, 'fraction_numerical': 0.004466184602296895, 'mean_word_length': 1.9631379962192816, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 59, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5638184', 'n_tokens_mistral': 2682, 'n_tokens_neox': 2604, 'n_words': 775}