phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php, 1.11, 1.12 clas


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php, 1.11, 1.12 class.boadmin.inc.php, 1.10, 1.11
Date: Fri, 18 Jul 2003 14:10:05 -0400

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv29386/inc

Modified Files:
        class.acl2.inc.php class.boadmin.inc.php 
Log Message:
no message

Index: class.acl2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.acl2.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.acl2.inc.php  14 Jul 2003 09:07:41 -0000      1.11
--- class.acl2.inc.php  18 Jul 2003 18:10:03 -0000      1.12
***************
*** 53,57 ****
                }
  
!               function cache_rights()
                {
                        $expected_args[0] = 
Array('name'=>'location','default'=>'##REQUIRED##', 'type'=>'alphanumeric');
--- 53,57 ----
                }
  
!               function cache_rights_org()
                {
                        $expected_args[0] = 
Array('name'=>'location','default'=>'##REQUIRED##', 'type'=>'alphanumeric');
***************
*** 114,117 ****
--- 114,173 ----
                }
  
+               function cache_rights()
+               {
+                       $expected_args[0] = 
Array('name'=>'location','default'=>'##REQUIRED##', 'type'=>'alphanumeric');
+                       $expected_args[1] = 
Array('name'=>'app_id','default'=>$this->app_id, 'type'=>'number');
+                       $expected_args[2] = 
Array('name'=>'account_id','default'=>$this->account_id, 'type'=>'number');
+                       $expected_args[3] = 
Array('name'=>'owner_id','default'=>False, 'type'=>'number');
+ 
+                       $recieved_args = func_get_args();
+                       $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
+ 
+                       
if(isset($this->rights_cache[$args['app_id']][$args['account_id']][$args['location']]))
+                       {
+                               return;
+                       }
+ 
+                       $sql = "SELECT 
acl_rights,acl_type,acl_data,acl_location FROM fm_acl2 WHERE (acl_appid = 
'".$args['app_id']."' ";
+                       $sql .= " and (acl_account in 
(".$args['account_id']."".$this->memberships_sql.'))';
+                       $sql .= " and acl_location = '". $args['location'] . 
"'";
+ 
+                       if($args['owner_id']>0)
+                       {
+                               $sql .= " and (owner_id=" . $args['owner_id'] . 
")";
+                       }
+                       else
+                       {
+                               $sql .= " and (owner_id is NULL)";
+                       }
+ 
+                       $sql .= ') ORDER BY acl_location, acl_type DESC';
+ 
+ //echo $sql;
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       
if($this->rights_cache[$args['app_id']][$args['account_id']][$args['location']] 
== 0)
+                       {
+                               
$this->masks_cache[$args['app_id']][$args['account_id']][$this->db->f('acl_location')]
 = 0;
+                               
$this->rights_cache[$args['app_id']][$args['account_id']][$this->db->f('acl_location')]
 = 0;
+                       }
+ 
+                       if((int)$this->db->f('acl_type') == 0)
+                       {
+                               
$this->rights_cache[$args['app_id']][$args['account_id']][$this->db->f('acl_location')]
 = 
$this->bit_set($this->rights_cache[$args['app_id']][$args['account_id']][$this->db->f('acl_location')],(int)$this->db->f('acl_rights'));
+                       }
+                       else
+                       {
+                               
$this->masks_cache[$args['app_id']][$args['account_id']][$this->db->f('acl_location')]
 = 
$this->bit_set($this->rights_cache[$args['app_id']][$args['account_id']][$this->db->f('acl_location')],(int)$this->db->f('acl_rights'));
+                       }
+                       if(!$this->db->f('acl_rights'))
+                       {
+                               
$this->rights_cache[$args['app_id']][$args['account_id']][$args['location']]=0;
+ 
+                       }
+ //_debug_array($this->rights_cache);
+ 
+               }
+ 
                function get_location_list()
                {
***************
*** 123,127 ****
                        $recieved_args = func_get_args();
                        $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
- 
                        if(!strstr($args['location'], '.'))
                        {
--- 179,182 ----
***************
*** 212,216 ****
                        $recieved_args = func_get_args();
                        $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
- 
                        if(!$args['no_membership'])
                        {
--- 267,270 ----
***************
*** 453,456 ****
--- 507,511 ----
                        $recieved_args = func_get_args();
                        $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
+ //_debug_array($args);
                        $sql = "SELECT acl_rights, acl_location FROM fm_acl2 
WHERE (acl_appid = '".$args['app_id']."' ";
                        $sql .= " and acl_account = ".$args['account_id'];

Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.boadmin.inc.php       10 Jul 2003 21:11:38 -0000      1.10
--- class.boadmin.inc.php       18 Jul 2003 18:10:03 -0000      1.11
***************
*** 229,233 ****
                        }
  
- 
  //    $this->acl2->check('.invoice.test', $rights,$user_id);
  //    echo 'rights_cache:<pre>'; print_r($this->acl2->rights_cache); echo 
'</pre>';
--- 229,232 ----
***************
*** 391,395 ****
                                }
  
- //_debug_array($this->app_id);
                                if(is_array($users))
                                {
--- 390,393 ----
***************
*** 446,450 ****
  
                        }
- 
  
                        $this->total_records = count($user_list);
--- 444,447 ----





reply via email to

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