Exemplo n.º 1
0
 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, 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'];
         } else {
             if ($l->getAccessType() == PagePermissionKey::ACCESS_TYPE_INCLUDE) {
                 $l->setPageTypesAllowedPermission('A');
                 $l->setAllowExternalLinks(1);
             } else {
                 $l->setPageTypesAllowedPermission('N');
                 $l->setAllowExternalLinks(0);
             }
         }
         if ($permission == 'C') {
             $ctIDs = $db->GetCol('select ctID from PagePermissionPageTypeAccessListCustom where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
             $l->setPageTypesAllowedArray($ctIDs);
         }
     }
     return $list;
 }
Exemplo n.º 2
0
 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 attributePermission, name, publicDateTime, uID, description, paths from PagePermissionPropertyAccessList where peID = ? and paID = ?', array($pe->getAccessEntityID(), $l->getPermissionAccessID()));
         if (is_array($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'];
         } else {
             if ($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;
 }