Changeset 981
- Timestamp:
- Dec 1, 2025, 10:11:09 PM (3 hours ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
Application/Version.php (modified) (1 diff)
-
Packages/Common/Modules/ModuleManager.php (modified) (15 diffs)
-
Packages/Common/Modules/Setup.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r977 r981 1 1 <?php 2 2 3 $Revision = 9 77; // Subversion revision3 $Revision = 981; // Subversion revision 4 4 $DatabaseRevision = 970; // SQL structure revision 5 $ReleaseTime = strtotime('202 5-06-30');5 $ReleaseTime = strtotime('2026-12-01'); -
trunk/Packages/Common/Modules/ModuleManager.php
r946 r981 14 14 $this->Description = 'User interface for module management.'; 15 15 $this->Dependencies = array(ModuleSetup::GetName()); 16 $this->Revision = 1;17 16 $this->Type = ModuleType::System; 18 17 $this->Models = array(ModelField::GetClassName(), ModuleDependency::GetClassName()); … … 30 29 //$this->LoadFromDatabase(); 31 30 32 $this->System->FormManager->RegisterClass('Module', array(31 Core::Cast($this->System)->FormManager->RegisterClass('Module', array( 33 32 'Title' => 'Moduly', 34 33 'Table' => 'Module', … … 49 48 ), 50 49 )); 51 $this->System->FormManager->RegisterFormType('TModule', array(50 Core::Cast($this->System)->FormManager->RegisterFormType('TModule', array( 52 51 'Type' => 'Reference', 53 52 'Table' => 'Module', … … 56 55 'Filter' => '1', 57 56 )); 58 $this->System->FormManager->RegisterFormType('TModelListModule', array(57 Core::Cast($this->System)->FormManager->RegisterFormType('TModelListModule', array( 59 58 'Type' => 'ManyToOne', 60 59 'Table' => 'Model', … … 63 62 'Filter' => '1', 64 63 )); 65 $this->System->FormManager->RegisterClass('Model', array(64 Core::Cast($this->System)->FormManager->RegisterClass('Model', array( 66 65 'Title' => 'Modely', 67 66 'Table' => 'Model', … … 76 75 ), 77 76 )); 78 $this->System->FormManager->RegisterFormType('TModel', array(77 Core::Cast($this->System)->FormManager->RegisterFormType('TModel', array( 79 78 'Type' => 'Reference', 80 79 'Table' => 'Model', … … 83 82 'Filter' => '1', 84 83 )); 85 $this->System->FormManager->RegisterFormType('TModelFieldListModel', array(84 Core::Cast($this->System)->FormManager->RegisterFormType('TModelFieldListModel', array( 86 85 'Type' => 'ManyToOne', 87 86 'Table' => 'ModelField', … … 90 89 'Filter' => '1', 91 90 )); 92 $this->System->FormManager->RegisterClass('ModelField', array(91 Core::Cast($this->System)->FormManager->RegisterClass('ModelField', array( 93 92 'Title' => 'Pole modelu', 94 93 'Table' => 'ModelField', … … 104 103 ), 105 104 )); 106 $this->System->FormManager->RegisterFormType('TModuleLink', array(105 Core::Cast($this->System)->FormManager->RegisterFormType('TModuleLink', array( 107 106 'Type' => 'Reference', 108 107 'Table' => 'ModuleLink', … … 111 110 'Filter' => '1', 112 111 )); 113 $this->System->FormManager->RegisterFormType('TModuleLinkListModule', array(112 Core::Cast($this->System)->FormManager->RegisterFormType('TModuleLinkListModule', array( 114 113 'Type' => 'ManyToOne', 115 114 'Table' => 'ModuleLink', … … 118 117 'Filter' => '1', 119 118 )); 120 $this->System->FormManager->RegisterClass('ModuleLink', array(119 Core::Cast($this->System)->FormManager->RegisterClass('ModuleLink', array( 121 120 'Title' => 'Vazby modulu', 122 121 'Table' => 'ModuleLink', … … 127 126 ), 128 127 )); 129 $this->System->FormManager->RegisterFormType('TModule', array(128 Core::Cast($this->System)->FormManager->RegisterFormType('TModule', array( 130 129 'Type' => 'Reference', 131 130 'Table' => 'Module', … … 250 249 'Type' => ModelColumnType::GetName($Field->Type), 'Nullable' => (int)$Field->Nullable)); 251 250 } 252 if ($ModelDesc->DefaultValues != null)253 { 254 $Values = call_user_func('self::'.$ModelDesc->DefaultValues );251 if ($ModelDesc->DefaultValuesMethod != null) 252 { 253 $Values = call_user_func('self::'.$ModelDesc->DefaultValuesMethod); 255 254 foreach ($Values as $Value) 256 255 { … … 303 302 { 304 303 //DebugLog('Loading modules...'); 305 $this->Modules = array();306 304 $Query = 'SELECT `Id`, `Name`,`Installed` FROM `Module`'; 307 305 $DbResult = $this->Database->query($Query); … … 419 417 function Show(): string 420 418 { 419 if (!ModuleSetup::Cast($this->System->GetModule('Setup'))->UserLogged()) 420 return 'Nemáte oprávnění'; 421 421 422 $Output = ''; 422 423 if (array_key_exists('op', $_GET)) $Operation = $_GET['op']; -
trunk/Packages/Common/Modules/Setup.php
r912 r981 15 15 $this->License = 'GNU/GPLv3'; 16 16 $this->Description = 'Base setup module'; 17 $this->Revision = 1;18 17 $this->Type = ModuleType::System; 19 18 … … 59 58 $Output = $this->UpdateManager->Upgrade(); 60 59 return $Output; 60 } 61 62 function UserLogged(): bool 63 { 64 if (!array_key_exists('SystemPassword', $_SESSION)) $_SESSION['SystemPassword'] = ''; 65 if (array_key_exists('login', $_POST)) $_SESSION['SystemPassword'] = $_POST['SystemPassword']; 66 return sha1($_SESSION['SystemPassword']) == Core::Cast($this->System)->Config['SystemPassword']; 61 67 } 62 68 } … … 125 131 function Show(): string 126 132 { 127 global $ ConfigDefinition, $DatabaseRevision, $Config, $Updates;133 global $DatabaseRevision, $Config; 128 134 129 135 $this->UpdateManager = ModuleSetup::Cast($this->System->GetModule('Setup'))->UpdateManager; … … 136 142 if (isset($this->Config)) 137 143 { 138 if (!array_key_exists('SystemPassword', $_SESSION)) $_SESSION['SystemPassword'] = ''; 139 if (array_key_exists('login', $_POST)) $_SESSION['SystemPassword'] = $_POST['SystemPassword']; 140 if (sha1($_SESSION['SystemPassword']) != $this->Config['SystemPassword']) 144 if (!ModuleSetup::Cast($this->System->GetModule('Setup'))->UserLogged()) 141 145 { 142 146 $Output .= $this->LoginPanel(); … … 153 157 else if ($Action == 'models') 154 158 { 155 $this->System->FormManager->UpdateSQLMeta();159 Core::Cast($this->System)->FormManager->UpdateSQLMeta(); 156 160 } 157 161 else if ($Action == 'upgrade')
Note:
See TracChangeset
for help on using the changeset viewer.
