<?php

class Log extends Module
{
  var $Dependencies = array('User');

  function NewRecord($Module, $Operation, $Value = '')
  {
    if(array_key_exists('User', $this->System->Modules) and 
      array_key_exists('Id', $this->System->Modules['User']->User))
      $UserId = $this->System->Modules['User']->User['Id'];
      else $UserId = NULL;
    $this->Database->insert('Log', array('Time' => 'NOW()', 
      'User' => $UserId, 'Module' => $Module, 
      'Operation' => $Operation, 'Value' => $Value, 'IPAddress' => $_SERVER['REMOTE_ADDR']));
  }

}
