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.7, 1.8 class.


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php, 1.7, 1.8 class.boadmin.inc.php, 1.9, 1.10 class.solocation.inc.php, 1.20, 1.21 class.uiadmin.inc.php, 1.13, 1.14 hook_preferences.inc.php, 1.4, 1.5
Date: Thu, 10 Jul 2003 17:11:40 -0400

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

Modified Files:
        class.acl2.inc.php class.boadmin.inc.php 
        class.solocation.inc.php class.uiadmin.inc.php 
        hook_preferences.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.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.acl2.inc.php  3 Jul 2003 21:53:10 -0000       1.7
--- class.acl2.inc.php  10 Jul 2003 21:11:38 -0000      1.8
***************
*** 58,61 ****
--- 58,62 ----
                        $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();
***************
*** 70,73 ****
--- 71,84 ----
                        $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']).")";
+ 
+                       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';
  
***************
*** 162,165 ****
--- 173,206 ----
                }
  
+               function check_grant()
+               {
+                       $expected_args[0] = 
Array('name'=>'owner_id','default'=>$this->account_id, 'type'=>'number');
+                       $expected_args[1] = 
Array('name'=>'location','default'=>'##REQUIRED##', 'type'=>'alphanumeric');
+                       $expected_args[2] = 
Array('name'=>'required','default'=>1, 'type'=>'number');
+                       $expected_args[3] = 
Array('name'=>'account_id','default'=>$this->account_id, 'type'=>'number');
+                       $expected_args[4] = 
Array('name'=>'app_id','default'=>$this->app_id, 'type'=>'number');
+                       $expected_args[5] = 
Array('name'=>'no_membership','default'=>false, 'type'=>'number');
+                       $recieved_args = func_get_args();
+                       $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
+ 
+                       if(!$args['no_membership'])
+                       {
+                               $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'],$args['owner_id']);
+                       return 
$this->bit_check($this->rights_cache[$args['app_id']][$args['account_id']][$args['location']],$args['required']);
+               }
+ 
                function check()
                {
***************
*** 214,218 ****
                        $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
                        $sql .= " and acl_account = ".$args['account_id'];
!                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type'].")";
                        $this->db->query($sql,__LINE__,__FILE__);
                        if($this->db->num_rows() != 0)
--- 255,259 ----
                        $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
                        $sql .= " and acl_account = ".$args['account_id'];
!                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type']." and owner_id is NULL)";
                        $this->db->query($sql,__LINE__,__FILE__);
                        if($this->db->num_rows() != 0)
***************
*** 245,249 ****
                        $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
                        $sql .= " and acl_account = ".$args['account_id'];
!                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type'].")";
                        $this->db->query($sql,__LINE__,__FILE__);
                        if($this->db->num_rows() != 0)
--- 286,290 ----
                        $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
                        $sql .= " and acl_account = ".$args['account_id'];
!                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type']." and owner_id is NULL)";
                        $this->db->query($sql,__LINE__,__FILE__);
                        if($this->db->num_rows() != 0)
***************
*** 272,275 ****
--- 313,357 ----
                }
  
+               function set_grant()
+               {
+                       $expected_args[0] = 
Array('name'=>'location','default'=>'##REQUIRED##', 'type'=>'alphanumeric');
+                       $expected_args[1] = 
Array('name'=>'rights','default'=>1, 'type'=>'number');
+                       $expected_args[2] = 
Array('name'=>'account_id','default'=>$this->account_id, 'type'=>'number');
+                       $expected_args[3] = Array('name'=>'type','default'=>0, 
'type'=>'number');
+                       $expected_args[4] = 
Array('name'=>'app_id','default'=>$this->app_id, 'type'=>'number');
+                       $expected_args[5] = 
Array('name'=>'data','default'=>NULL, 'type'=>'any');
+                       $recieved_args = func_get_args();
+                       $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
+                       $owner_id = 
$GLOBALS['phpgw_info']['user']['account_id'];
+ 
+                       $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
+                       $sql .= " and acl_account = ".$args['account_id'];
+                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type']." and owner_id = $owner_id)";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       if($this->db->num_rows() != 0)
+                       {
+                               if((int)$args['rights'] == 0)
+                               {
+                                       $sql = "DELETE FROM fm_acl2";
+                               }
+                               else
+                               {
+                                       $sql = "UPDATE fm_acl2 SET acl_rights 
=".$args['rights'];
+                               }
+                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location='".$args['location']."' AND acl_type=".$args['type'] . " AND 
owner_id = $owner_id";
+                               $this->db->query($sql,__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               if($args['rights'] != 0)
+                               {
+                                       $sql = "INSERT INTO fm_acl2 
(acl_host,acl_appid,acl_account,acl_location,acl_rights,acl_type,acl_data,owner_id)
 VALUES 
(".$this->host_id.",".$args['app_id'].",".$args['account_id'].",'".$args['location']."',".$args['rights'].",".$args['type'].",'".$args['data']."',
 $owner_id)";
+                                       
$this->db->query($sql,__LINE__,__FILE__);
+                               }
+                       }
+                       $this->rights_cache = Array();
+                       $this->masks_cache = Array();
+               }
+ 
                function set_test() //rights_cache are making false inheritance 
(not inheriting from parent before one child is defined)
                {
***************
*** 362,366 ****
                        $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
                        $sql .= " and acl_account = ".$args['account_id'];
!                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type'].")";
                        $this->db->query($sql,__LINE__,__FILE__);
                        if($this->db->num_rows() != 0)
--- 444,448 ----
                        $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
                        $sql .= " and acl_account = ".$args['account_id'];
!                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type']." and owner_id is NULL)";
                        $this->db->query($sql,__LINE__,__FILE__);
                        if($this->db->num_rows() != 0)
***************
*** 379,383 ****
                                        $sql = "DELETE FROM fm_acl2";
                                }
!                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location='".$args['location']."' AND acl_type=".$args['type'];
                                $this->db->query($sql,__LINE__,__FILE__);
                                $this->rights_cache = Array();
--- 461,501 ----
                                        $sql = "DELETE FROM fm_acl2";
                                }
!                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location='".$args['location']."' AND acl_type=".$args['type'] . ' and 
owner_id is NULL';
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               $this->rights_cache = Array();
!                               $this->masks_cache = Array();
!                       }
!               }
! 
!               function remove_grant()
!               {
!                       $expected_args[0] = 
Array('name'=>'location','default'=>'##REQUIRED##', 'type'=>'alphanumeric');
!                       $expected_args[1] = 
Array('name'=>'rights','default'=>1, 'type'=>'number');
!                       $expected_args[2] = 
Array('name'=>'account_id','default'=>$this->account_id, 'type'=>'number');
!                       $expected_args[3] = Array('name'=>'type','default'=>0, 
'type'=>'number');
!                       $expected_args[4] = 
Array('name'=>'app_id','default'=>$this->app_id, 'type'=>'number');
!                       $expected_args[5] = 
Array('name'=>'data','default'=>NULL, 'type'=>'any');
!                       $recieved_args = func_get_args();
!                       $args = safe_args($expected_args, 
$recieved_args,__LINE__,__FILE__);
! 
!                       $owner_id = 
$GLOBALS['phpgw_info']['user']['account_id'];
! 
!                       $sql = "SELECT acl_rights FROM fm_acl2 WHERE (acl_appid 
= '".$args['app_id']."' ";
!                       $sql .= " and acl_account = ".$args['account_id'];
!                       $sql .= " and acl_location = '".$args['location']."' 
and acl_type=".$args['type']." and owner_id = $owner_id)";
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->num_rows() != 0)
!                       {
!                               $this->db->next_record();
!                               $newrights = 
$this->bit_mask((int)$this->db->f('acl_rights'),$args['rights']);
!                               if ($newrights != 0)
!                               {
!                                       $sql = "UPDATE fm_acl2 SET acl_rights 
=".$newrights;
!                               }
!                               else
!                               {
!                                       $sql = "DELETE FROM fm_acl2";
!                               }
!                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location='".$args['location']."' AND acl_type=".$args['type'] . " and 
owner_id = $owner_id";
                                $this->db->query($sql,__LINE__,__FILE__);
                                $this->rights_cache = Array();
***************
*** 431,435 ****
--- 549,658 ----
                }
                */
+               function get_grants($app='',$location='')
+               {
+ 
+                       if ($app=='')
+                       {
+                               $app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       }
  
+                       $app_id = 
$GLOBALS['phpgw']->applications->data[$app]['id'];
+ 
+                       $sql = "select acl_account, acl_rights from fm_acl2  
where acl_appid = $app_id AND  acl_type=0  and acl_location = '$location' and "
+                               . " owner_id in ";
+                       $security = "('". $this->account_id ."'";
+                       $myaccounts = CreateObject('phpgwapi.accounts');
+                       $my_memberships = 
$myaccounts->membership($this->account_id);
+                       unset($myaccounts);
+                       @reset($my_memberships);
+                       while($my_memberships && list($key,$group) = 
each($my_memberships))
+                       {
+                               $security .= ",'" . $group['account_id'] . "'";
+                       }
+                       $security .= ')';
+                       $this->db2->query($sql . $security ,__LINE__,__FILE__);
+                       $rights = 0;
+                       $accounts = Array();
+                       if ($this->db2->num_rows() == 0)
+                       {
+                               
$grants[$GLOBALS['phpgw_info']['user']['account_id']] = 31;
+                               return $grants;
+                       }
+                       while ($this->db2->next_record())
+                       {
+                               $grantor = $this->db2->f('acl_account');
+                               $rights = $this->db2->f('acl_rights');
+ 
+                               if(!isset($accounts[$grantor]))
+                               // cache the group-members for performance
+                               {
+                                       // if $grantor is a group, get its 
members
+                                       $members = 
$this->get_ids_for_location($grantor,1,1,$location);
+                                       if(!$members)
+                                       {
+                                               $accounts[$grantor] = 
Array($grantor);
+                                               $is_group[$grantor] = False;
+                                       }
+                                       else
+                                       {
+                                               $accounts[$grantor] = $members;
+                                               $is_group[$grantor] = True;
+                                       }
+                               }
+                               if(@$is_group[$grantor])
+                               {
+                                       // Don't allow to override private!
+                                       $rights &= (~ PHPGW_ACL_PRIVATE);
+                                       if(!isset($grants[$grantor]))
+                                       {
+                                               $grants[$grantor] = 0;
+                                       }
+                                       $grants[$grantor] |= $rights;
+                                       if(!!($rights & PHPGW_ACL_READ))
+                                       {
+                                               $grants[$grantor] |= 
PHPGW_ACL_READ;
+                                       }
+                               }
+                               while(list($nul,$grantors) = 
each($accounts[$grantor]))
+                               {
+                                       if(!isset($grants[$grantors]))
+                                       {
+                                               $grants[$grantors] = 0;
+                                       }
+                                       $grants[$grantors] |= $rights;
+                               }
+                               reset($accounts[$grantor]);
+                       }
+                       $grants[$GLOBALS['phpgw_info']['user']['account_id']] = 
31;
+                       return $grants;
+               }
+ 
+               function get_ids_for_location($owner_id, $required, $app_id = 
False,$location='')
+               {
+                       if ($app == False)
+                       {
+                               $app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                               $app_id = 
$GLOBALS['phpgw']->applications->data[$app]['id'];
+                       }
+                       $sql = "select acl_account, acl_rights from fm_acl2 
where acl_appid = $app_id AND acl_location= '$location' and ";
+                       $sql .= "owner_id = '".$owner_id."'";
+                       $this->db->query($sql ,__LINE__,__FILE__);
+                       $rights = 0;
+                       if ($this->db->num_rows() == 0 )
+                       {
+                               return False;
+                       }
+                       while ($this->db->next_record())
+                       {
+                               $rights = 0;
+                               $rights |= $this->db->f('acl_rights');
+                               if (!!($rights & $required) == True)
+                               {
+                                       $accounts[] = 
intval($this->db->f('acl_account'));
+                               }
+                       }
+                       @reset($accounts);
+                       return $accounts;
+               }
  
                
/*************************************************************************\

Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.boadmin.inc.php       3 Jul 2003 21:53:10 -0000       1.9
--- class.boadmin.inc.php       10 Jul 2003 21:11:38 -0000      1.10
***************
*** 237,240 ****
--- 237,286 ----
                }
  
+               function set_grant($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_grant($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_grant($user_delete);
+                       }
+ 
+ 
+ //    $this->acl2->check('.invoice.test', $rights,$user_id);
+ //    echo 'rights_cache:<pre>'; print_r($this->acl2->rights_cache); echo 
'</pre>';
+ 
+                       $receipt['message'][] = array('msg' => 
lang('permissions are updated!'));
+                       return $receipt;
+               }
+ 
                function remove_permission($user_delete)
                {
***************
*** 246,254 ****
                                for ($j=0;$j<count($right);$j++)
                                {
- 
                                        
$this->acl2->remove($this->location,$right[$j],$user_delete[$i],0);
                                }
                        }
                }
  
                function get_user_list2()
--- 292,359 ----
                                for ($j=0;$j<count($right);$j++)
                                {
                                        
$this->acl2->remove($this->location,$right[$j],$user_delete[$i],0);
                                }
                        }
                }
+ 
+               function remove_grant($user_delete)
+               {
+ 
+                       $right=$this->right;
+ 
+                       for ($i=0;$i<count($user_delete);$i++)
+                       {
+                               for ($j=0;$j<count($right);$j++)
+                               {
+                                       
$this->acl2->remove_grant($this->location,$right[$j],$user_delete[$i],0);
+                               }
+                       }
+               }
+ 
+               function get_user_list($type='',$app_id='')
+               {
+ 
+                       $owner = $GLOBALS['phpgw_info']['user']['account_id'];
+ 
+                       $right=$this->right;
+ 
+                       $GLOBALS['phpgw']->accounts->account_id = $owner;
+ 
+                       $allusers = 
$GLOBALS['phpgw']->accounts->get_list($type, $this->start,$this->sort, 
$this->order, $this->query);
+ 
+                       if(is_array($allusers))
+                       {
+                               $j=0;
+                               while (list($null,$account) = each($allusers))
+                               {
+                                       if($account['account_id']!=$owner)
+                                       {
+                                               $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_grant($owner,$this->location, 
$right[$i],$account['account_id'],$app_id,True))
+                                                       {
+                                                               
$user_list[$j]['right'][$right[$i]] = 'checked';
+                                                       }
+                                               }
+ 
+                                               $j++;
+                                       }
+                               }
+                       }
+ 
+ 
+                       $this->total_records = $this->total_records + 
count($user_list);
+ 
+ //_debug_array($user_list);
+ 
+                       return $user_list;
+               }
+ 
  
                function get_user_list2()

Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** class.solocation.inc.php    9 Jul 2003 11:12:16 -0000       1.20
--- class.solocation.inc.php    10 Jul 2003 21:11:38 -0000      1.21
***************
*** 13,16 ****
--- 13,21 ----
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ 
+                       $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
+ 
+               //      $this->grants   = 
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
+                       $this->grants   = 
$this->acl2->get_grants($this->currentapp,'.location');
                        $this->db               = $GLOBALS['phpgw']->db;
                        $this->db2              = $this->db;
***************
*** 21,24 ****
--- 26,30 ----
                        $this->join                     = $this->socommon->join;
                        $this->left_join        = $this->socommon->left_join;
+ _debug_array($this->grants);
                }
  

Index: class.uiadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiadmin.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.uiadmin.inc.php       3 Jul 2003 09:40:41 -0000       1.13
--- class.uiadmin.inc.php       10 Jul 2003 21:11:38 -0000      1.14
***************
*** 24,27 ****
--- 24,28 ----
                (
                        'list_acl2'             => True,
+                       'aclprefs'              => True,
                        'edit_id'               => True
                );
***************
*** 62,65 ****
--- 63,211 ----
                }
  
+               function aclprefs()
+               {
+ 
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin','nextmatchs',
+                                                                               
'search_field'));
+ 
+                       $values                 = 
get_var('values',array('POST'));
+                       $r_processed    = get_var('processed',array('POST'));
+                       $acl_app                = 
get_var('acl_app',array('GET'));
+                       $set_permission = 
get_var('set_permission',array('POST'));
+ 
+                       $app_id =       
$GLOBALS['phpgw']->applications->data[$acl_app]['id'];
+ 
+                       if($set_permission)
+                       {
+                               $receipt        = 
$this->bo->set_grant($values,$r_processed);
+                       }
+ 
+                       if ($this->location)
+                       {
+                               if(!$this->cat_id || $this->cat_id=='accounts')
+                               {
+                                       $user_list = 
$this->bo->get_user_list('accounts',$app_id);
+                               }
+ 
+                               while (is_array($user_list) && list(,$user) = 
each($user_list))
+                               {
+                                       $processed[] = $user['account_id'];
+                                       $users[] = array
+                                       (
+                                               'account_id'                    
=> $user['account_id'],
+                                               'lid'                           
        => $user['account_lid'],
+                                               'name'                          
        => $user['account_firstname'] . ' ' . $user['account_lastname'],
+                                               'read'                          
        => $user['right'][1],
+                                               'add'                           
        => $user['right'][2],
+                                               'edit'                          
        => $user['right'][4],
+                                               'delete'                        
        => $user['right'][8],
+                                               'manager'                       
        => $user['right'][16]
+                                       );
+                               }
+ 
+                               if(!$this->cat_id || $this->cat_id=='groups')
+                               {
+                                       $group_list = 
$this->bo->get_user_list('groups',$app_id);
+                               }
+ 
+ 
+                               while (is_array($group_list) && list(,$group) = 
each($group_list))
+                               {
+                                       $processed[] = $group['account_id'];
+                                       $groups[] = array
+                                       (
+                                               'account_id'                    
=> $group['account_id'],
+                                               'lid'                           
        => $group['account_lid'],
+                                               'name'                          
        => $group['account_firstname'],
+                                               'read'                          
        => $group['right'][1],
+                                               'add'                           
        => $group['right'][2],
+                                               'edit'                          
        => $group['right'][4],
+                                               'delete'                        
        => $group['right'][8],
+                                               'manager'                       
        => $group['right'][16]
+                                       );
+                               }
+ 
+                               address@hidden("_", $processed);
+                       }
+ 
+ 
+                       $table_header[] = array
+                       (
+                               'lang_read'                                     
=> lang('Read'),                                //1
+                               'lang_add'                                      
=> lang('Add'),                                 //2
+                               'lang_edit'                                     
=> lang('Edit'),                                //4
+                               'lang_delete'                           => 
lang('Delete'),                              //8
+                               'lang_manager'                          => 
lang('Manager')                              //16
+                       );
+ 
+ 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiadmin.aclprefs',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query,
+                                               'module'                => 
$this->location
+ 
+                       );
+ 
+                       if(!$this->location)
+                       {
+                               $receipt['error'][] = array('msg' => 
lang('select a location!'));
+                       }
+ 
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+ 
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/preferences/index.php'),
+                               'lang_save'                                     
        => lang('save'),
+                               'lang_done'                                     
        => lang('done'),
+                               'processed'                                     
        => $processed,
+                               'location'                                      
        => $this->location,
+                               'links'                                         
        => $links,
+                               'allow_allrows'                                 
=> false,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+                               'num_records'                                   
=> count($user_list)+count($group_list),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.aclprefs'),
+                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
+ 
+                               'lang_groups'                                   
=> lang('groups'),
+                               'lang_users'                                    
=> lang('users'),
+                               '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'),
+                               'query'                                         
        => $this->query,
+                               'lang_search'                                   
=> lang('search'),
+                               'table_header_grants'                   => 
$table_header,
+                               'values_grants_groups'                  => 
$groups,
+                               'values_grants_users'                   => 
$users,
+                               'lang_no_location'                              
=> lang('No location'),
+                               'lang_location_statustext'              => 
lang('Select submodule'),
+                               'select_name_location'                  => 
'module',
+                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location)
+                       );
+ 
+                       $appname                                                
= lang('preferences');
+                       $function_msg                                   = 
lang('set grants');
+                       $owner_name = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->accounts->account_id);  
          // get owner name for title
+ 
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ': ' . 
$owner_name;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_grants' => $data));
+                       $this->save_sessiondata();
+ 
+               }
  
                function list_acl2()

Index: hook_preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/hook_preferences.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** hook_preferences.inc.php    22 May 2003 20:04:16 -0000      1.4
--- hook_preferences.inc.php    10 Jul 2003 21:11:38 -0000      1.5
***************
*** 14,18 ****
        $file = Array(
                'Preferences'           => 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname . 
'&type=user'),
!               'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname)
        );
        display_section($appname,$file);
--- 14,19 ----
        $file = Array(
                'Preferences'           => 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname . 
'&type=user'),
! //            'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname)
!               'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.aclprefs&acl_app='.$appname)
        );
        display_section($appname,$file);





reply via email to

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