fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7131] property: grants on categories


From: Sigurd Nes
Subject: [Fmsystem-commits] [7131] property: grants on categories
Date: Mon, 21 Mar 2011 19:57:15 +0000

Revision: 7131
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7131
Author:   sigurdne
Date:     2011-03-21 19:57:14 +0000 (Mon, 21 Mar 2011)
Log Message:
-----------
property: grants on categories

Modified Paths:
--------------
    trunk/property/inc/class.sotts.inc.php

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2011-03-17 14:16:53 UTC (rev 
7130)
+++ trunk/property/inc/class.sotts.inc.php      2011-03-21 19:57:14 UTC (rev 
7131)
@@ -177,28 +177,25 @@
 
                        $filtermethod = '';
 
-                       $categories = 
$GLOBALS['phpgw']->locations->get_subs('property', '.ticket.category');
-
-                       $grant_category = array();
-                       foreach ($categories as $location)
-                       {
-                               if ($GLOBALS['phpgw']->acl->check($location, 
PHPGW_ACL_READ, 'property'))
-                               {
-                                       $category = explode('.',$location);
-                                       $grant_category[] = $category[3];
-                               }
-                       }
-
-                       $grant_category[] = -1;//If no one found - not breaking 
the query
-
                        $where= 'WHERE';
 
                        $GLOBALS['phpgw']->config->read();
 
+                       $public_user_list = array();
                        
if(isset($GLOBALS['phpgw']->config->config_data['acl_at_tts_category']) && 
$GLOBALS['phpgw']->config->config_data['acl_at_tts_category'])
                        {
-                               $filtermethod = " WHERE fm_tts_tickets.cat_id 
IN (" . implode(",", $grant_category) . ")";
-                               $where= 'AND';
+                               $categories = 
$GLOBALS['phpgw']->locations->get_subs('property', '.ticket.category');
+
+                               $category_grants = array();
+                               foreach ($categories as $location)
+                               {
+                                       $category_grants        = 
array_merge($category_grants, 
$GLOBALS['phpgw']->acl->get_grants('property',$location));
+                               }
+
+                               foreach($category_grants as $user => $right)
+                               {
+                                       $public_user_list[] = $user;
+                               }
                        }
 
                        
if(isset($GLOBALS['phpgw']->config->config_data['acl_at_location']) && 
$GLOBALS['phpgw']->config->config_data['acl_at_location'])
@@ -218,9 +215,14 @@
                                {
                                        $public_user_list[] = $user;
                                }
+                       }
+                       
+                       if($public_user_list)
+                       {
+                               $public_user_list = 
array_unique($public_user_list);
                                reset($public_user_list);
                                $filtermethod .= " $where ( 
fm_tts_tickets.user_id IN(" . implode(',',$public_user_list) . "))";
-                               $where= 'AND';
+                               $where= 'AND';                  
                        }
 
                        if($tenant_id = 
$GLOBALS['phpgw']->session->appsession('tenant_id','property'))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]