Changeset 323 for trunk/global.php
- Timestamp:
- Nov 28, 2011, 8:50:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/global.php
r308 r323 1 1 <?php 2 2 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 5 if(file_exists($ConfigFileName)) include_once($ConfigFileName); 6 else die('Nenalezen konfigurační soubor '.$ConfigFileName.'!'); 7 include_once('database.php'); 12 8 //include('error.php'); 13 9 include_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']);17 10 include_once('module.php'); 18 11 include_once('forms.php'); 19 12 include_once('page.php'); 20 13 include_once('file.php'); 21 14 include_once('log.php'); 15 include_once('user.php'); 16 include_once('aktuality/news.php'); 17 include_once('webcam/webcam.php'); 18 include_once('finance/bills.php'); 19 include_once('finance/finance.php'); 20 22 21 $PrefixMultipliers = array 23 22 ( … … 192 191 } 193 192 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); 193 function 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 } 211 222 212 223 $MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'); … … 506 517 } 507 518 519 GlobalInit(); 520 508 521 ?>
Note:
See TracChangeset
for help on using the changeset viewer.