Changeset 584 for trunk/Modules/Portal


Ignore:
Timestamp:
Oct 31, 2013, 4:57:11 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Kontrola oprávnění při zobrazení informačního systému.
  • Přidáno: Tabulka Module pro seznam existujících modulů.
  • Upraveno: PermissionOperation se nyní odkazuje na id modulu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Portal/Portal.php

    r581 r584  
    105105  {
    106106    $Output = '';
    107     $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '.
     107    $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` '.
     108      'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '.
    108109      'WHERE (`Group`='.$ActionGroup['Id'].') AND (`Enable` = 1)');
    109110    while($Action = $DbResult->fetch_assoc())
     
    111112      if($Action['Icon'] == '') $Action['Icon'] = 'clear.png';
    112113        if(substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->System->Link($Action['URL']);
    113         if(($Action['PermissionModule'] == '') or (($Action['PermissionModule'] != '') and $this->System->User->User->CheckPermission($Action['PermissionModule'], $Action['PermissionOperation'])))       
    114         $Output .= '<img alt="'.$Action['Title'].'" src="images/favicons/'.$Action['Icon'].'" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a><br />';
     114        if($Action['PermissionOperation'] != '')
     115        {
     116          $DbResult2 = $this->Database->query('SELECT * FROM PermissionOperation'.
     117            ' LEFT JOIN Module ON Module.Id=PermissionOperation.Module'.
     118            ' WHERE Id='.$Action['PermissionOperation']);
     119          $DbRow2 = $DbResult2->fetch_assoc();
     120          if($this->System->User->User->CheckPermission($DbRow2['Module'], $DbRow2['Operation']))
     121            $Allowed = true; else $Allowed = false;       
     122        } else $Allowed = true;
     123        if($Allowed)
     124          $Output .= '<img alt="'.$Action['Title'].'" src="images/favicons/'.$Action['Icon'].'" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a><br />';
    115125    }
    116126    return($this->Panel($ActionGroup['Name'], $Output));
Note: See TracChangeset for help on using the changeset viewer.