Zend Framework 2 Module
CsnUser is a Module for Authentication based on DoctrineORMModule
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.
An alternative to ZfcUser with more functionality added.
-
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
. -
Add
CsnUser
,DoctrineModule
andDoctrineORMModule
in your application configuration at:./config/application.config.php
. An example configuration may look like the following :
'modules' => array(
'Application',
'DoctrineModule',
'DoctrineORMModule',
'CsnUser'
)
CsnUser requires setting up a Connection for Doctrine and a simple Mail configuration.
-
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. -
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. -
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.
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.
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.
This Module depends on the following Modules:
-
[DoctrineORMModule] (https://github.com/doctrine/DoctrineORMModule) - DoctrineORMModule integrates Doctrine 2 ORM with Zend Framework 2 quickly and easily.
-
coolcsn/CsnAuthorization - Authorization compatible for this Registration and Logging.
-
coolcsn/CsnNavigation - Navigation module;
-
coolcsn/CsnCms - Content management system;