[Vtigercrm-commits] [vtiger-commits] r4172 - /vtigercrm/trunk/include/utils/UserInfoUtil.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Mar 14 06:23:24 EST 2006
Author: don
Date: Tue Mar 14 04:23:20 2006
New Revision: 4172
Log:
Modified fetchUserGroupsIds
Modified:
vtigercrm/trunk/include/utils/UserInfoUtil.php
Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php
==============================================================================
--- vtigercrm/trunk/include/utils/UserInfoUtil.php (original)
+++ vtigercrm/trunk/include/utils/UserInfoUtil.php Tue Mar 14 04:23:20 2006
@@ -13,6 +13,7 @@
require_once('include/database/PearDatabase.php');
require_once('include/utils/utils.php');
+require_once('include/utils/GetUserGroups.php');
include('config.php');
global $log;
@@ -69,17 +70,11 @@
function fetchUserGroupids($userid)
{
global $adb;
- $sql= "select users2group.groupid from users2group inner join groups on groups.groupid=users2group.groupid where userid=" .$userid;
- $result = $adb->query($sql);
- //code changed to return a list of groups related to the userid as comma seperated
- if($adb->num_rows($result)!=0)
- {
- for($i=0;$i<$adb->num_rows($result);$i++)
- $groupid[]= $adb->query_result($result,$i,"groupid");
-
- $groupidlists = implode (",",$groupid);
- }
- return $groupidlists;
+ $focus = new GetUserGroups();
+ $focus->getAllUserGroups($userid);
+ $groupidlists = implode(",",$focus->user_groups);
+ return $groupidlists;
+
}
/** Function to load all the permissions
More information about the vtigercrm-commits
mailing list