PCCS MySQLDatabase Admin Tool version 1.3.4


/incs/ -> logging_function.php

1  <?php
2  // Filename logging_function.php
3  // Function - logs changes, that happen on the system
4  //
5  // This script was written after a security bug was released on bugtrak
6  // It allows you to log various actions to different files
7  //
8  // Todo: add support for email to mysql account
9  //
10  // updated 10-07-2000
11  // -- added changelog to this file
12  //
13 
14 
15 
16  $ip = $REMOTE_ADDR;
17  function log_this($action,$logfile_name) {
18  global $db_user, $ip;
19 
20          if(file_exists("logs/$logfile_name")) {
21           $logfile = fopen("logs/$logfile_name","a");
22           fputs($logfile,$ip.",".date("dS of F Y h:i:s A")."," . $db_user .",". $action ."\n");
23           fclose($logfile);
24          } else {
25          exec ("touch logs/$logfile_name");
26           $logfile = fopen("logs/$logfile_name","a");
27           fputs($logfile,$ip.",".date("dS of F Y h:i:s A")."," . $db_user .",". $action ."\n");
28           fclose($logfile);
29       }
30     }
31 
32 
33  ?>


Generated: Sat Jan 27 15:40:36 2001 Generated by PHPXref 0.1.2
PCCS-Linux.COM ::ource Advocate Articles catalogue
2000 2002