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;
 }
 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;
 }
Beispiel #4
0
 public function getPermissionObjectIdentifier()
 {
     // this is a hack but it's a really good one for performance
     // if the permission access entity for page owner exists in the database, then we return the collection ID. Otherwise, we just return the permission collection id
     // this is because page owner is the ONLY thing that makes it so we can't use getPermissionsCollectionID, and for most sites that will DRAMATICALLY reduce the number of queries.
     if (\Concrete\Core\Permission\Access\PageAccess::usePermissionCollectionIDForIdentifier()) {
         return $this->getPermissionsCollectionID();
     } else {
         return $this->getCollectionID();
     }
 }
 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;
 }