Changeset 77 for trunk/www/Application/View
- Timestamp:
- Aug 25, 2009, 1:04:56 PM (15 years ago)
- Location:
- trunk/www/Application/View
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/View/Client.php
r69 r77 31 31 $Table->LoadValuesFromDatabase($this->Database); 32 32 $Output .= $Table->Show(); 33 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)34 {35 //$Output .= '<br /><div style="text-align: center;"><a href="?Action=BackupAdd">Zálohovat</a></dev>';36 }37 33 return($Output); 38 34 } -
trunk/www/Application/View/Emulator.php
r74 r77 47 47 } 48 48 $Output .= $Table->Show(); 49 if($this->System->Modules[' User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)49 if($this->System->Modules['Permission']->Check('Emulator', 'Add')) 50 50 { 51 51 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Emulator&Action=Add">Přidat emulátor</a></dev>'; … … 64 64 $Output .= '<div style="text-align: center">'; 65 65 $Emulator = new Emulator($this->Database, $Id); 66 if($this->System->Modules[' User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)66 if($this->System->Modules['Permission']->Check('Emulator', 'Download', $Emulator->Id)) 67 67 { 68 68 if($Emulator->Emulator['Lock'] == 0) $Output .= ' <a href="?Module=Emulator&Action=Download&Id='.$Id.'">Stáhnout</a>'; 69 } 70 if($this->System->Modules['Permission']->Check('Emulator', 'Compile', $Emulator->Id)) 71 { 69 72 if($Emulator->Emulator['Lock'] == 0) $Output .= ' <a href="?Module=Emulator&Action=Compile&Id='.$Id.'">Přeložit</a>'; 70 73 } … … 75 78 function Add() 76 79 { 77 if($this->System->Modules[' User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)80 if($this->System->Modules['Permission']->Check('Emulator', 'Add')) 78 81 { 79 82 $Form = new Form($this->System, $this->ItemFormClass); … … 87 90 function AddFinish() 88 91 { 89 if($this->System->Modules[' User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)92 if($this->System->Modules['Permission']->Check('Emulator', 'Add')) 90 93 { 91 94 $Form = new Form($this->System, $this->ItemFormClass); … … 102 105 { 103 106 $Emulator = new Emulator($this->Database, $_GET['Id']); 104 $Emulator->Download(); 105 $Output = $this->System->SystemMessage('Stažení emulátoru', 'Úloha zařazena do fronty'); 106 $TaskView = new TaskView($this->System); 107 $Output .= $TaskView->ItemList(); 107 if($this->System->Modules['Permission']->Check('Emulator', 'Download', $Emulator->Id)) 108 { 109 $Emulator->Download(); 110 $Output = $this->System->SystemMessage('Stažení emulátoru', 'Úloha zařazena do fronty'); 111 $TaskView = new TaskView($this->System); 112 $Output .= $TaskView->ItemList(); 113 } else $Output = $this->System->Modules['Permission']->AccessDenied(); 108 114 } else $Output = $this->System->SystemMessage('Stažení emulátoru', 'Nebylo zadáno Id'); 109 115 return($Output); … … 115 121 { 116 122 $Emulator = new Emulator($this->Database, $_GET['Id']); 117 $Emulator->Compile(); 118 $Output = $this->System->SystemMessage('Překlad emulátoru', 'Úloha zařazena do fronty'); 119 $TaskView = new TaskView($this->System); 120 $Output .= $TaskView->ItemList(); 123 if($this->System->Modules['Permission']->Check('Emulator', 'Download', $Emulator->Id)) 124 { 125 $Emulator->Compile(); 126 $Output = $this->System->SystemMessage('Překlad emulátoru', 'Úloha zařazena do fronty'); 127 $TaskView = new TaskView($this->System); 128 $Output .= $TaskView->ItemList(); 129 } else $Output = $this->System->Modules['Permission']->AccessDenied(); 121 130 } else $Output = $this->System->SystemMessage('Překlad emulátoru', 'Nebylo zadáno Id'); 122 131 return($Output); -
trunk/www/Application/View/Page.php
r76 r77 89 89 //$Output .= '<div><a href="?Action=UpdateList&Id='.$Server['Id'].'">Dostupné aktualizace</a></div>'; 90 90 91 if($this->System->Modules['Permission']->Check Permission('News', 'Add'))91 if($this->System->Modules['Permission']->Check('News', 'Add')) 92 92 { 93 93 $Output .= '<div><a href="?Module=News&Action=Add">Přidat aktualitu</a></div>'; -
trunk/www/Application/View/Realm.php
r74 r77 122 122 } 123 123 $Output .= $Table->Show(); 124 if($this->System->Modules[' User']->User['Role'] >= USER_ROLE_USER)124 if($this->System->Modules['Permission']->Check('Realm', 'Add')) 125 125 { 126 126 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm'); … … 154 154 $Output .= $Form->ShowTable(); 155 155 $Output .= '<div style="text-align: center">'; 156 if( (($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->User['Id'] == $Realm->GetUser())) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))156 if($this->System->Modules['Permission']->Check('Realm', 'Edit')) 157 157 { 158 158 $Output .= '<br /><a href="http://'.$this->System->Config['Web']['Host'].'/mysql/">Správa databáze</a> '; … … 183 183 $ServerId = $_GET['Id']; 184 184 $Output = ''; 185 if($this->System->Modules[' User']->User['Role'] >= USER_ROLE_USER)185 if($this->System->Modules['Permission']->Check('Realm', 'Add')) 186 186 { 187 187 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm'); … … 212 212 { 213 213 $ServerId = $_GET['Id']; 214 if($this->System->Modules[' User']->User['Role'] >= USER_ROLE_USER)214 if($this->System->Modules['Permission']->Check('Realm', 'Add')) 215 215 { 216 216 if($this->System->Modules['User']->RealmCount() >= $Config['MaxServerCountPerUser']) $Output = $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' světů'); … … 245 245 $Output = ''; 246 246 $Realm = new Realm($this->Database, $_POST['RealmId']); 247 if( ($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))247 if($this->System->Modules['Permission']->Check('Realm', 'Save', $Realm->Id)) 248 248 { 249 249 $Form = new Form($this->System, $this->EditFormClass, array()); … … 267 267 $Output = ''; 268 268 $Realm = new Realm($this->Database, $_GET['Id']); 269 if( ($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))269 if($this->System->Modules['Permission']->Check('Realm', 'Edit', $Realm->Id)) 270 270 { 271 271 $Form = new Form($this->System, $this->EditFormClass); … … 282 282 $Output = ''; 283 283 $Realm = new Realm($this->Database, $_GET['Id']); 284 if( ($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))284 if($this->System->Modules['Permission']->Check('Realm', 'EditDetailed', $Realm->Id)) 285 285 { 286 286 $Form = new Form($this->System, $this->SettingDetailedFormClass); … … 301 301 $Output = ''; 302 302 $Realm = new Realm($this->Database, $_POST['RealmId']); 303 if( ($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))303 if($this->System->Modules['Permission']->Check('Realm', 'SaveDetailed', $Realm->Id)) 304 304 { 305 305 $Form = new Form($this->System, $this->SettingDetailedFormClass, array()); … … 331 331 { 332 332 $Output = ''; 333 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 334 { 335 $Realm = new Realm($this->Database, $_GET['Id']); 336 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 337 { 338 $Output .= $this->System->SystemMessage('Spuštění serveru', $Realm->Start()); 339 $TaskView = new TaskView($this->System); 340 $Output .= $TaskView->ItemList();; 341 } else $this->System->SystemMessage('Spuštění serveru', 'Nemáte oprávnění'); 342 } else $Output .= USER_BAD_ROLE; 333 $Realm = new Realm($this->Database, $_GET['Id']); 334 if($this->System->Modules['Permission']->Check('Realm', 'Start', $Realm->Id)) 335 { 336 $Output .= $this->System->SystemMessage('Spuštění serveru', $Realm->Start()); 337 $TaskView = new TaskView($this->System); 338 $Output .= $TaskView->ItemList();; 339 } else $this->System->Modules['Permission']->AccessDenied(); 343 340 return($Output); 344 341 } … … 347 344 { 348 345 $Output = ''; 349 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 350 { 351 $Realm = new Realm($this->Database, $_GET['Id']); 352 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 353 { 354 $Output .= $this->System->SystemMessage('Zastavení serveru', $Realm->Stop()); 355 $TaskView = new TaskView($this->System); 356 $Output .= $TaskView->ItemList();; 357 } else $this->System->SystemMessage('Zastavení serveru', 'Nemáte oprávnění'); 358 } else $Output .= USER_BAD_ROLE; 346 $Realm = new Realm($this->Database, $_GET['Id']); 347 if($this->System->Modules['Permission']->Check('Realm', 'Stop', $Realm->Id)) 348 { 349 $Output .= $this->System->SystemMessage('Zastavení serveru', $Realm->Stop()); 350 $TaskView = new TaskView($this->System); 351 $Output .= $TaskView->ItemList();; 352 } else $this->System->Modules['Permission']->AccessDenied(); 359 353 return($Output); 360 354 } … … 367 361 { 368 362 $RealmId = $_GET['Id']; 369 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 370 { 371 $Realm = new Realm($this->Database, $RealmId); 372 if($Realm->GetUser() == $this->System->Modules['User']->User['Id']) 373 { 374 $Output = $this->System->SystemMessage('Vynulování databáze', $Realm->ImportDatabase(true)); 375 $TaskView = new TaskView($this->System); 376 $Output .= $TaskView->ItemList(); 377 //$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 378 //$Form->OnSubmit = '?Action=ServerCreate'; 363 $Realm = new Realm($this->Database, $RealmId); 364 if($this->System->Modules['Permission']->Check('Realm', 'InitDatabase', $Realm->Id)) 365 { 366 $Output = $this->System->SystemMessage('Vynulování databáze', $Realm->ImportDatabase(true)); 367 $TaskView = new TaskView($this->System); 368 $Output .= $TaskView->ItemList(); 369 //$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 370 //$Form->OnSubmit = '?Action=ServerCreate'; 379 371 //$Output .= $Form->ShowEditForm(); 380 } else $Output = $this->System->SystemMessage('Vynulování databáze', 'Nemáte oprávnění'); 381 } else $Output = USER_BAD_ROLE; 372 } else $this->System->Modules['Permission']->AccessDenied(); 382 373 } else $Output = $this->System->SystemMessage('Vynulování databáze', 'Nezadáno Id serveru'); 383 374 return($Output); -
trunk/www/Application/View/Server.php
r76 r77 101 101 } 102 102 $Output .= $Table->Show(); 103 if($this->System->Modules[' User']->Data['Role'] >= USER_ROLE_USER)103 if($this->System->Modules['Permission']->Check('Server', 'Add')) 104 104 { 105 105 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server'); … … 109 109 $DbRow = $DbResult->fetch_row(); 110 110 if(($ServerCount < $Config['MaxServerCount']) and ($DbRow[0] < $Config['MaxServerCountPerUser'])) 111 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Server&Action=Add">Vytvořit nový server</a></d ev>';111 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Server&Action=Add">Vytvořit nový server</a></div>'; 112 112 } 113 113 return($Output); … … 137 137 $Output .= $Form->ShowTable(); 138 138 $Output .= '<div style="text-align: center">'; 139 if( (($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->Data['Id'] == $Server->Server['User'])) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))139 if($this->System->Modules['Permission']->Check('Server', 'Edit')) 140 140 { 141 141 $Output .= '<br /><a href="http://'.$this->System->Config['Web']['Host'].'/mysql/">Správa databáze</a> '; 142 142 if(array_key_exists('Id', $Server->Server['Database']) and ($Server->Server['Lock'] == 0)) 143 143 { 144 if($ServerStatus['RealmdPortState'] == true) $Output .= ' <a href="? Action=ServerStop&Id='.$Server->Id.'">Zastavit</a> <a href="?Module=Server&Action=Restart&Id='.$Server->Id.'">Restartovat</a>';144 if($ServerStatus['RealmdPortState'] == true) $Output .= ' <a href="?Module=Server&Action=Stop&Id='.$Server->Id.'">Zastavit</a> <a href="?Module=Server&Action=Restart&Id='.$Server->Id.'">Restartovat</a>'; 145 145 else $Output .= ' <a href="?Module=Server&Action=Start&Id='.$Server->Id.'">Spustit</a>'; 146 146 } -
trunk/www/Application/View/User.php
r76 r77 69 69 $Form->LoadValuesFromForm(); 70 70 $Result = $this->System->Modules['User']->Login($Form->Values['Username'], $Form->Values['Password']); 71 $Output = $this->System->SystemMessage('Přihlášení', $Result); 71 $Page = new PageView($this->System); 72 $Output = $Page->SystemMessage('Přihlášení', $Result); 72 73 if($Result <> $this->System->Translate('UserLoggedIn')) 73 74 { … … 89 90 $Form->LoadValuesFromForm(); 90 91 $Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']); 91 $Output = $this->System->SystemMessage('Registrace nového účtu', $Result); 92 $Page = new PageView($this->System); 93 $Output = $Page->SystemMessage('Registrace nového účtu', $Result); 92 94 if($Result <> $this->System->Translate('UserRegistrated')) 93 95 { … … 101 103 function PasswordRecoveryConfirm() 102 104 { 103 $Output = $this->System->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 105 $Page = new PageView($this->System); 106 $Output = $Page->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 104 107 $Output .= $this->LoginForm(); 105 108 return($Output); … … 111 114 $Form->LoadValuesFromForm(); 112 115 $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 113 $Output = $this->System->SystemMessage('Obnova hesla', $Result); 116 $Page = new PageView($this->System); 117 $Output = $Page->SystemMessage('Obnova hesla', $Result); 114 118 if($Result <> $this->System->Translate('UserPasswordRecoverySuccess')) 115 119 { … … 129 133 function Logout() 130 134 { 131 $Output = $this->System->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout()); 135 $Page = new PageView($this->System); 136 $Output = $Page->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout()); 132 137 $Output .= $this->Login(); 133 138 return($Output); … … 148 153 $UserOptions->LoadValuesFromForm(); 149 154 $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']); 150 $Output = $this->System->SystemMessage('Nastavení', 'Nastavení uloženo.'); 155 $Page = new PageView($this->System); 156 $Output = $Page->SystemMessage('Nastavení', 'Nastavení uloženo.'); 151 157 $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']); 152 158 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); … … 177 183 if($Config['Web']['UserRegistrationEnabled']) 178 184 { 179 $Output = $this->System->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 185 $Page = new PageView($this->System); 186 $Output = $Page->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 180 187 $Output .= $this->ShowLoginForm(); 181 188 } else $Output = 'Registrace nových účtů nejsou povoleny.';
Note:
See TracChangeset
for help on using the changeset viewer.