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.3,1.4 class.bo


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php,1.3,1.4 class.boadmin.inc.php,1.3,1.4 class.uiadmin.inc.php,1.4,1.5
Date: Mon, 10 Mar 2003 04:17:13 -0500

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

Modified Files:
        class.acl2.inc.php class.boadmin.inc.php class.uiadmin.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.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.acl2.inc.php  9 Mar 2003 17:39:37 -0000       1.3
--- class.acl2.inc.php  10 Mar 2003 09:17:08 -0000      1.4
***************
*** 1,7 ****
  <?php
- 
- //$GLOBALS['phpgw_info']['flags']['currentapp'] = 1; //need to replace with 
real default
- //$GLOBALS['phpgw_info']['user']['userid'] = 1; //need to replace with real 
default
- 
        class acl2
        {
--- 1,3 ----
***************
*** 62,66 ****
                        $recieved_args = func_get_args();
                        $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
- //_debug_array($args);
  
                        
if(isset($this->rights_cache[$args['app_id']][$args['account_id']][$args['location']]))
--- 58,61 ----
***************
*** 74,78 ****
                        $sql .= ') ORDER BY acl_location, acl_type DESC';
  
- //echo $sql . '<br><br>';
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())
--- 69,72 ----
***************
*** 80,87 ****
                                
if($this->rights_cache[$args['app_id']][$args['account_id']][$args['location']] 
== 0)
                                {
- //    _debug_array($this->rights_cache);
                                if ($this->previous_location != '')
                                        {
!                                               
$this->rights_cache[$args['app_id']][$this->db->f('acl_account')][$this->db->f('acl_location')]
 = 
$this->bit_mask($this->rights_cache[$args['app_id']][$args['account_id']][$this->previous_location],
 
$this->masks_cache[$args['app_id']][$args['account_id']][$this->previous_location]);
  
                                        }
--- 74,80 ----
                                
if($this->rights_cache[$args['app_id']][$args['account_id']][$args['location']] 
== 0)
                                {
                                if ($this->previous_location != '')
                                        {
!                                               
$this->rights_cache[$args['app_id']][$args['account_id']][$this->db->f('acl_location')]
 = 
$this->bit_mask($this->rights_cache[$args['app_id']][$args['account_id']][$this->previous_location],
 
$this->masks_cache[$args['app_id']][$args['account_id']][$this->previous_location]);
  
                                        }
***************
*** 103,107 ****
  
                                $this->previous_location = 
$this->db->f('acl_location');
- //    echo $this->previous_location . '<br><br>';
                        }
                        $this->previous_location = '';
--- 96,99 ----

Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.boadmin.inc.php       8 Mar 2003 22:23:15 -0000       1.3
--- class.boadmin.inc.php       10 Mar 2003 09:17:09 -0000      1.4
***************
*** 137,144 ****
  
  
!               function set_permission($user_id,$rights)
                {
!                       $this->acl2->set($this->location,$rights,$user_id,0);
                        $message = lang('permissions are updated!');
                }
  
--- 137,184 ----
  
  
!               function set_permission($values,$r_processed)
                {
!                       $r_processed=explode("_",$r_processed);
! 
!                       if(!$values)
!                       {
!                               $values = array();
!                       }
!                       @reset($values);
!                       $totalacl = array();
!                       while(list($rowinfo,$perm) = each($values))
!                       {
!                               list($user_id,$rights) = split('_',$rowinfo);
!                               $totalacl[$user_id] += $rights;
!                       }
!                       @reset($totalacl);
!                       while(list($user_id,$rights) = @each($totalacl))
!                       {
!                               $user_checked[]=$user_id;
! 
!                               
$this->acl2->set($this->location,$rights,$user_id,0);
!                       }
! 
!                       if(is_array($r_processed) && is_array($user_checked))
!                       {
!                               $user_delete    = array_diff($r_processed, 
$user_checked);
!                       }
!                       else
!                       {
!                               $user_delete    = $r_processed;
!                       }
!                       if(is_array($user_delete) && count($user_delete)>0)
!                       {
!                               $user_delete= explode("_",implode("_", 
$user_delete));
! 
!                               $this->remove_permission($user_delete);
!                       }
! 
! 
! //    $this->acl2->check('.invoice.test', $rights,$user_id);
! //    echo 'rights_cache:<pre>'; print_r($this->acl2->rights_cache); echo 
'</pre>';
! 
                        $message = lang('permissions are updated!');
+                       return $message;
                }
  

Index: class.uiadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiadmin.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.uiadmin.inc.php       8 Mar 2003 22:23:15 -0000       1.4
--- class.uiadmin.inc.php       10 Mar 2003 09:17:09 -0000      1.5
***************
*** 75,121 ****
                        $submit         = get_var('submit',array('POST'));
  
-                       $r_processed=explode("_",$r_processed);
- 
                        if($submit)
                        {
!                               if(!$values)
!                               {
!                                       $values = array();
!                               }
!                               @reset($values);
!                               $totalacl = array();
!                               while(list($rowinfo,$perm) = each($values))
!                               {
!                                       list($user_id,$rights) = 
split('_',$rowinfo);
!                                       $totalacl[$user_id] += $rights;
!                               }
!                               @reset($totalacl);
!                               while(list($user_id,$rights) = @each($totalacl))
!                               {
! 
!                                       $user_checked[]=$user_id;
! //echo 'user_id: ' . $user_id .'<br>';
! //echo 'rights: ' . $rights .'<br>';
! 
!                                       
$this->bo->set_permission($user_id,$rights);
!                               }
! 
!                               if(is_array($r_processed) && 
is_array($user_checked))
!                               {
!                                       $user_delete    = 
array_diff($r_processed, $user_checked);
!                               }
!                               else
!                               {
!                                       $user_delete    = $r_processed;
!                               }
! 
!                               if(is_array($user_delete) && 
count($user_delete)>0)
!                               {
!                                       $user_delete= explode("_",implode("_", 
$user_delete));
! 
!                                       
$this->bo->remove_permission($user_delete);
!                               }
! 
!                               $message = lang('permissions are updated!');
                        }
  
--- 75,81 ----
                        $submit         = get_var('submit',array('POST'));
  
                        if($submit)
                        {
!                               $message        = 
$this->bo->set_permission($values,$r_processed);
                        }
  





reply via email to

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