Skip to content

Latest commit

 

History

History
92 lines (60 loc) · 3.44 KB

README.md

File metadata and controls

92 lines (60 loc) · 3.44 KB

CsnUser

Zend Framework 2 Module

What is CsnUser?

CsnUser is a Module for Authentication based on DoctrineORMModule

What exactly does CsnUser do?

CsnUser has been created with educational purposes to demonstrate how Authentication can be done. It is fully functional.

CsnUser module consists of:

  • Login with remember me
  • Registration with Captcha and Confirmation email
  • Forgotten password with confirmation email.

In addition, the passwords have two levels of protection - a dynamic and static salt.

What's the use again?

An alternative to ZfcUser with more functionality added.

Installation

  1. Installation via composer is supported, simply run: php composer.phar require coolcsn/csn-user:dev-master. The installed module is located in ./vendor/coolcsn/csn-user.

  2. Add CsnUser, DoctrineModule and DoctrineORMModule in your application configuration at: ./config/application.config.php. An example configuration may look like the following :

'modules' => array(
    'Application',
    'DoctrineModule',
    'DoctrineORMModule',
    'CsnUser'
)

Configuration

CsnUser requires setting up a Connection for Doctrine and a simple Mail configuration.

  1. Doctrine configuration example is located in ./vendor/coolcsn/csn-user/config/doctrineorm.local.php.dist. Move it to ./config/autoload/doctrineorm.local.php replacing the tokens.

  2. Mail Configuration example is located in ./vendor/coolcsn/csn-user/config/mail.config.local.php.dist. Move it to ./config/autoload/mail.config.local.php replacing the tokens.

  3. Import the SQL schema located in ./vendor/coolcsn/CsnUser/data/csnDatabase.sql (by using for example phpMyAdmin). Another option is to use the doctrine-module tool, but this way you will have to import sample Roles and Languages manually in your database.

Options

The CsnUser module has some options to allow you to quickly customize the basic functionality. After installing CsnUser, copy ./vendor/coolcsn/CsnUser/config/csnuser.global.php.dist to ./config/autoload/csnuser.global.php and change the values as desired.

The following options are available:

  • STATIC_SALT Constant string value, prepended to the password before hashing
  • login_redirect_route String value, name of a route in the application which the user will be redirected to after a successful login.
  • logout_redirect_route String value, name of a route in the application which the user will be redirected to after logging out.

When you finish Installation and Configuration

http://hostname/user - to view different options in CsnUser.

http://hostname/login - to Login in the system.

http://hostname/registration - to Register in the system.

http://hostname/forgotten-password - to receive a new password on your email.

Dependencies

This Module depends on the following Modules:

Recommends