Download the PHP package unclexo/xo-user without Composer
On this page you can find all versions of the php package unclexo/xo-user. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download unclexo/xo-user
More information about unclexo/xo-user
Files in unclexo/xo-user
Package xo-user
Short Description A ZF2 module for user authentication and managing user sessions in database.
License MIT
Homepage https://github.com/unclexo/XOUser
Informations about the package xo-user
Introduction
XOUser is a skeleton module for user authentication and registration for Zend Framework 2. This is for making a user module very fast by extending its available functionality. XOUser stores session data in database. This is mainly a combination of Zend\Db, Zend\Session and Zend\Authentication for managing users persistently.
Version
Please use one of versions from below:
Supported Zend Framework version |
---|
>= 2.2.7 to <= 2.5.0 |
Features
- User login - authenticate via username or email (by specifying one of these two and changing that in other places).
- User registration.
- User change-password.
- Forms protected against CSRF.
Installation
Using composer:
-
In your project, use the following command on your terminal.
- Add this
XOUser
module name in yourapplication.config.php
file.
Database Config:
XOUser expects and assumes you have a valid database configuration under a top key named db
.
Database Tables:
XOUser expects two database tables named users
and session
for managing users and sessions respectively:
Session Config:
If you want to set custom configuration for handling session, you should do that under top key session_config
. If you do not already have a custom configuration for your session, put the following in ./config/module.config.php
:
Usage:
Use the following snippet of code in your controller method to manage login action. For more information, you should check the LoginController
's processAction
method.
Next up, just use this over and over again where you need:
Available Routes
Go to your site: http://yoursite.dev/auth and you should see a login page.
Login
Password Hash Caution
DO NOT CHANGE THE PASSWORD HASH SETTINGS FROM THEIR DEFAULTS unless you have fully understood exactly what and why you are doing!
ZF2 Components
The following ZF2 components are considerably used in XOUser module:
- Zend/Authentication
- Zend/Crypt
- Zend/Db
- Zend/Filter
- Zend/Form
- Zend/InputFilter
- Zend/Json
- Zend/ModuleManager
- Zend/Mvc
- Zend/ServiceManager
- Zend/Session
- Zend/Validator
- Zend/View
License
This ZF2 module released under MIT license.