Ignore:
Timestamp:
Aug 20, 2013, 11:49:01 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: Install script didn't work.
  • Added: Log now also restore record request URL to database.
File:
1 edited

Legend:

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

    r566 r567  
    2424}
    2525
     26// Log types
     27define('LOG_TYPE_TRANSLATION', 1);
     28define('LOG_TYPE_DOWNLOAD', 2);
     29define('LOG_TYPE_USER', 3);
     30define('LOG_TYPE_MODERATOR', 4);
     31define('LOG_TYPE_ERROR', 10);
     32define('LOG_TYPE_IMPORT', 11);
     33define('LOG_TYPE_EXPORT', 12);
     34define('LOG_TYPE_CZWOW', 13);
     35define('LOG_TYPE_ADMINISTRATION', 14);
     36
     37// TODO: Change global function to module class local method 
    2638function WriteLog($Text, $Type)
    2739{
     
    3345        if(!is_null($User->Id)) $UserId = $User->Id;
    3446        else $UserId = 'NULL';
    35         $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP` )
    36         VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'")';
     47        $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` )
     48        VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'", "'.$_SERVER['REQUEST_URI'].'")';
    3749        $System->Database->query($Query);
    3850}
     
    137149      array('Name' => 'UserName', 'Title' => 'Uživatel'),
    138150      array('Name' => 'IP', 'Title' => 'Adresa'),
     151      array('Name' => 'URL', 'Title' => 'URL'),
    139152    );
    140153    $Order = GetOrderTableHeader($TableColumns, 'date', 1);
     
    153166      '<td><span style="color: '.$Line['LogColor'].'">'.$Line['Text'].'</span></td>'.
    154167      '<td><a href="user.php?user='.$Line['User'].'">'.$Line['UserName'].'</a></td>'.
    155       '<td>'.$Line['IP'].'</td></tr>';
     168      '<td>'.$Line['IP'].'</td>'.
     169          '<td>'.$Line['URL'].'</td></tr>';
    156170    }
    157171    $Output .= '</table>'.
Note: See TracChangeset for help on using the changeset viewer.