Changeset 78 for trunk/www/index.php
- Timestamp:
- Sep 11, 2009, 8:18:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/index.php
r77 r78 1 1 <?php 2 2 3 include('Include.php'); 4 if(array_key_exists('argv', $_SERVER)) 5 $_GET = array_merge($_GET, ParseCommandLineArgs($_SERVER['argv'])); 6 7 // SQL injection hack protection 8 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 9 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 10 11 if(isset($_SERVER['REMOTE_ADDR'])) session_start(); 12 13 $System = new System(); 14 $ScriptTimeStart = $System->GetMicrotime(); 15 $System->Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']); 16 $System->Database->Prefix = $Config['Database']['Prefix']; 17 $System->Database->charset($Config['Database']['Charset']); 18 $System->Config = $Config; 19 $System->AddModule(new Log($System)); 20 $System->AddModule(new User($System)); 21 $System->AddModule(new Permission($System)); 22 if(isset($_SERVER['REMOTE_ADDR'])) $System->Modules['User']->Check(); 23 else $System->Modules['User']->Data['Id'] = $Config['Web']['UserConsoleId']; 24 $System->Modules['Permission']->LoadForUser($System->Modules['User']->Data['Id']); 25 //print_r($System->Modules['Permission']->Data); 26 27 if(array_key_exists('Module', $_GET)) $Module = $_GET['Module']; 28 else $Module = 'HomePage'; 29 if(array_key_exists('Action', $_GET)) $Action = $_GET['Action']; 30 else $Action = 'Show'; 31 32 $ControllerName = $Module.'Controller'; 33 if(class_exists($ControllerName)) 34 { 35 $Controller = new $ControllerName($System); 36 if(method_exists($Controller, $Action)) $Output = $Controller->$Action(); 37 else $Output = 'Metoda '.$Action.' modulu '.$Module.' neexistuje.'; 38 } else $Output = 'Třída '.$ControllerName.' neexistuje.'; 39 40 echo($Output); 3 include_once(dirname(__FILE__).'/Application/Application.php'); 41 4 42 5 ?>
Note:
See TracChangeset
for help on using the changeset viewer.