Changeset 92 for trunk/Application
- Timestamp:
- Apr 7, 2020, 11:53:58 AM (5 years ago)
- Location:
- trunk/Application
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Core.php
r84 r92 2 2 3 3 $ConfigFileName = dirname(__FILE__).'/../Config/Config.php'; 4 if (file_exists($ConfigFileName)) include_once($ConfigFileName);4 if (file_exists($ConfigFileName)) include_once($ConfigFileName); 5 5 6 6 include_once(dirname(__FILE__).'/../Global.php'); … … 24 24 $this->ShowPage = true; 25 25 $this->BaseURL = $_SERVER['SCRIPT_NAME']; 26 if (substr($this->BaseURL, -10, 10) == '/index.php')26 if (substr($this->BaseURL, -10, 10) == '/index.php') 27 27 $this->BaseURL = substr($this->BaseURL, 0, -10); 28 28 } … … 32 32 global $Config, $DatabaseRevision, $WithoutSessionStart; 33 33 34 if ($this->UseSession) session_start();34 if ($this->UseSession) session_start(); 35 35 36 36 $ErrorHandler = new ErrorHandler(); … … 50 50 51 51 // SQL injection hack protection 52 foreach ($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);53 foreach ($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);52 foreach ($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 53 foreach ($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 54 54 55 55 $this->Config = &$Config; … … 58 58 $this->Setup = new Setup($this); 59 59 $this->Setup->Start(); 60 if ($this->Setup->CheckState())60 if ($this->Setup->CheckState()) 61 61 { 62 62 $this->ModuleManager->Start(); … … 67 67 { 68 68 $this->RunCommon(); 69 if ($this->ShowPage)69 if ($this->ShowPage) 70 70 { 71 71 $this->PathItems = ProcessURL(); … … 80 80 /* @var $Page Page */ 81 81 $ClassName = $this->SearchPage($this->PathItems, $this->Pages); 82 if ($ClassName != '')82 if ($ClassName != '') 83 83 { 84 84 $Page = new $ClassName($this); … … 91 91 function RegisterPage($Path, $Handler) 92 92 { 93 if (is_array($Path))93 if (is_array($Path)) 94 94 { 95 95 $Page = &$this->Pages; 96 96 $LastKey = array_pop($Path); 97 foreach ($Path as $PathItem)97 foreach ($Path as $PathItem) 98 98 { 99 99 $Page = &$Page[$PathItem]; 100 100 } 101 if (!is_array($Page)) $Page = array('' => $Page);101 if (!is_array($Page)) $Page = array('' => $Page); 102 102 $Page[$LastKey] = $Handler; 103 103 } else $this->Pages[$Path] = $Handler; … … 111 111 function SearchPage($PathItems, $Pages) 112 112 { 113 if (count($PathItems) > 0) $PathItem = $PathItems[0];113 if (count($PathItems) > 0) $PathItem = $PathItems[0]; 114 114 else $PathItem = ''; 115 if (array_key_exists($PathItem, $Pages))115 if (array_key_exists($PathItem, $Pages)) 116 116 { 117 if (is_array($Pages[$PathItem]))117 if (is_array($Pages[$PathItem])) 118 118 { 119 119 array_shift($PathItems); 120 return ($this->SearchPage($PathItems, $Pages[$PathItem]));121 } else return ($Pages[$PathItem]);122 } else return ('');120 return $this->SearchPage($PathItems, $Pages[$PathItem]); 121 } else return $Pages[$PathItem]; 122 } else return ''; 123 123 } 124 124 125 125 function Link($Target) 126 126 { 127 return ($this->BaseURL.$Target);127 return $this->BaseURL.$Target; 128 128 } 129 129 } … … 141 141 { 142 142 Header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); 143 return ('<h3 align="center">'.T('Required page not found'));143 return '<h3 align="center">'.T('Required page not found'); 144 144 } 145 145 } -
trunk/Application/DefaultConfig.php
r78 r92 6 6 { 7 7 $IsDeveloper = in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1')); 8 return (array8 return array 9 9 ( 10 10 array('Name' => 'SystemPassword', 'Type' => 'PasswordEncoded', 'Default' => '', 'Title' => 'Systémové heslo'), … … 53 53 array('Name' => 'MainRouter/ConnectTimeout', 'Type' => 'Integer', 'Default' => '5', 'Title' => 'Vypršení času'), 54 54 array('Name' => 'MainRouter/MangleRuleSubgroupMinPrefix', 'Type' => 'Integer', 'Default' => '28', 'Title' => 'Nejmenší prefix podsítě pro mangle pravidla'), 55 ) );55 ); 56 56 } 57 57 } -
trunk/Application/UpdateTrace.php
r81 r92 44 44 'REFERENCES `Measure`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;'); 45 45 $DbResult = $Manager->Execute('SELECT `Id`, `PermissionAdd` FROM `Measure`'); 46 while ($DbRow = $DbResult->fetch_assoc())46 while ($DbRow = $DbResult->fetch_assoc()) 47 47 { 48 48 $Manager->Execute('INSERT INTO `Permission` (`Measure`, `Operation`) VALUES ('. … … 50 50 } 51 51 $DbResult = $Manager->Execute('SELECT `Id`, `PermissionView` FROM `Measure`'); 52 while ($DbRow = $DbResult->fetch_assoc())52 while ($DbRow = $DbResult->fetch_assoc()) 53 53 { 54 54 $Manager->Execute('INSERT INTO `Permission` (`Measure`, `Operation`) VALUES ('. … … 61 61 { 62 62 $DbResult = $Manager->Execute('SELECT `DataTable`,`DataType` FROM `Measure`;'); 63 while ($Measure = $DbResult->fetch_assoc())63 while ($Measure = $DbResult->fetch_assoc()) 64 64 { 65 65 $Table = $Measure['DataTable']; … … 80 80 function Get() 81 81 { 82 return (array(82 return array( 83 83 65 => array('Revision' => 67, 'Function' => 'UpdateTo67'), 84 84 67 => array('Revision' => 79, 'Function' => 'UpdateTo79'), 85 ) );85 ); 86 86 } 87 87 } -
trunk/Application/Version.php
r90 r92 6 6 // and system will need database update. 7 7 8 $Revision = 88;8 $Revision = 92; 9 9 $DatabaseRevision = 79; 10 $ReleaseTime = strtotime('20 19-10-04');10 $ReleaseTime = strtotime('2020-04-07'); -
trunk/Application/View.php
r90 r92 28 28 { 29 29 $Output = $this->ShowPage($Page->Show()); 30 return ($Output);30 return $Output; 31 31 } 32 32 }
Note:
See TracChangeset
for help on using the changeset viewer.