Changeset 594
- Timestamp:
- Nov 2, 2013, 11:23:19 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r593 r594 1 1 <?php 2 2 3 $Revision = 59 3; // Subversion revision3 $Revision = 594; // Subversion revision 4 4 $DatabaseRevision = 591; // SQL structure revision 5 5 $ReleaseTime = '2013-11-02'; -
trunk/Common/AppModule.php
r593 r594 235 235 foreach($this->Modules as $RefModule) 236 236 { 237 $DepModule = $this->Modules[$Dependency];238 237 if(in_array($Module->Name, $RefModule->Dependencies) and 239 238 (in_array(ModuleCondition::All, $Conditions) or … … 273 272 } 274 273 274 function UninstallAll() 275 { 276 $this->Perform($this->Modules, array(ModuleAction::Uninstall)); 277 $this->SaveState(); 278 } 279 275 280 function ModulePresent($Name) 276 281 { -
trunk/Common/Page.php
r590 r594 87 87 $Output .= '<div id="Title">'.$Title.'</div> 88 88 <div class="Navigation"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">'; 89 if( $this->System->Config['Web']['UserSupport'] == 1)89 if(isset($this->System->User) and ($this->System->Config['Web']['UserSupport'] == 1)) 90 90 { 91 if( isset($this->System->User) and ($this->System->User->User['Id'] == null))91 if($this->System->User->User['Id'] == null) 92 92 $Output .= '<a href="'.$this->System->Link('/?Action=LoginForm').'">Přihlášení</a> '. 93 93 '<a href="'.$this->System->Link('/?Action=UserRegister').'">Registrace</a>'; -
trunk/Common/Setup/Setup.php
r593 r594 404 404 $this->Database->query("INSERT INTO `SystemVersion` (`Id`, `Revision`) VALUES 405 405 (1, 591);"); 406 $this->Database->query("CREATE TABLE IF NOT EXISTS `Module` ( 407 `Id` int(11) NOT NULL AUTO_INCREMENT, 408 `Name` varchar(255) NOT NULL, 409 `Title` varchar(255) NOT NULL, 410 PRIMARY KEY (`Id`) 411 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 406 412 } 407 413 408 414 function Uninstall() 409 415 { 416 $this->System->ModuleManager->UninstallAll(); 417 $this->Database->query('DROP TABLE `Module`'); 410 418 $this->Database->query('DROP TABLE `SystemVersion`'); 411 419 } … … 419 427 function Upgrade() 420 428 { 421 $Output = $this-> ModuleManager->Update();429 $Output = $this->UpdateManager->Upgrade(); 422 430 return($Output); 423 431 } -
trunk/Common/Setup/Update.php
r592 r594 38 38 } 39 39 40 function Up date()40 function Upgrade() 41 41 { 42 42 $DbRevision = $this->GetDbVersion(); -
trunk/Modules/User/User.php
r593 r594 431 431 KEY `User` (`User`) 432 432 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 433 $this->Database->query("CREATE TABLE IF NOT EXISTS `PermissionGroup` ( 434 `Id` int(11) NOT NULL AUTO_INCREMENT, 435 `Description` varchar(255) NOT NULL DEFAULT '', 436 PRIMARY KEY (`Id`) 437 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 438 439 $this->Database->query("CREATE TABLE IF NOT EXISTS `PermissionGroupAssignment` ( 440 `Id` int(11) NOT NULL AUTO_INCREMENT, 441 `Group` int(11) NOT NULL DEFAULT '0', 442 `AssignedGroup` int(11) DEFAULT NULL, 443 `AssignedOperation` int(11) DEFAULT NULL, 444 PRIMARY KEY (`Id`), 445 KEY `Group` (`Group`), 446 KEY `AssignedGroup` (`AssignedGroup`), 447 KEY `AssignedOperation` (`AssignedOperation`) 448 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 449 450 $this->Database->query("CREATE TABLE IF NOT EXISTS `PermissionOperation` ( 451 `Id` int(11) NOT NULL AUTO_INCREMENT, 452 `Module` int(11) NOT NULL, 453 `Operation` varchar(128) NOT NULL DEFAULT '', 454 `Item` varchar(64) NOT NULL DEFAULT '', 455 `ItemId` int(11) NOT NULL DEFAULT '0', 456 PRIMARY KEY (`Id`), 457 KEY `Module` (`Module`), 458 KEY `Operation` (`Operation`), 459 KEY `Item` (`Item`), 460 KEY `ItemId` (`ItemId`) 461 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 462 463 $this->Database->query("CREATE TABLE IF NOT EXISTS `PermissionUserAssignment` ( 464 `Id` int(11) NOT NULL AUTO_INCREMENT, 465 `User` int(11) DEFAULT NULL, 466 `AssignedGroup` int(11) DEFAULT NULL, 467 `AssignedOperation` int(11) DEFAULT NULL, 468 PRIMARY KEY (`Id`), 469 KEY `User` (`User`), 470 KEY `AssignedGroup` (`AssignedGroup`), 471 KEY `AssignedOperation` (`AssignedOperation`) 472 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 473 474 $this->Database->query("ALTER TABLE `PermissionGroupAssignment` 475 ADD CONSTRAINT `PermissionGroupAssignment_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `PermissionGroup` (`Id`), 476 ADD CONSTRAINT `PermissionGroupAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`), 477 ADD CONSTRAINT `PermissionGroupAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`);"); 478 479 $this->Database->query("ALTER TABLE `PermissionOperation` 480 ADD CONSTRAINT `PermissionOperation_ibfk_1` FOREIGN KEY (`Module`) REFERENCES `Module` (`Id`);"); 481 482 $this->Database->query("ALTER TABLE `PermissionUserAssignment` 483 ADD CONSTRAINT `PermissionUserAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`), 484 ADD CONSTRAINT `PermissionUserAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`), 485 ADD CONSTRAINT `PermissionUserAssignment_ibfk_4` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);"); 433 486 } 434 487 435 488 function DoUninstall() 436 489 { 490 $this->Database->query('DROP TABLE `PermissionUserAssignment`'); 491 $this->Database->query('DROP TABLE `PermissionGroupAssignment`'); 492 $this->Database->query('DROP TABLE `PermissionGroup`'); 493 $this->Database->query('DROP TABLE `PermissionOperation`'); 437 494 $this->Database->query('DROP TABLE `UserOnline`'); 438 495 $this->Database->query('DROP TABLE `User`');
Note:
See TracChangeset
for help on using the changeset viewer.