PHP code example of vladshish / usershell
1. Go to this page and download the library: Download vladshish/usershell library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vladshish / usershell example snippets
CakePlugin::load('UserShell');
### Configure
Configure::write('Groups', array(
'modelName' => 'Group',
'data' => array(
'admin' => array(
'id' => 1,
'name' => 'Administrators',
'status' => 0,
),
'member' => array(
'id' => 2,
'name' => 'Members',
'status' => 0,
)
),
'permissions' => array(
'admin' => array(
'id' => 1,
'deny' => [],
'allow' => [
'controllers',
],
),
'others' => array(
'id !=' => [1],
'deny' => array(
'controllers/users/index',
'controllers/users/edit',
'controllers/users/delete',
'controllers/users/create',
'controllers/groups',
),
'allow' => array(
'controllers',
)
),
),
));
Configure::write('Users', array(
'modelName' => 'User',
'data' => array(
'admin' => array(
'id' => 1,
'email' => '[email protected] ',
'password' => 'example',
'repead-password' => 'example',
'status' => 1,
'group_id' => 1,
),
),
'conditions' => array(
'status' => array(1, 2),
),
));
:: bootstrap.php ::