Audit Log Installation

Information:

I have tried to make the installation as easy as possible.
However, with the certain knowledge that no matter how idiot proof you make something - nature will provide a better idiot, I feel I must add the following:
Despite the fact that I have used this installation procedure on 11 different applications built with appgini, I in NO way take ANY responsibility for mistakes in the code or that YOU might make - ALWAYS backup you files before attempting a major modification!

ATTENTION!!

Note 1. For the Search/Replace I used 'Notepad++' available here : Notepad++ Home Page

Note 2. I suggest that you wait till your application is ready to go to production before making these changes - although this is NOT essential - (with the proviso that you BACK UP YOUR FILES FIRST!)

Note 3. When it comes to the tedious task of doing the Search/Replace in the Hooks folder. I suggest that you copy the hook files ONLY for the tables you wish to monitor into a separate directory and then BACKUP that directory. I further suggest that you not include 'Lookup' tables.
This way, you can do it speedily using Notepad++'s Search/Replace facility 'Find in Files' and do them all in just six shots.

1. Create the Audit Log Table using the audit_tableSQL.sql file provided.


2. Copy and then Extract the auditlog_files.zip in your application root folder.

The zip file contain only 2 files:
'auditLog_functions.php' -> The functions that allow the audit log to work.
'admin/auditLog.php' -> A table (filterable and pageable) that will be added to the Admin Menu Options.

3. Essential File Modifications.

In 'admin/incHeader.php' - (Adds page to the Admin Menu Options.)

Do find for :


and replace with:


In 'application_root/config.php':

Add the following to the bottom of the file.


In 'application_root/lib.php':

Do find for :

and replace with:



4. The HOOKs folder. After you've read Note 3, above:

In the temp folder that contains the Hooks for the tables that you wish to monitor:

A. Do 'find in files' for : (Remember to set the correct directory!)

and replace with:

B. Do 'find in files' for :

and replace with:

C. Do 'find in files' for :

and replace with:

D. Do 'find in files' for :

and replace with:

E. Do 'find in files' for :

and replace with:

F. Do 'find in files' for :

and replace with:

Remember to copy the files from the temp directory created in Note 3 back to the original Hooks Folder!

Your Audit Log should now be working! and using this technique will allow you to keep other modifications made to the Hooks folder.
Yours, primitive_man
Discussions about this: Here