Exemplo n.º 1
0
 public function getSearchResultFromQuery(Query $query)
 {
     $result = parent::getSearchResultFromQuery($query);
     $u = new \User();
     if (!$u->isSuperUser()) {
         $gIDs = array(-1);
         $gs = new GroupList();
         $groups = $gs->getResults();
         foreach ($groups as $g) {
             $gp = new \Permissions($g);
             if ($gp->canSearchUsersInGroup()) {
                 $gIDs[] = $g->getGroupID();
             }
         }
         $result->getItemListObject()->getQueryObject()->leftJoin("u", "UserGroups", "ugRequired", "ugRequired.uID = u.uID");
         $groups = 'ugRequired.gID in (' . implode(',', $gIDs) . ')';
         $gg = \Group::getByID(REGISTERED_GROUP_ID);
         $ggp = new \Permissions($gg);
         if ($ggp->canSearchUsersInGroup()) {
             $null = 'ugRequired.gID is null';
         }
         $result->getItemListObject()->getQueryObject()->select('distinct (u.uID)');
         $expr = $result->getItemListObject()->getQueryObject()->expr()->orX($groups, $null);
         $result->getItemListObject()->getQueryObject()->andwhere($expr);
     }
     return $result;
 }
Exemplo n.º 2
0
 public function __construct(Entity $entity, ExpressCategory $category, Session $session)
 {
     $this->entity = $entity;
     $this->category = $category;
     parent::__construct($session);
 }
Exemplo n.º 3
0
 public function __construct(FileCategory $category, Session $session)
 {
     $this->category = $category;
     parent::__construct($session);
 }