Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/firoz-ahmad-likhon/codeigniter-audit-trail
CodeIgniter audit trail is a convenient way to track all users activities in the database.
https://github.com/firoz-ahmad-likhon/codeigniter-audit-trail
audit-log audit-trail auditing codeigniter php user-audit-trail
Last synced: 3 months ago
JSON representation
CodeIgniter audit trail is a convenient way to track all users activities in the database.
- Host: GitHub
- URL: https://github.com/firoz-ahmad-likhon/codeigniter-audit-trail
- Owner: firoz-ahmad-likhon
- License: mit
- Created: 2018-09-29T15:44:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-02T22:35:37.000Z (over 6 years ago)
- Last Synced: 2024-02-02T19:29:58.649Z (about 1 year ago)
- Topics: audit-log, audit-trail, auditing, codeigniter, php, user-audit-trail
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 14
- Watchers: 4
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# User Audit Trail #
It is an attempt to add user audit trail with CodeIgniter framework. I think it is a very convenient way to track user activities in the database.
### Installation ###
* Put all files into your projects directory respectively.
* Check config.php for$config['subclass_prefix']
this value. If it is not'MY_'
then renameMY_DB_mysqli_driver.php
andMY_Loader.php
to your value.
* To enable listening change set$config['audit_enable'] = TRUE
in config/the trail.php
* You can start/stop to record insert, update, delete. please read carefully the trail.phpNow you are ready to browse the application.
### Database Table ###
* Run the sql in your database.CREATE TABLE `user_audit_trails` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`event` enum('insert','update','delete') NOT NULL,
`table_name` varchar(128) NOT NULL,
`old_values` text,
`new_values` text NOT NULL,
`url` varchar(255) NOT NULL,
`name` varchar(128) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`user_agent` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `user_audit_trails`
ADD PRIMARY KEY (`id`);
ALTER TABLE `user_audit_trails`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
### Further Work ###Now it is your turn to make model and view for presenting the audit data. Happy coding..