public function getAccessListItems($accessType = PagePermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = array())
 {
     $db = Loader::db();
     $list = parent::getAccessListItems($accessType, $filterEntities);
     $list = PermissionDuration::filterByActive($list);
     foreach ($list as $l) {
         $pe = $l->getAccessEntityObject();
         $prow = $db->GetRow('select permission from PagePermissionThemeAccessList where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
         if (is_array($prow) && $prow['permission']) {
             $l->setThemesAllowedPermission($prow['permission']);
             $permission = $prow['permission'];
         } else {
             if ($l->getAccessType() == PagePermissionKey::ACCESS_TYPE_INCLUDE) {
                 $l->setThemesAllowedPermission('A');
             } else {
                 $l->setThemesAllowedPermission('N');
             }
         }
         if ($permission == 'C') {
             $pThemeIDs = $db->GetCol('select pThemeID from PagePermissionThemeAccessListCustom where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
             $l->setThemesAllowedArray($pThemeIDs);
         }
     }
     return $list;
 }
Esempio n. 2
0
 public function getAccessListItems($accessType = PagePermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = array())
 {
     $db = Database::connection();
     $list = parent::getAccessListItems($accessType, $filterEntities);
     $list = PermissionDuration::filterByActive($list);
     foreach ($list as $l) {
         $pe = $l->getAccessEntityObject();
         $prow = $db->fetchAssoc('select permission, externalLink from PagePermissionPageTypeAccessList where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
         if (is_array($prow) && $prow['permission']) {
             $l->setPageTypesAllowedPermission($prow['permission']);
             $l->setAllowExternalLinks($prow['externalLink']);
             $permission = $prow['permission'];
         } elseif ($l->getAccessType() == PagePermissionKey::ACCESS_TYPE_INCLUDE) {
             $l->setPageTypesAllowedPermission('A');
             $l->setAllowExternalLinks(1);
         } else {
             $l->setPageTypesAllowedPermission('N');
             $l->setAllowExternalLinks(0);
         }
         if ($permission == 'C') {
             $ptIDs = $db->GetCol('select ptID from PagePermissionPageTypeAccessListCustom where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
             $l->setPageTypesAllowedArray($ptIDs);
         }
     }
     return $list;
 }
 public function getAccessListItems($accessType = PagePermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = [], $checkCache = true)
 {
     $db = Database::connection();
     $list = parent::getAccessListItems($accessType, $filterEntities);
     $list = PermissionDuration::filterByActive($list);
     foreach ($list as $l) {
         $pe = $l->getAccessEntityObject();
         $prow = $db->fetchAssoc('select permission from PagePermissionThemeAccessList where peID = ? and paID = ?', [$pe->getAccessEntityID(), $l->getPermissionAccessID()]);
         if ($prow && $prow['permission']) {
             $l->setThemesAllowedPermission($prow['permission']);
             $permission = $prow['permission'];
             if ($permission == 'C') {
                 $pThemeIDs = $db->GetCol('select pThemeID from PagePermissionThemeAccessListCustom where peID = ? and paID = ?', [$pe->getAccessEntityID(), $l->getPermissionAccessID()]);
                 $l->setThemesAllowedArray($pThemeIDs);
             }
         } elseif ($l->getAccessType() == PagePermissionKey::ACCESS_TYPE_INCLUDE) {
             $l->setThemesAllowedPermission('A');
         } else {
             $l->setThemesAllowedPermission('N');
         }
     }
     return $list;
 }
 public function getAccessListItems($accessType = PagePermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = array())
 {
     $db = Database::connection();
     $list = parent::getAccessListItems($accessType, $filterEntities);
     $list = PermissionDuration::filterByActive($list);
     foreach ($list as $l) {
         $pe = $l->getAccessEntityObject();
         $prow = $db->GetRow('select attributePermission, name, publicDateTime, uID, description, paths from PagePermissionPropertyAccessList where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
         $attributePermission = '';
         if (!empty($prow) && $prow['attributePermission']) {
             $l->setAttributesAllowedPermission($prow['attributePermission']);
             $l->setAllowEditName($prow['name']);
             $l->setAllowEditDateTime($prow['publicDateTime']);
             $l->setAllowEditUserID($prow['uID']);
             $l->setAllowEditDescription($prow['description']);
             $l->setAllowEditPaths($prow['paths']);
             $attributePermission = $prow['attributePermission'];
         } elseif ($l->getAccessType() == PagePermissionKey::ACCESS_TYPE_INCLUDE) {
             $l->setAttributesAllowedPermission('A');
             $l->setAllowEditName(1);
             $l->setAllowEditDateTime(1);
             $l->setAllowEditUserID(1);
             $l->setAllowEditDescription(1);
             $l->setAllowEditPaths(1);
         } else {
             $l->setAttributesAllowedPermission('N');
             $l->setAllowEditName(0);
             $l->setAllowEditDateTime(0);
             $l->setAllowEditUserID(0);
             $l->setAllowEditDescription(0);
             $l->setAllowEditPaths(0);
         }
         if ($attributePermission == 'C') {
             $akIDs = $db->GetCol('select akID from PagePermissionPropertyAttributeAccessListCustom where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
             $l->setAttributesAllowedArray($akIDs);
         }
     }
     return $list;
 }