Changeset 600


Ignore:
Timestamp:
Nov 25, 2013, 9:48:38 PM (11 years ago)
Author:
chronos
Message:
  • Modified: Logged unknown pages have now separate log type to better distinguish from ordinal errors.
Location:
trunk
Files:
4 edited

Legend:

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

    r597 r600  
    5454define('LOG_TYPE_CZWOW', 13);
    5555define('LOG_TYPE_ADMINISTRATION', 14);
     56define('LOG_TYPE_PAGE_NOT_FOUND', 15);
    5657
    5758// TODO: Change global function to module class local method 
     
    193194      $PageList['Output'];
    194195      if($this->System->User->Licence(LICENCE_ADMIN))
    195         $Output .= '<div><a href="'.$this->System->Link('/log.php?a=delerrlog').'">Vymázání chybových záznamů</a></div>';     
     196      {
     197        $Output .= '<div>Vymazat: <a href="'.$this->System->Link('/log.php?a=delerrlog&amp;type='.LOG_TYPE_ERROR).'">Chybové záznamy</a> '.
     198          '<a href="'.$this->System->Link('/log.php?a=delerrlog&amp;type='.LOG_TYPE_PAGE_NOT_FOUND).'">Neznámé stránky</a></div>';
     199      }     
    196200    } else $Output .= ShowMessage('Nemáte oprávnění.', MESSAGE_CRITICAL);
    197201 
     
    201205  function DeleteErrorLog()
    202206  {
    203         if($this->System->User->Licence(LICENCE_ADMIN))
     207        if($this->System->User->Licence(LICENCE_ADMIN) and
     208        (($_GET['type'] == LOG_TYPE_ERROR) or ($_GET['type'] == LOG_TYPE_PAGE_NOT_FOUND)))
    204209        {
    205           $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR);
     210                $DbResult = $this->System->Database->select('LogType', '*', 'Id='.$_GET['type']);
     211                $LogType = $DbResult->fetch_assoc();
     212          $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Log` WHERE `Type`='.$_GET['type']);
    206213          $DbRow = $DbResult->fetch_row();
    207           $this->System->Database->query('DELETE FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR);
    208           $this->System->ModuleManager->Modules['Log']->WriteLog('Vymazány chybové záznamy', LOG_TYPE_ADMINISTRATION);
    209           $Output = ShowMessage('Smazáno všech '.$DbRow[0].' chybových záznamů.');
     214          $this->System->Database->query('DELETE FROM `Log` WHERE `Type`='.$_GET['type']);
     215          $this->System->ModuleManager->Modules['Log']->WriteLog('Vymazáno záznamů z '.$LogType['Description'].'.', LOG_TYPE_ADMINISTRATION);
     216          $Output = ShowMessage('Smazáno všech '.$DbRow[0].' záznamů z '.$LogType['Description'].'.');
    210217          $Output .= $this->ShowList();
    211218          return($Output);
  • trunk/admin/UpdateTrace.php

    r585 r600  
    25152515function UpdateTo510($Manager)
    25162516{     
    2517   global $System;
    2518  
    25192517  $Manager->Execute('ALTER TABLE `News` ADD `Title` VARCHAR( 255 ) NOT NULL AFTER `Time`');
    25202518  $Manager->Execute('UPDATE `News` SET `Title` = (SELECT `Name` FROM `User` AS `T` WHERE `T`.`ID` = `User`)');
     
    25232521function UpdateTo524($Manager)
    25242522{     
    2525   global $System;
    2526  
    25272523  $Manager->Execute('ALTER TABLE `User` ADD `PreferredVersion` INT NULL DEFAULT NULL');
    25282524  $Manager->Execute('ALTER TABLE `User` ADD INDEX ( `PreferredVersion` )');
     
    26132609}
    26142610
     2611function UpdateTo600($Manager)
     2612{
     2613        $Manager->Execute("INSERT INTO `LogType` (`Id` ,`Name` ,`Color` ,`Description`)
     2614VALUES (NULL , 'Nenalezené', 'teal', 'Nenalezené stránky');");
     2615}
     2616
    26152617$Updates = array(
    26162618        498 => array('Revision' => 506, 'Function' => 'UpdateTo506'),
     
    26232625        567 => array('Revision' => 574, 'Function' => 'UpdateTo574'),
    26242626        574 => array('Revision' => 585, 'Function' => 'UpdateTo585'),
     2627        585 => array('Revision' => 600, 'Function' => 'UpdateTo600'),
    26252628);
  • trunk/includes/Version.php

    r599 r600  
    66// and system will need database update.
    77
    8 $Revision = 599; // Subversion revision
    9 $DatabaseRevision = 585; // Database structure revision
     8$Revision = 600; // Subversion revision
     9$DatabaseRevision = 600; // Database structure revision
    1010$ReleaseTime = '2013-11-25';
  • trunk/includes/system.php

    r591 r600  
    207207        if(isset($this->ModuleManager->Modules['Log']))
    208208          $this->ModuleManager->Modules['Log']->WriteLog('Stránka "'.
    209           implode('/', $this->PathItems).'" nenalezena'.$Referer, LOG_TYPE_ERROR);
     209          implode('/', $this->PathItems).'" nenalezena'.$Referer, LOG_TYPE_PAGE_NOT_FOUND);
    210210    return(ShowMessage('Stránka "'.implode('/', $this->PathItems).'" nenalezena.', MESSAGE_CRITICAL));
    211211  }
Note: See TracChangeset for help on using the changeset viewer.