<?php

  /*

      logs.php

      Contains some logging functions for ease of use.

      Changelog:
        2005-07-02 arne_sf: Replaced all instances of column name 'user' for table tbl_Logs with 'userid'
                         
        ## PAGE CONTAINS HANDYANDY MYSQL MODS ##
        ## Copyright (C) 2005 Andy Deakin (handyandy.org.uk) ##

      ----

      Copyright (C) 2003  Central Manchester CLC
      Copyright (C) 2003  David Thorne (davethorne@gmail.com)

      This program is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License
      as published by the Free Software Foundation version 2.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.

      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

  */
  
  if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__, '.php')) !== false) {
    header("location: index.php");
  }
  
  require_once "system/db.php";

  function makelog($id,$domain,$code,$log) {
    // Pervent problems with apostrophes/quotes in the log entry
    $log = addslashes($log);
    db_send("INSERT INTO tbl_Logs (userid,domain,timestamp,code,log) VALUES ($id,$domain," . time() . ",'$code','$log');");
  }

?>
