Changeset 44 for trunk/www/index.php
- Timestamp:
- Jun 16, 2009, 9:08:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/index.php
r41 r44 79 79 else $Output .= ' <a href="?Action=ServerStart&Id='.$Server->Id.'">Spustit</a>'; 80 80 } 81 if($Server->Server['Lock'] == 0) $Output .= ' <a href="?Action=ServerEdit&Id='.$Server->Id.'">Upravit</a>'; 81 if($Server->Server['Lock'] == 0) 82 { 83 $Output .= ' <a href="?Action=ServerEdit&Id='.$Server->Id.'">Upravit základní nastavení</a>'; 84 $Output .= ' <a href="?Action=ServerEditDetailed&Id='.$Server->Id.'">Upravit podrobné nastavení</a>'; 85 } 82 86 //$Output .= ' <a href="?Action=ServerDatabaseImport&Id='.$Server->Id.'">Načtení čisté databáze</a>'; 83 87 } … … 547 551 } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění'); 548 552 } else 553 if($_GET['Action'] == 'ServerEditDetailed') 554 { 555 $Server = new Server($this->Database, $_GET['Id']); 556 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 557 { 558 $Form = new Form('ServerSettingDetailed'); 559 $EmulatorConfig = new MangosConfigurationFile($this->Database); 560 $EmulatorConfig->Load('../server/'.$Server->Id.'/etc/mangosd.conf'); 561 $Form->Values = $EmulatorConfig->ParameterList; 562 $Form->Values['ServerId'] = $_GET['Id']; 563 $Form->OnSubmit = '?Action=ServerSaveDetailed'; 564 $Output .= $Form->ShowEditForm(); 565 } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění'); 566 } else 567 if($_GET['Action'] == 'ServerSaveDetailed') 568 { 569 $Server = new Server($this->Database, $_POST['ServerId']); 570 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 571 { 572 $Form = new Form('ServerSettingDetailed', array()); 573 $Form->LoadValuesFromForm(); 574 $EmulatorConfig = new MangosConfigurationFile($this->Database); 575 $EmulatorConfig->Load('../server/'.$Server->Id.'/etc/mangosd.conf'); 576 foreach($Form->Values as $Index => $Item) 577 $EmulatorConfig->ParameterList[$Index] = $Item; 578 $EmulatorConfig->Save('../server/'.$Server->Id.'/etc/mangosd.conf'); 579 $ServerId = $_POST['ServerId']; 580 unset($Form->Values['ServerId']); 581 $Output .= $this->SystemMessage('Upravit server', 'Nastavení serveru uloženo.'); 582 //$Form->SaveValuesToDatabase($_POST['ServerId']); 583 $Form->OnSubmit = '?Action=ServerSaveDetailed'; 584 585 $Server = new Server($this->Database, $_POST['ServerId']); 586 $Server->SaveConfiguration(); 587 $Form->Values['ServerId'] = $ServerId; 588 $Output .= $Form->ShowEditForm(); 589 } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění'); 590 } else 549 591 if($_GET['Action'] == 'ServerStart') 550 592 {
Note:
See TracChangeset
for help on using the changeset viewer.