Ignore:
Timestamp:
Aug 24, 2009, 8:53:09 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Podpora pro oprávnění uživatelů a skupin.
  • Upraveno: V include souborech použita cesta aktuálního skriptu.
File:
1 edited

Legend:

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

    r73 r76  
    8989    {
    9090      if($_GET['Filter'] == 'User')
    91         $Table->Definition['Table'] = substr($Table->Definition['Table'], 0, -1).' WHERE User='.$this->System->Modules['User']->User['Id'].')';
     91        $Table->Definition['Table'] = substr($Table->Definition['Table'], 0, -1).' WHERE User='.$this->System->Modules['User']->Data['Id'].')';
    9292    }
    9393    $Table->OnRow = array($this, 'ShowListOnRow');
     
    101101    }
    102102    $Output .= $Table->Show();
    103     if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
     103    if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
    104104    {
    105105      $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server');
    106106      $DbRow = $DbResult->fetch_row();
    107107      $ServerCount = $DbRow[0];
    108       $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
     108      $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']);
    109109      $DbRow = $DbResult->fetch_row();
    110110      if(($ServerCount < $Config['MaxServerCount']) and ($DbRow[0] < $Config['MaxServerCountPerUser']))
     
    137137    $Output .= $Form->ShowTable();
    138138    $Output .= '<div style="text-align: center">';
    139     if((($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->User['Id'] == $Server->Server['User'])) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
     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))
    140140    {
    141141      $Output .= '<br /><a href="http://'.$this->System->Config['Web']['Host'].'/mysql/">Správa databáze</a> ';
     
    168168   
    169169    $Output = '';
    170     if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
     170    if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
    171171    {
    172172      $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server');
     
    175175      if($ServerCount < $Config['MaxServerCount'])
    176176      {
    177         $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
     177        $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']);
    178178        $DbRow = $DbResult->fetch_row();
    179179        if($DbRow[0] >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' serverů');
     
    196196   
    197197    $Output = '';
    198     if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
    199     {
    200       $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
     198    if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
     199    {
     200      $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']);
    201201      $DbRow = $DbResult->fetch_row();
    202202      if($DbRow[0] >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' serverů');
     
    210210        $Form = new Form($this->System, $this->CreateFormClass, array());
    211211        $Form->LoadValuesFromForm();
    212         $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Homepage' => $Form->Values['Homepage'], 'Database' => $Form->Values['Database'], 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1, 'TimeCreate' => 'NOW()'));
     212        $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->Data['Id'], 'Homepage' => $Form->Values['Homepage'], 'Database' => $Form->Values['Database'], 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1, 'TimeCreate' => 'NOW()'));
    213213        $LastInsertId = $this->Database->insert_id;
    214214        $Server = new Server($this->Database, $LastInsertId);
     
    229229    $Output = '';
    230230    $Server = new Server($this->Database, $_POST['ServerId']);
    231     if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
     231    if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
    232232    {
    233233      $Form = new Form($this->System, $this->EditFormClass, array());
     
    251251    $Output = '';
    252252    $Server = new Server($this->Database, $_GET['Id']);
    253     if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
     253    if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
    254254    {
    255255      $Form = new Form($this->System, $this->EditFormClass);
     
    265265  {
    266266    $Output = '';
    267     if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
     267    if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
    268268    {
    269269      $Server = new Server($this->Database, $_GET['Id']);
    270       if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
     270      if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
    271271      {
    272272        $Output .= $this->System->SystemMessage('Spuštění serveru', $Server->Start());
     
    281281  {
    282282    $Output = '';
    283     if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
     283    if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER)
    284284    {
    285285      $Server = new Server($this->Database, $_GET['Id']);
    286       if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
     286      if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR))
    287287      {
    288288        $Output .= $this->System->SystemMessage('Zastavení serveru', $Server->Stop());
Note: See TracChangeset for help on using the changeset viewer.