Ignore:
Timestamp:
Jul 13, 2009, 4:17:30 PM (15 years ago)
Author:
maron
Message:

Scrip pro importování z příkazové řádky

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global_function.php

    r241 r245  
    189189function WriteLog($Text, $Type)
    190190{
    191   global $Database, $Config;
     191  global $Database, $Config,$_SERVER;
    192192 
    193   $user = @$_SESSION['UserID'];
     193    if(!isset($_SERVER['REMOTE_ADDR']))
     194        {
     195      $user = 0;
     196          $ip = 'Konzole';
     197        } else {
     198      $user = @$_SESSION['UserID'];
     199          $ip = addslashes($_SERVER['REMOTE_ADDR']);
     200        }
     201
    194202  if($user == '') $user = 0;
    195203  $Database->SelectDatabase($Config['Database']['Database']);   
    196204  $Query = 'INSERT INTO `log` ( `user` , `type` , `text` , `date` , `IP` )
    197    VALUES ('.$user.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.addslashes($_SERVER['REMOTE_ADDR']).'")';
     205   VALUES ('.$user.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$ip.'")';
    198206  $Database->SQLCommand($Query);
    199207}
Note: See TracChangeset for help on using the changeset viewer.