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.5,1.6 class.bo


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php,1.5,1.6 class.boadmin.inc.php,1.7,1.8 class.uiadmin.inc.php,1.12,1.13
Date: Thu, 03 Jul 2003 05:40:43 -0400

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv30158/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.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.acl2.inc.php  10 Mar 2003 13:23:25 -0000      1.5
--- class.acl2.inc.php  3 Jul 2003 09:40:41 -0000       1.6
***************
*** 6,10 ****
                var $app_id;
                var $memberships = Array(0=>1); //group 0 is for all users
!               var $memberships_sql = '0'; //group 0 is for all users
                var $rights_cache = Array();
                var $masks_cache = Array();
--- 6,10 ----
                var $app_id;
                var $memberships = Array(0=>1); //group 0 is for all users
!               var $memberships_sql = ',0'; //group 0 is for all users
                var $rights_cache = Array();
                var $masks_cache = Array();
***************
*** 68,72 ****
  
                        $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 
(".$this->get_location_list($args['location'],$args['app_id'],$args['account_id']).")";
                        $sql .= ') ORDER BY acl_location, acl_type DESC';
--- 68,72 ----
  
                        $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 
(".$this->get_location_list($args['location'],$args['app_id'],$args['account_id']).")";
                        $sql .= ') ORDER BY acl_location, acl_type DESC';
***************
*** 170,173 ****
--- 170,186 ----
                        $recieved_args = func_get_args();
                        $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
+ 
+                       $memberships = 
$GLOBALS['phpgw']->accounts->membership($args['account_id']);
+ 
+                       while (is_array($memberships) && list(,$account) = 
each($memberships))
+                       {
+                               $member_of[] = $account['account_id'];
+                       }
+ 
+                       if($member_of)
+                       {
+                               $this->memberships_sql = ',' . 
@implode(",",$member_of);
+                       }
+ 
                        
$this->cache_rights($args['location'],$args['app_id'],$args['account_id']);
                        return 
$this->bit_check($this->rights_cache[$args['app_id']][$args['account_id']][$args['location']],$args['required']);

Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.boadmin.inc.php       1 Jul 2003 09:01:50 -0000       1.7
--- class.boadmin.inc.php       3 Jul 2003 09:40:41 -0000       1.8
***************
*** 143,146 ****
--- 143,191 ----
                }
  
+               function select_category_list($format='',$selected='')
+               {
+                       switch($format)
+                       {
+                               case 'select':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+                                       break;
+                               case 'filter':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+                                       break;
+                       }
+ 
+ 
+                       $categories[0]['id']    = 'groups';
+                       $categories[0]['name']  = lang('Groups');
+                       $categories[1]['id']    = 'accounts';
+                       $categories[1]['name']  = lang('Users');
+ 
+                       while (is_array($categories) && list(,$category) = 
each($categories))
+                       {
+                               $sel_category = '';
+                               if ($category['id']==$selected)
+                               {
+                                       $sel_category = 'selected';
+                               }
+ 
+                               $category_list[] = array
+                               (
+                                       'cat_id'        => $category['id'],
+                                       'name'          => $category['name'],
+                                       'selected'      => $sel_category
+                               );
+                       }
+ 
+                       for ($i=0;$i<count($category_list);$i++)
+                       {
+                               if ($category_list[$i]['selected'] != 
'selected')
+                               {
+                                       unset($category_list[$i]['selected']);
+                               }
+                       }
+ 
+                       return $category_list;
+               }
+ 
                function set_permission($values,$r_processed,$initials)
                {
***************
*** 209,246 ****
                {
  
!                       $allusers = 
$GLOBALS['phpgw']->accounts->get_list('accounts', $this->start, ASC, 
$this->order, $this->query);
  
! //_debug_array($allusers);
  
!                       $this->total_records = count($allusers);
  
!       //              $this->acl2->get_memberships();
  
!                       $right=$this->right;
  
!                       if(is_array($allusers))
!                       {
!                               $j=0;
!                               while (list($null,$account) = each($allusers))
!                               {
! //                                    $user_list[$j]['counter']               
        = $j;
!                                       $user_list[$j]['type']                  
        = 'accounts';
!                                       $user_list[$j]['account_id']            
= $account['account_id'];
!                                       $user_list[$j]['account_lid']           
= $account['account_lid'];
!                                       $user_list[$j]['account_firstname'] = 
$account['account_firstname'];
!                                       $user_list[$j]['account_lastname']      
= $account['account_lastname'];
!                                       $user_list[$j]['initials']              
        = $this->so->get_initials($account['account_id']);
  
!                                       for ($i=0;$i<count($right);$i++)
                                        {
!                                               
if($this->acl2->check($this->location, $right[$i],$account['account_id']))
                                                {
!                                                       
$user_list[$j]['right'][$right[$i]] = 'checked';
                                                }
                                        }
  
!                                       $j++;
                                }
                        }
  
  //_debug_array($user_list);
--- 254,346 ----
                {
  
!                       $right=$this->right;
  
!                       if(!$this->cat_id)
!                       {
  
!                               $users = 
$GLOBALS['phpgw']->accounts->get_list('accounts', $this->start,$this->sort, 
$this->order, $this->query);
!                               $groups = 
$GLOBALS['phpgw']->accounts->get_list('groups', $this->start,$this->sort, 
$this->order, $this->query);
  
!                               if(is_array($groups))
!                               {
!                                       $j=0;
!                                       while (list($null,$account) = 
each($groups))
!                                       {
!                                               $user_list[$j]['type']          
                = 'groups';
!                                               $user_list[$j]['account_id']    
        = $account['account_id'];
!                                               $user_list[$j]['account_lid']   
        = $account['account_lid'];
!                                               
$user_list[$j]['account_firstname'] = $account['account_firstname'];
!                                               
$user_list[$j]['account_lastname']      = $account['account_lastname'];
  
!                                               for ($i=0;$i<count($right);$i++)
!                                               {
!                                                       
if($this->acl2->check($this->location, $right[$i],$account['account_id']))
!                                                       {
!                                                               
$user_list[$j]['right'][$right[$i]] = 'checked';
!                                                       }
!                                               }
  
!                                               $j++;
!                                       }
!                               }
  
! //_debug_array($users);
!                               if(is_array($users))
!                               {
!                                       while (list($null,$account) = 
each($users))
                                        {
!                                               $user_list[$j]['type']          
                = 'accounts';
!                                               $user_list[$j]['account_id']    
        = $account['account_id'];
!                                               $user_list[$j]['account_lid']   
        = $account['account_lid'];
!                                               
$user_list[$j]['account_firstname'] = $account['account_firstname'];
!                                               
$user_list[$j]['account_lastname']      = $account['account_lastname'];
!                                               $user_list[$j]['initials']      
                = $this->so->get_initials($account['account_id']);
! 
!                                               for ($i=0;$i<count($right);$i++)
                                                {
!                                                       
if($this->acl2->check($this->location, $right[$i],$account['account_id']))
!                                                       {
!                                                               
$user_list[$j]['right'][$right[$i]] = 'checked';
!                                                       }
                                                }
+ 
+                                               $j++;
                                        }
+                               }
  
!                       }
!                       else
!                       {
!                               $allusers = 
$GLOBALS['phpgw']->accounts->get_list($this->cat_id, $this->start,$this->sort, 
$this->order, $this->query);
! 
! //_debug_array($allusers);
!                               if(is_array($allusers))
!                               {
!                                       $j=0;
!                                       while (list($null,$account) = 
each($allusers))
!                                       {
!                                               $user_list[$j]['type']          
                = $this->cat_id;
!                                               $user_list[$j]['account_id']    
        = $account['account_id'];
!                                               $user_list[$j]['account_lid']   
        = $account['account_lid'];
!                                               
$user_list[$j]['account_firstname'] = $account['account_firstname'];
!                                               
$user_list[$j]['account_lastname']      = $account['account_lastname'];
!                                               $user_list[$j]['initials']      
                = $this->so->get_initials($account['account_id']);
! 
!                                               for ($i=0;$i<count($right);$i++)
!                                               {
!                                                       
if($this->acl2->check($this->location, $right[$i],$account['account_id']))
!                                                       {
!                                                               
$user_list[$j]['right'][$right[$i]] = 'checked';
!                                                       }
!                                               }
! 
!                                               $j++;
!                                       }
                                }
+ 
                        }
+ 
+ 
+                       $this->total_records = count($user_list);
  
  //_debug_array($user_list);

Index: class.uiadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiadmin.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.uiadmin.inc.php       1 Jul 2003 09:01:50 -0000       1.12
--- class.uiadmin.inc.php       3 Jul 2003 09:40:41 -0000       1.13
***************
*** 34,39 ****
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
  
-                       $this->grants                           = 
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
-                       $this->grants[$this->account] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
                        $this->bo                                       = 
CreateObject($this->currentapp.'.boadmin',true);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
--- 34,37 ----
***************
*** 75,81 ****
                        $initials               = 
get_var('initials',array('POST'));
  
!                       $submit         = get_var('submit',array('POST'));
  
!                       if($submit)
                        {
                                $receipt        = 
$this->bo->set_permission($values,$r_processed,$initials);
--- 73,79 ----
                        $initials               = 
get_var('initials',array('POST'));
  
!                       $set_permission = 
get_var('set_permission',array('POST'));
  
!                       if($set_permission)
                        {
                                $receipt        = 
$this->bo->set_permission($values,$r_processed,$initials);
***************
*** 108,112 ****
                                }
  
!                               $processed=implode("_", $processed);
                        }
  
--- 106,110 ----
                                }
  
!                               address@hidden("_", $processed);
                        }
  
***************
*** 121,124 ****
--- 119,124 ----
                                                                                
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin.list_acl2',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'module'                
=> $this->location,
                                                                                
                                                        'submodule_id'  
=>$this->submodule_id)
                                                                                
)),
***************
*** 130,133 ****
--- 130,135 ----
                                                                                
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl2',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'module'                
=> $this->location,
                                                                                
                                                        'submodule_id'  
=>$this->submodule_id)
                                                                                
)),
***************
*** 139,142 ****
--- 141,146 ----
                                                                                
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl2',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'module'                
=> $this->location,
                                                                                
                                                        'submodule_id'  
=>$this->submodule_id)
                                                                                
)),
***************
*** 160,164 ****
                        (
                                'menuaction'    => 
$this->currentapp.'.uiadmin.list_acl2',
!                               'module'        => $this->location
                        );
  
--- 164,174 ----
                        (
                                'menuaction'    => 
$this->currentapp.'.uiadmin.list_acl2',
!                                               'sort'                  
=>$this->sort,
!                                               'order'                 
=>$this->order,
!                                               'cat_id'                
=>$this->cat_id,
!                                               'filter'                
=>$this->filter,
!                                               'query'                 
=>$this->query,
!                                               'module'                => 
$this->location
! 
                        );
  
***************
*** 182,185 ****
--- 192,203 ----
                                'link_url'                                      
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.list_acl2'),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
+ 
+                               'lang_no_cat'                                   
=> lang('no category'),
+                               'lang_cat_statustext'                   => 
lang('Select the category the permissions belongs to. To do not use a category 
select NO CATEGORY'),
+                               'select_name'                                   
=> 'cat_id',
+                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'cat_id'                                        
        => $this->cat_id,
+ 
                                'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
                                'lang_searchbutton_statustext'  => lang('Submit 
the search string'),





reply via email to

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