Ignore:
Timestamp:
Sep 11, 2013, 10:37:54 PM (11 years ago)
Author:
chronos
Message:
  • Modified: Moved some code from global to system file. System class is now serving as main application class. Now old files which still use ShowPage function need system initialization with $InitSystem = true; before global.php inclusion.
  • Modified: Get rid of some global reference to $System, $Config and $User variables.
  • Modified: Search result functionality moved to application module from action.php file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Log/Log.php

    r569 r577  
    2626  function DoAddItem($Message)
    2727  {
    28         WriteLog($Message, LOG_TYPE_ERROR);
     28        $this->WriteLog($Message, LOG_TYPE_ERROR);
     29  }
     30
     31  function WriteLog($Text, $Type)
     32  {
     33        if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole';
     34          else $IP = addslashes($_SERVER['REMOTE_ADDR']);
     35       
     36        if(!is_null($this->System->User->Id)) $UserId = $this->System->User->Id;
     37          else $UserId = 'NULL';
     38        $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '.
     39                'VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'", "'.$_SERVER['REQUEST_URI'].'")';
     40        $this->System->Database->query($Query);
    2941  }
    3042}
Note: See TracChangeset for help on using the changeset viewer.