Changeset 323 for trunk/global.php


Ignore:
Timestamp:
Nov 28, 2011, 8:50:09 AM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Zobrazovat ladící volby pouze podle filtru IP adres. Jako výchozí ip pro ladící informace lze použít 127.0.0.1(localhost). Do seznamu lze pak vložit další vzdálené adresy dle potřeby. Adresa by měla být jedinečná pro daný počítač.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/global.php

    r308 r323  
    11<?php
    22
    3 $ScriptTimeStart = GetMicrotime();
    4 
    5 // SQL injection hack protection
    6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
    7 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
    8 
    9 if(isset($_SERVER['REMOTE_ADDR'])) session_start();
    10 include('config.php');
    11 include('database.php');
     3$ConfigFileName = dirname(__FILE__).'/config.php';
     4     
     5if(file_exists($ConfigFileName)) include_once($ConfigFileName);
     6  else die('Nenalezen konfigurační soubor '.$ConfigFileName.'!');
     7include_once('database.php');
    128//include('error.php');
    139include_once('code.php');
    14 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
    15 $Database->Prefix = $Config['Database']['Prefix'];
    16 $Database->charset($Config['Database']['Charset']);
    1710include_once('module.php');
    1811include_once('forms.php');
    1912include_once('page.php');
    2013include_once('file.php');
    21 
     14include_once('log.php');
     15include_once('user.php');
     16include_once('aktuality/news.php');
     17include_once('webcam/webcam.php');
     18include_once('finance/bills.php');
     19include_once('finance/finance.php');
     20 
    2221$PrefixMultipliers = array
    2322(
     
    192191}
    193192
    194 $System = new System();
    195 $System->Config = $Config;
    196 $System->Database = &$Database;
    197 include_once('log.php');
    198 $System->AddModule(new Log());
    199 include_once('user.php');
    200 $System->AddModule(new User());
    201 if(isset($_SERVER['REMOTE_ADDR'])) $System->Modules['User']->Check();
    202 include_once('aktuality/news.php');
    203 $System->AddModule(new News());
    204 include_once('webcam/webcam.php');
    205 $System->AddModule(new Webcam());
    206 include_once('finance/bills.php');
    207 $System->AddModule(new Bill());
    208 include_once('finance/finance.php');
    209 $System->AddModule(new Finance());
    210 $System->Modules['Finance']->LoadMonthParameters(0);
     193function GlobalInit()
     194{
     195  global $Config, $Database, $System, $ScriptTimeStart, $ConfigFileName;
     196 
     197  $ScriptTimeStart = GetMicrotime();
     198  // SQL injection hack protection
     199  foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
     200  foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
     201
     202  if(isset($_SERVER['REMOTE_ADDR'])) session_start();
     203
     204  $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
     205  $Database->Prefix = $Config['Database']['Prefix'];
     206  $Database->charset($Config['Database']['Charset']);
     207  $Database->ShowSQLError = $Config['Web']['ShowSQLError'];
     208  $Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
     209
     210  $System = new System();
     211  $System->Config = $Config;
     212  $System->Database = &$Database;
     213  $System->AddModule(new Log());
     214  $System->AddModule(new User());
     215  if(isset($_SERVER['REMOTE_ADDR'])) $System->Modules['User']->Check();
     216  $System->AddModule(new News());
     217  $System->AddModule(new Webcam());
     218  $System->AddModule(new Bill());
     219  $System->AddModule(new Finance());
     220  $System->Modules['Finance']->LoadMonthParameters(0);
     221}
    211222
    212223$MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec');
     
    506517}
    507518
     519GlobalInit();
     520
    508521?>
Note: See TracChangeset for help on using the changeset viewer.