Ignore:
Timestamp:
08/05/09 18:20:55 (15 years ago)
Author:
eduardoalex
Message:

Ticket #453 - Edição de grupos compartilhados.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/preferences/inc/class.uiaclprefs2.inc.php

    r496 r1280  
    101101                                $to_remove = unserialize(urldecode($processed)); 
    102102 
    103                                 for($i=0;$i<count($to_remove);$i++)                              
    104                                         $this->acl->delete($GLOBALS['phpgw_info']['flags']['currentapp'],$to_remove[$i]); 
    105                                  
     103                                /* User records */ 
     104                                $user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
    106105                                /* Group records */ 
    107106                                $group_variable = $_POST['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
     107                                $keys_to_keep = array(); 
     108                                if(!empty($user_variable)) { 
     109                                        foreach($user_variable as $key_user=>$value) { 
     110                                                $temp = explode("_",$key_user); 
     111                                                $keys_to_keep[(int)$temp[0]] = 1; 
     112                                        } 
     113                                } 
     114                                 
     115                                for($i=0;$i<count($to_remove);$i++) { 
     116                                         
     117                                        if(!array_key_exists((int)$to_remove[$i],$keys_to_keep)) { 
     118                                                $this->acl->persist_shared_groups($to_remove[$i]); 
     119                                        }                
     120                                        $this->acl->delete($GLOBALS['phpgw_info']['flags']['currentapp'],$to_remove[$i]); 
     121                                } 
     122                                 
     123                                /* Group records */ 
     124                                //$group_variable = $_POST['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
    108125 
    109126                                if (!$group_variable)                            
     
    120137                                        if($is_group) 
    121138                                                $rights &= ~PHPGW_ACL_PRIVATE; 
     139                                        if(array_key_exists($user_id,$keys_to_keep)) 
     140                                                if(($rights & 1) == 0) { 
     141                                                        $this->acl->persist_shared_groups($user_id); 
     142                                                } 
    122143                                        $this->acl->add($GLOBALS['phpgw_info']['flags']['currentapp'],$group_id,$rights); 
    123144                                } 
    124145 
    125146                                /* User records */ 
    126                                 $user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
     147                                //$user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
    127148 
    128149                                if (!$user_variable)                             
Note: See TracChangeset for help on using the changeset viewer.