Changeset 952 for trunk


Ignore:
Timestamp:
Aug 9, 2023, 7:36:56 PM (17 months ago)
Author:
chronos
Message:
  • Fixed: Checking group permission error.
Location:
trunk
Files:
3 edited

Legend:

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

    r912 r952  
    44{
    55  public array $RSSChannels;
    6 
     6  public array $RSSChannelsPos;
     7 
    78  function __construct(System $System)
    89  {
     
    1415    $this->Description = 'Web site RSS channel management';
    1516    $this->RSSChannels = array();
     17    $this->RSSChannelsPos = array();
    1618  }
    1719
     
    7072      else $ChannelName = '';
    7173    if (array_key_exists('token', $_GET)) $Token = $_GET['token'];
    72       else $Token = '';
     74      else $Token = '';     
    7375    if (array_key_exists($ChannelName, ModuleRSS::Cast($this->System->GetModule('RSS'))->RSSChannels))
    7476    {
  • trunk/Modules/User/UserModel.php

    r934 r952  
    302302
    303303  function CheckGroupPermission(string $GroupId, string $OperationId): bool
    304   {
     304  {   
    305305    $PermissionExists = false;
    306306    // First try to check cache group-group relation
     
    326326      {
    327327        if ($DbRow['AssignedGroup'] != '')
    328         if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true;
     328        {
     329          if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true;
     330        }
    329331      }
    330332    }
     
    383385
    384386    if ($PermissionExists)
    385     {
    386       if ($this->User['Id'] == null) $UserCondition = '(`User` IS NULL)';
     387    {     
     388      if ($this->User == null or $this->User['Id'] == null) $UserCondition = '(`User` IS NULL)';
    387389        else $UserCondition = '(`User`="'.$this->User['Id'].'")';
    388390      // Check user-operation relation
     
    390392      if ($DbResult->num_rows > 0) return true;
    391393
     394     
    392395      // Check user-group relation
    393       $DbResult = $this->Database->select('PermissionUserAssignment', 'AssignedGroup', $UserCondition);
     396      $DbResult = $this->Database->select('PermissionUserAssignment', 'AssignedGroup', '(`AssignedGroup` IS NOT NULL) AND '.$UserCondition);
    394397      while ($DbRow = $DbResult->fetch_array())
    395398      {
    396        if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true;
     399        if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true;
    397400      }
    398401      return false;
  • trunk/Packages/Common/Base.php

    r899 r952  
    1616    return get_called_class();
    1717  }
     18
     19  public function __debugInfo()
     20  {   
     21    $Vars = get_object_vars($this);   
     22    unset($Vars['System'], $Vars['Database']);
     23    return $Vars;
     24  }
    1825}
Note: See TracChangeset for help on using the changeset viewer.