Changeset 567


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.
Location:
trunk
Files:
5 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>'.
  • trunk/admin/UpdateTrace.php

    r553 r567  
    25672567}
    25682568
     2569function UpdateTo567($Manager)
     2570{
     2571  $Manager->Execute('ALTER TABLE `Log` ADD `URL` VARCHAR( 255 ) NOT NULL ;');
     2572}
     2573
    25692574$Updates = array(
    25702575        498 => array('Revision' => 506, 'Function' => 'UpdateTo506'),
     
    25742579        537 => array('Revision' => 539, 'Function' => 'UpdateTo539'),
    25752580        539 => array('Revision' => 543, 'Function' => 'UpdateTo543'),
     2581        543 => array('Revision' => 567, 'Function' => 'UpdateTo567'),
    25762582);
  • trunk/admin/install.php

    r553 r567  
    22
    33include_once(dirname(__FILE__).'/../includes/Database.php');
     4include_once(dirname(__FILE__).'/../includes/AppModule.php');
    45include_once(dirname(__FILE__).'/../includes/system.php');
    56include_once(dirname(__FILE__).'/../includes/Update.php');
  • trunk/includes/Version.php

    r566 r567  
    11<?php
    22
    3 $Revision = 566; // Subversion revision
    4 $DatabaseRevision = 543; // Database structure revision
     3$Revision = 567; // Subversion revision
     4$DatabaseRevision = 567; // Database structure revision
    55$ReleaseTime = '2013-08-20';
  • trunk/includes/global.php

    r566 r567  
    135135}
    136136
    137 // Log types
    138 define('LOG_TYPE_TRANSLATION', 1);
    139 define('LOG_TYPE_DOWNLOAD', 2);
    140 define('LOG_TYPE_USER', 3);
    141 define('LOG_TYPE_MODERATOR', 4);
    142 define('LOG_TYPE_ERROR', 10);
    143 define('LOG_TYPE_IMPORT', 11);
    144 define('LOG_TYPE_EXPORT', 12);
    145 define('LOG_TYPE_CZWOW', 13);
    146 define('LOG_TYPE_ADMINISTRATION', 14);
    147 
    148 
    149137function utf2ascii($text)
    150138{
Note: See TracChangeset for help on using the changeset viewer.