Changeset 589


Ignore:
Timestamp:
Nov 18, 2013, 10:32:30 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: If referenced unknown subpage then show main page with error message and log event.
Location:
trunk
Files:
4 edited

Legend:

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

    r587 r589  
    3636          else $IP = addslashes($_SERVER['REMOTE_ADDR']);
    3737       
    38         if(!is_null($this->System->User->Id)) $UserId = $this->System->User->Id;
     38        if(isset($User) and !is_null($this->System->User->Id)) $UserId = $this->System->User->Id;
    3939          else $UserId = 'NULL';
    4040        $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '.
     
    6363          else $IP = addslashes($_SERVER['REMOTE_ADDR']);
    6464
    65         if(!is_null($User->Id)) $UserId = $User->Id;
     65        if(isset($User) and !is_null($User->Id)) $UserId = $User->Id;
    6666          else $UserId = 'NULL';
    6767        $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '.
  • trunk/includes/Version.php

    r588 r589  
    11<?php
    22
    3 $Revision = 588; // Subversion revision
     3$Revision = 589; // Subversion revision
    44$DatabaseRevision = 585; // Database structure revision
    55$ReleaseTime = '2013-11-18';
  • trunk/includes/global.php

    r586 r589  
    4949        }
    5050}
     51
    5152function ShowPage($Content)
    5253{
     
    6061        $System->ShowPage();
    6162}
    62 
    6363
    6464function GetMicrotime()
  • trunk/includes/system.php

    r584 r589  
    190190        array_shift($PathItems);
    191191        return($this->SearchPage($PathItems, $Pages[$PathItem]));
    192       } else return($Pages[$PathItem]);
     192      } else
     193      {
     194        if(count($PathItems) == 1) return($Pages[$PathItem]);           
     195          else return(''); // Unexpected subpages
     196      }
    193197    } else return('');
    194198  }
     
    196200  function PageNotFound()
    197201  {
     202        if(isset($this->ModuleManager->Modules['Log']))
     203          $this->ModuleManager->Modules['Log']->WriteLog('Stránka "'.
     204          implode('/', $this->PathItems).'" nenalezena', LOG_TYPE_ERROR);
    198205    return(ShowMessage('Stránka "'.implode('/', $this->PathItems).'" nenalezena.', MESSAGE_CRITICAL));
    199206  }
     
    202209  {
    203210    /* @var $Page Page */
    204     $ClassName = $this->SearchPage($this->PathItems, $this->Pages);     
     211    $ClassName = $this->SearchPage($this->PathItems, $this->Pages);
    205212    if($ClassName != '')
    206213    {
Note: See TracChangeset for help on using the changeset viewer.