This topic is locked

Record Auditing

5/15/2009 12:16:49 PM
PHPRunner General questions
I
incognito author

Does anyone know if PHPrunner has the capability to do auditing for record updates and logging IP address?
For example, if a certain record was updated by a registered user, we want to capture the username, the date and time of the update and the IP address from which the user has done the update.
This audit trail can be displayed as appended at the bottom of the record's page or as a child record.

N
nix386 5/15/2009

Does anyone know if PHPrunner has the capability to do auditing for record updates and logging IP address?

For example, if a certain record was updated by a registered user, we want to capture the username, the date and time of the update and the IP address from which the user has done the update.
This audit trail can be displayed as appended at the bottom of the record's page or as a child record.


Yes this is very easy to accomplish with PHPRunner, actually there is no coding involved at all...

I
incognito author 5/16/2009

Yes this is very easy to accomplish with PHPRunner, actually there is no coding involved at all...


Do you mind giving more details/tips as to how we can do this?

Thanks!

F
fantasmino 5/16/2009

Maybe u need this?

I have add this to know who was the last one to modify the record

add in your table fields: last_user and last_modify

in events before record added and before record update
$values["last_user"] = $_SESSION["UserID"];

$values["last_modify"] = now();
I'm a newbee with phprunner so maybe someone else can confirm if it's the best way

in my project works

I
incognito author 5/16/2009

Maybe u need this?

I have add this to know who was the last one to modify the record

add in your table fields: last_user and last_modify

in events before record added and before record update
$values["last_user"] = $_SESSION["UserID"];

$values["last_modify"] = now();
I'm a newbee with phprunner so maybe someone else can confirm if it's the best way

in my project works


Thanks Fantasmino...that will help and a good start but we still want to capture the IP address of the person who made the modification as part of the auditing.

F
fantasmino1 5/17/2009

try this:

add in your table fields: last_user , last_modify and last_userip

in events before record added and before record update
$values["last_user"] = $_SESSION["UserID"];

$values["last_modify"] = now();

$values["last_userip"] = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];