Ejemplo n.º 1
0
 public static function getAccessEntitiesForUser($user)
 {
     $entities = array();
     $db = Loader::db();
     if ($user->isRegistered()) {
         $pae = ParentPageOwnerPermissionAccessEntity::getOrCreate();
         $r = $db->GetOne('select cID from Pages where uID = ?', array($user->getUserID()));
         if ($r > 0) {
             $entities[] = $pae;
         }
     }
     return $entities;
 }
Ejemplo n.º 2
0
<?php

defined('C5_EXECUTE') or die("Access Denied.");
if (Loader::helper('validation/token')->validate('process')) {
    $js = Loader::helper('json');
    $obj = new stdClass();
    $pae = ParentPageOwnerPermissionAccessEntity::getOrCreate();
    $obj->peID = $pae->getAccessEntityID();
    $obj->label = $pae->getAccessEntityLabel();
    print $js->encode($obj);
}