Plugin used to manage authentifications easily on CakePhp 2.x
You need to clone the files into an "Authentification" directory in app/Plugin. Then, add this CakePlugin::load in the app bootstrap and active the plugin bootstrap:
CakePlugin::load('Authentification', array('routes' => true));
These new auth systems use a config instead of "users" table, just put users in bootstrap, the role is now mandatory:
Configure::write('Users', array (
'Authentification.SimpleForm' => array (
'username' => 'admin',
'password' => 'admin',
'role' => 'admin'
)
));
For example:
public $components = array(
'Authentification.Authentification' => array(
'authenticate' => array('Authentification.SimpleForm' => array('prefix' => 'admin')),
'loginRedirect' => array('controller' => 'posts', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'page', 'action' => 'index')
)
);
Prefix must match with the role of the user, here the SimpleForm method is used to connect the admin role to the admin section of the Web site.
It is possible to add a Basic connection on the entire site and still keep the Form one on the admin section:
public $components = array(
'Authentification.Authentification' => array(
'authenticate' => array(
'Authentification.SimpleBasic',
'Authentification.SimpleForm' => array('prefix' => 'admin')
)
)
);