phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [19024] Make preferences acl working again ...


From: Caeies
Subject: [Phpgroupware-cvs] [19024] Make preferences acl working again ...
Date: Wed, 07 Jan 2009 18:27:45 +0000

Revision: 19024
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=19024
Author:   Caeies
Date:     2009-01-07 18:27:44 +0000 (Wed, 07 Jan 2009)

Log Message:
-----------
Make preferences acl working again ... at least, it seems :) Fixed typos, 
broken design is still broken design (well worst now)

Modified Paths:
--------------
    core/trunk/preferences/inc/class.boadmin_acl.inc.php
    core/trunk/preferences/inc/class.uiadmin_acl.inc.php

Modified: core/trunk/preferences/inc/class.boadmin_acl.inc.php
===================================================================
--- core/trunk/preferences/inc/class.boadmin_acl.inc.php        2009-01-07 
18:26:05 UTC (rev 19023)
+++ core/trunk/preferences/inc/class.boadmin_acl.inc.php        2009-01-07 
18:27:44 UTC (rev 19024)
@@ -97,6 +97,20 @@
                        }
                        if(isset($module))
                        {
+                               //XXX JAN09 Caeies : Try to convert it ... that 
not good : lazy WA.
+                               if(is_numeric($module))
+                               {
+                                       $module_n = 
$GLOBALS['phpgw']->locations->get_name((int)$module);
+                                       if(isset($module_n['name']))
+                                       {
+                                               $this->location_id = 
(int)$module;
+                                               $module = $module_n['name'];
+                                       }
+                               }
+                               else
+                               {
+                                       $this->location_id = 
$GLOBALS['phpgw']->locations->get_id($this->acl_app, $module);
+                               }
                                $this->location = $module;
                        }
                        if(isset($granting_group))
@@ -125,6 +139,7 @@
                        $this->order            = $data['order'];
                        $this->cat_id           = $data['cat_id'];
                        $this->location         = $data['location'];
+                       $this->location_id      = $data['location_id'];
                        $this->granting_group   = $data['granting_group'];
                        $this->allrows  = $data['allrows'];
                }
@@ -139,7 +154,6 @@
 
                function select_location($format = 'filter', $selected='', 
$grant = false, $allow_c_attrib = false)
                {
-
                        switch($format)
                        {
                                case 'select':
@@ -359,19 +373,19 @@
                                $j=0;
                                foreach($allusers as $account)
                                {
-                                       $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]['account_id']            
= $account->id;
+                                       $user_list[$j]['account_lid']           
= $account->lid;
+                                       $user_list[$j]['account_firstname']     
= $account->firstname;
+                                       $user_list[$j]['account_lastname']      
= $account->lastname;
 
-                                       
$this->acl->set_account_id($account['account_id']);
+                                       
$this->acl->set_account_id($account->id);
 
                                        $count_right=count($right);
                                        for ( $i = 0; $i < $count_right; ++$i )
                                        {
                                                
if($this->acl->check_rights($this->location, 
$right[$i],$this->acl_app,$grantor,0,$check_account_type))
                                                {
-                                                       
if($this->acl->account_type == 'g')
+                                                       if($this->acl->type == 
'g')
                                                        {
                                                                
$user_list[$j]['right'][$right[$i]] = 'from_group';
                                                        }
@@ -383,7 +397,7 @@
                                                }
                                                
if($this->acl->check_rights($this->location, 
$right[$i],$this->acl_app,$grantor,1,$check_account_type))
                                                {
-                                                       
if($this->acl->account_type == 'g')
+                                                       if($this->acl->type == 
'g')
                                                        {
                                                                
$user_list[$j]['mask'][$right[$i]] = 'from_group';
                                                        }
@@ -423,12 +437,12 @@
                        {
                                foreach($groups as $group)
                                {
-                                       if ($group['account_id']==$selected)
+                                       if ($group->id==$selected)
                                        {
                                                $group_list[] = array
                                                (
-                                                       'id'    => 
$group['account_id'],
-                                                       'name'          => 
$group['account_firstname'],
+                                                       'id'    => $group->id,
+                                                       'name'          => 
(string)$group,
                                                        'selected'      => 
'selected'
                                                );
                                        }
@@ -436,8 +450,8 @@
                                        {
                                                $group_list[] = array
                                                (
-                                                       'id'    => 
$group['account_id'],
-                                                       'name'          => 
$group['account_firstname'],
+                                                       'id'    => $group->id,
+                                                       'name'          => 
(string)$group,
                                                );
                                        }
                                }

Modified: core/trunk/preferences/inc/class.uiadmin_acl.inc.php
===================================================================
--- core/trunk/preferences/inc/class.uiadmin_acl.inc.php        2009-01-07 
18:26:05 UTC (rev 19023)
+++ core/trunk/preferences/inc/class.uiadmin_acl.inc.php        2009-01-07 
18:27:44 UTC (rev 19024)
@@ -58,12 +58,14 @@
                        $this->filter                   = $this->bo->filter;
                        $this->cat_id                   = $this->bo->cat_id;
                        $this->location                 = $this->bo->location;
+                       $this->location_id                      = 
$this->bo->location_id;
                        $this->granting_group   = $this->bo->granting_group;
                        $this->allrows                  = $this->bo->allrows;
 
                        // Add top location if used for first time
-                       
$GLOBALS['phpgw']->acl->verify_location(array($this->acl_app => 
array('top_grant' =>True)));
+                       
$GLOBALS['phpgw']->locations->verify(array($this->acl_app => array('top_grant' 
=>True)));
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::{$this->acl_app}::acl";
+
                }
 
                function save_sessiondata()
@@ -77,6 +79,7 @@
                                'filter'                => $this->filter,
                                'cat_id'                => $this->cat_id,
                                'location'              => $this->location,
+                               'location_id'           => $this->location_id,
                                'granting_group'        => 
$this->granting_group,
                                'allrows'               => $this->allrows
                        );
@@ -261,7 +264,7 @@
                                '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,True),
+                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location_id,True),
 
                                'is_admin'                                      
        => $GLOBALS['phpgw_info']['user']['apps']['admin'],
                                'lang_group_statustext'                 => 
lang('Select the granting group. To do not use a granting group select NO 
GRANTING GROUP'),
@@ -272,7 +275,7 @@
 
                        $appname                        = lang('preferences');
                        $function_msg           = lang('set grants');
-                       $owner_name             = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->accounts->account_id);  
              // get owner name for title
+                       $owner_name             = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->accounts->id);          
      // get owner name for title
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('admin') . ' - ' . $this->acl_app . ': ' . $function_msg . ': ' . 
$owner_name;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
@@ -508,7 +511,7 @@
                                '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,False)
+                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location_id,False)
                        );
 
                        $appname                = lang('permission');






reply via email to

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