phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [19045] fixed: roles control in flows


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] [19045] fixed: roles control in flows
Date: Fri, 30 Jan 2009 16:33:34 +0000

Revision: 19045
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=19045
Author:   maat
Date:     2009-01-30 16:33:33 +0000 (Fri, 30 Jan 2009)

Log Message:
-----------
fixed: roles control in flows

Modified Paths:
--------------
    modules/ged/trunk/inc/class.soflows.inc.php

Modified: modules/ged/trunk/inc/class.soflows.inc.php
===================================================================
--- modules/ged/trunk/inc/class.soflows.inc.php 2009-01-29 12:54:00 UTC (rev 
19044)
+++ modules/ged/trunk/inc/class.soflows.inc.php 2009-01-30 16:33:33 UTC (rev 
19045)
@@ -117,14 +117,25 @@
                        // TODO fix this line to retrieve the list of groups
                        // As it seems it's not the correct way now :-/
                        
//$the_groups=$GLOBALS['phpgw']->acl->get_location_list_for_id('phpgw_group', 
1, $the_account_id);
-                       $account = createObject('phpgwapi.accounts', 
$account_id, 'u');
-                       $the_groups = $account->membership($account_id);
+                       $account = createObject('phpgwapi.accounts', 
$the_account_id, 'u');
+                       $the_groups = $account->membership($the_account_id);
                        
                        $or="";
                        $sql_role_base="( ";
-                       foreach ( $the_groups as $group => $groupname )
+
+                       list($phpgw_ver1, $phpgw_ver2, $phpgw_ver3, 
$phpgw_ver4) = split("\.", 
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
+                       foreach ( $the_groups as $the_group_label  => 
$the_group_data )
                        {
-                               
$sql_role_base.=$or."phpgw_flows_roles.account_id=".intval($group)." ";
+                               // Compatibility with 0.9.17.512 and 0.9.17.517 
api(s)
+                               if ((int)$phpgw_ver4 <= 512)
+                               {
+                                       
$the_group_id=$the_group_data['account_id'];
+                               }
+                               else
+                               {
+                                       $the_group_id=$the_group_label;
+                               }
+                               
$sql_role_base.=$or."phpgw_flows_roles.account_id=".intval($the_group_id)." ";
                                $or="OR ";
                        }
                        
$sql_role_base.=$or."phpgw_flows_roles.account_id=".$the_account_id." ";






reply via email to

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