Changeset 77 for trunk/www/Application/View/Realm.php
- Timestamp:
- Aug 25, 2009, 1:04:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.