Audit Login

Each audit entry records IP, file, line and the date and time of each entry automatically. LINE has to be pased into the function to determine the line of the file on which it is called. The only other required field is the audit text itself.

Parameters
  • $logtext The text to log (required)
  • $line The line on the file from which the log is recorded (required)
  • $users_id The ID of the user logged in when generating the entry (optional, default 0)
  • $portals_id The ID of the portal generating the entry (optional, default 0)
  • $projects_id The ID of the portal generating the entry (optional, default 0)
  • $pages_id The ID of the portal page generating the entry (optional, default 0)

Examples:

/**********************************************************************
 * Minimum usage example
 **********************************************************************/

$logtext = "Enter audit text";
auditlog($logtext,__LINE__);

/**********************************************************************
 * Passes a user ID
 **********************************************************************/

$logtext = "Enter audit text";
auditlog($logtext,__LINE__,$users_id);

/**********************************************************************
 * Passes a user ID  and portals ID
 **********************************************************************/

$logtext = "Enter audit text";
auditlog($logtext,__LINE__,$users_id,$portals_id);

/**********************************************************************
 * Passes a user ID  and pages ID
 **********************************************************************/

$logtext = "Enter audit text";
auditlog($logtext,__LINE__,$users_id,0,0,$pages_id);



Programmer Notes