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: 29 days 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: main
- Last Pushed: 2024-11-19T08:09:03.000Z (6 months ago)
- Last Synced: 2025-04-16T13:35:01.192Z (about 1 month ago)
- Topics: audit-log, audit-trail, auditing, codeigniter, php, user-audit-trail
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 16
- Watchers: 3
- Forks: 13
- Open Issues: 7
-
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..