Download the PHP package andri-sudarmawijaya/smartyacl without Composer
On this page you can find all versions of the php package andri-sudarmawijaya/smartyacl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andri-sudarmawijaya/smartyacl
More information about andri-sudarmawijaya/smartyacl
Files in andri-sudarmawijaya/smartyacl
Package smartyacl
Short Description Lightweight Auth System with ACL for CodeIgniter 3
License MIT
Informations about the package smartyacl
Smarty ACL
SmartyACL is a library with basic authentication and authorization functions for Codeigniter 3. This library was based on Ion Auth but with the addition of ACL / RBAC and some other features.
Features
- Register
- Register admin or user
- Send mail verification (optional)
- Login
- Single or Multi login(email, username or both)
- Limit max attempts
- Remember me
- Checks account status(inactive or banned) (optional)
- Check mail verification (optional)
- Forgot Password
- Send reset password mail
- Reset Password
- Validate security code and update user email/password
- Roles
- Create, update, delete
- Assign module permissions
- Modules
- Create, update and delete
- Admin Group - Users with role/permission access
- User Group - Common users without role/permission access
- Cache data to improve performance (optional)
Summary
- Requirements
- Demo
- Installation
- Default Login
- Usage
- Contributing
- Support
- References
Requirements
- Codeigniter 3 (developed on 3.1.11)
- PHP 7.x (developed on 7.3)
Demo
Download a demo application here
Installation
- Download latest released version
-
Put SmartyAcl folder on
application/third_party
directory or install using composer -
Add to
$autoload['packages']
¹ inapplication/config/autoload.php
- Import DB tables using migration or database.sql file
- Config library preferences on
application/third_party/SmartyAcl/config/smarty_acl.php
¹ Alternatively, you can copy the contents of the SmartyAcl folder to the respective directories in the application folder and load the library directly into the controller using $this->load->library('smarty_acl');
Default Login
Username: admin
Password: 123456
Usage
Methods List
Method | Description |
---|---|
register() | Register a new Admin User |
register_user() | Register a new User |
login() | User or Admin Login |
activate() | Activate admin user with code(email) |
activate_user() | Activate user with code(email) |
resend_activation() | Resend email confirmation code (admin/user) |
forgotten_password() | Send reset password email (admin/user) |
forgotten_password_check() | Validate forgotten password code (admin/user) |
reset_password() | Reset email and password (admin/user) |
logged_in() | Check if user is logged in (admin/user) |
logout() | Logout current logged in user (admin/user) |
roles() | Get roles list |
role() | Get single role |
create_role() | Create a new Role |
update_role() | Update a single Role |
delete_role() | Delete a single Role |
modules() | Get modules list |
module() | Get single module |
create_module() | Create a new Module |
update_module() | Update a single Module |
delete_module() | Delete a single Module |
module_permissions() | Get a single Module Permissions |
authorized() | Check if logged in user is authorized to access current module |
module_authorized() | Check if logged in user has permission to a specific module |
authorized_action() | Check if logged in user has permission to current module action method |
has_permission() | Check if logged in user has permission to a specific module action method |
admins() | Get admins |
users() | Get users |
get_user() | Get a single user |
get_admin() | Get a single admin |
update_user() | Update a single user (admin/user) |
delete_user() | Delete a single user (admin/user) |
set_delimiter() | Set delimiters for error messages |
errors() | Show error messages |
Register Admin
Call:
Responses:
Field | Required | Info |
---|---|---|
$identity | yes | field used to register/login user (username, email, phone, etc) |
$password | yes | user password |
yes | user email address | |
$additional_data | no | array with additional data(name, address, country, etc) (optional) |
$role_id | no | role id to assign(optional). If null, will use $config['default_role'] |
Register User
Call:
Responses:
Field | Required | Info |
---|---|---|
$identity | yes | field used to register/login user (username, email, phone, etc) |
$password | yes | user password |
yes | user email address | |
$additional_data | no | array with additional data(name, address, country, etc) (optional) |
Login
Call:
Response:
Field | Required | Info |
---|---|---|
$identity | yes | field used to register/login user (username, email, phone, etc) |
$password | yes | user password |
$admin | no (default TRUE) | (bool) set FALSE to user login |
Activate Admin or user
Call:
Response:
Field | Required | Info |
---|---|---|
$user_id | yes | User ID |
$code | yes | Activation Security Code |
Resend Activation Mail
Call:
Response:
Field | Required | Info |
---|---|---|
yes | User email address | |
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Forgotten Password
Call:
Response:
Field | Required | Info |
---|---|---|
yes | User email address | |
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Forgotten Password Check
Call:
Response:
Field | Required | Info |
---|---|---|
$code | yes | Secret Code |
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Reset Password
Call:
Response:
Field | Required | Info |
---|---|---|
$user | yes | Array with current user data(from forgotten_password_check()) |
yes | New email address | |
$password | yes | New password |
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Logged in
Call:
Response:
Field | Required | Info |
---|---|---|
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Logout
Call:
Response:
Field | Required | Info |
---|---|---|
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Get Roles
Call:
Response:
Field | Required | Info |
---|---|---|
$result | no (default TRUE) | (bool) set FALSE to return array |
Create Role
Call:
Response:
Field | Required | Info |
---|---|---|
$data | yes | array with role fields/values |
Get Role
Call:
Response:
Field | Required | Info |
---|---|---|
$role_id | yes | Role ID |
Update Role
Call:
Response:
Field | Required | Info |
---|---|---|
$role_id | yes | Role ID |
$data | yes | array with role fields/values |
Delete Role
Call:
Response:
Field | Required | Info |
---|---|---|
$role_id | yes | Role ID |
Get Modules
Call:
Response:
Field | Required | Info |
---|---|---|
$result | no (default TRUE) | (bool) set FALSE to return array |
Create Module
Call:
Response:
Field | Required | Info |
---|---|---|
$data | yes | array with module fields/values |
Get Module
Call:
Response:
Field | Required | Info |
---|---|---|
$role_id | yes | Role ID |
Update Module
Call:
Response:
Field | Required | Info |
---|---|---|
$role_id | yes | Role ID |
$data | yes | array with module fields/values |
Delete Module
Call:
Response:
Field | Required | Info |
---|---|---|
$role_id | yes | Role ID |
Get Module Permissions
Call:
Response:
Field | Required | Info |
---|---|---|
$role_id | yes | Role ID |
Authorized
Call:
Response:
Module Authorized
Call:
Response:
Field | Required | Info |
---|---|---|
$module | yes | Module Controller Name |
Authorized Module Action
Call:
Response:
Has Permission
Call:
Response:
Field | Required | Info |
---|---|---|
$permission | yes | Module Permission Name |
Get Admins
Call:
Response:
Field | Required | Info |
---|---|---|
$result | no (default TRUE) | (bool) set FALSE to return array |
Get Users
Call:
Response:
Field | Required | Info |
---|---|---|
$result | no (default TRUE) | (bool) set FALSE to return array |
Get User
Call:
Response:
Field | Required | Info |
---|---|---|
$user_id | yes | User ID |
Get Admin
Call:
Response:
Field | Required | Info |
---|---|---|
$user_id | yes | User ID |
Update User
Call:
Response:
Field | Required | Info |
---|---|---|
$data | yes | array with user fields/values |
$user_id | yes | User ID |
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Delete User
Call:
Response:
Field | Required | Info |
---|---|---|
$user_id | yes | User ID |
$admin | no (default TRUE) | (bool) set FALSE to use for users |
Errors Delimiters
Call:
Response:
Field | Required | Info |
---|---|---|
$start | yes | Start delimiter (<p>,<li>,<span> , etc) |
$end | yes | End delimiter (</p>,</li>,</span> , etc) |
Error Messages
Call:
Response:
Contributing
Feel free to contribute with corrections, optimizations or improvements. Just send a Pull Request with your contribution.
Support
If you found a bug, Create an Issue. If you're having an issue with CodeIgniter or for general help with development I recommend checking out the CodeIgniter Forums
References
- Ion Auth repository used as reference