Explorar o código

fixed bug in AclQueryFeatures special filtr Access when missing acl group fields

Piotr Labudda %!s(int64=9) %!d(string=hai) anos
pai
achega
186d83116a
Modificáronse 2 ficheiros con 2 adicións e 1 borrados
  1. 1 0
      SE/se-lib/AclQueryBuilder.php
  2. 1 1
      SE/se-lib/AclQueryFeatures.php

+ 1 - 0
SE/se-lib/AclQueryBuilder.php

@@ -69,6 +69,7 @@ class AclQueryBuilder {
   }
 
   public function where($where) {
+    if (null === $where) return $this;
     if (is_string($where)) return $this->whereRaw($where);
     list($fieldName, $comparisonSign, $value) = $where;
     if (!in_array($comparisonSign, [ // validation

+ 1 - 1
SE/se-lib/AclQueryFeatures.php

@@ -236,7 +236,7 @@ class AclQueryFeatures {
       $orWhere[] = ['A_CLASSIFIED', '=', ''];// TODO: allow empty for everyone?
       foreach ($usrAclGroups as $group) $orWhere[] = ['A_CLASSIFIED', '=', $group];
     }
-    if ($this->_acl->hasField('L_APPOITMENT_USER')) {
+    if (!empty($orWhere) && $this->_acl->hasField('L_APPOITMENT_USER')) {
       $orWhere[] = ['L_APPOITMENT_USER', '=', $userLogin];
     }
     return (!empty($orWhere)) ? [null, 'or', $orWhere] : null;