Ignore:
Timestamp:
Aug 16, 2013, 10:20:57 PM (11 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/Application/View/Server.php

    r93 r94  
    164164  {
    165165    $Output = '';
    166     if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
     166    if($this->System->Modules['Permission']->Check('Server', 'Add'))
    167167    {
    168168      $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server');
     
    185185        }
    186186      } else $Output .= $this->System->SystemMessage('Nový server', 'Nelze vytvářet další servery');
    187     } else $Output .= USER_BAD_ROLE;
     187    } else $Output = $this->System->SystemMessage('Vytvoření serveru', 'Nemáte oprávnění');
    188188    return($Output);
    189189  }
     
    192192  {
    193193    $Output = '';
    194     if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
     194    if($this->System->Modules['Permission']->Check('Server', 'Add'))
    195195    {
    196196      $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']);
     
    219219        //$Output .= $Form->ShowEditForm();
    220220      }
    221     } else $Output .= USER_BAD_ROLE;
     221    } else $Output = $this->System->SystemMessage('Vytvoření serveru', 'Nemáte oprávnění');
    222222    return($Output);
    223223  }
     
    227227    $Output = '';
    228228    $Server = new Server($this->System, $_POST['ServerId']);
    229     if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
     229    if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or
     230        ($this->System->Modules['Permission']->Check('Server', 'Modify')))
    230231    {
    231232      $Form = new Form($this->System, $this->EditFormClass, array());
     
    249250    $Output = '';
    250251    $Server = new Server($this->System, $_GET['Id']);
    251     if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
     252    if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or
     253        ($this->System->Modules['Permission']->Check('Server', 'Modify')))
    252254    {
    253255      $Form = new Form($this->System, $this->EditFormClass);
     
    263265  {
    264266    $Output = '';
    265     if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
     267    if($this->System->Modules['Permission']->Check('Server', 'OwnerControl'))
    266268    {
    267269      $Server = new Server($this->System, $_GET['Id']);
    268       if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
     270      if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or
     271        ($this->System->Modules['Permission']->Check('Server', 'Control')))
    269272      {
    270273        $Output .= $this->System->SystemMessage('Spuštění serveru', $Server->Start());
     
    272275        $Output .= $TaskView->ItemList();;
    273276      } else $this->System->SystemMessage('Spuštění serveru', 'Nemáte oprávnění');
    274     } else $Output .= USER_BAD_ROLE;
     277    } else $this->System->SystemMessage('Spuštění serveru', 'Nemáte oprávnění');
    275278    return($Output);
    276279  }
     
    279282  {
    280283    $Output = '';
    281     if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
     284    if($this->System->Modules['Permission']->Check('Server', 'OwnerControl'))
    282285    {
    283286      $Server = new Server($this->System, $_GET['Id']);
    284       if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
     287      if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or
     288        ($this->System->Modules['Permission']->Check('Server', 'Control')))
    285289      {
    286290        $Output .= $this->System->SystemMessage('Zastavení serveru', $Server->Stop());
     
    288292        $Output .= $TaskView->ItemList();;
    289293      } else $this->System->SystemMessage('Zastavení serveru', 'Nemáte oprávnění');
    290     } else $Output .= USER_BAD_ROLE;
     294    } else $this->System->SystemMessage('Zastavení serveru', 'Nemáte oprávnění');
    291295    return($Output);
    292296  }
Note: See TracChangeset for help on using the changeset viewer.