[Vtigercrm-commits] [vtiger-commits] r4170 - /vtigercrm/trunk/include/utils/GetUserGroups.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Mar 14 05:42:17 EST 2006


Author: don
Date: Tue Mar 14 03:42:13 2006
New Revision: 4170

Log:
Fixed the issue in RoleHandling

Modified:
    vtigercrm/trunk/include/utils/GetUserGroups.php

Modified: vtigercrm/trunk/include/utils/GetUserGroups.php
==============================================================================
--- vtigercrm/trunk/include/utils/GetUserGroups.php (original)
+++ vtigercrm/trunk/include/utils/GetUserGroups.php Tue Mar 14 03:42:13 2006
@@ -16,7 +16,7 @@
 class GetUserGroups { 
 
 	var $user_groups=Array();
-	var $userRole='';
+	//var $userRole='';
 
 	/** to get all the parent groups of the specified group
 	 * @params $groupId --> Group Id :: Type Integer
@@ -38,12 +38,16 @@
 					
 			}
 		}
+
+		//Setting the User Role
+		$userRole = fetchUserRole($userid);
+
 		//echo 'user2group Array<BR>';
 		//print_r($this->user_groups);
 		//echo 'user2group Array<BR>';
 
 		//Retreiving from the user2role
-		$query="select * from group2role where roleid='".$this->userRole."'";
+		$query="select * from group2role where roleid='".$userRole."'";
                 $result = $adb->query($query);
                 $num_rows=$adb->num_rows($result);
                 for($i=0;$i<$num_rows;$i++)
@@ -57,13 +61,13 @@
                 }
 
 		//Retreiving from the user2rs
-		$parentRoles=getParentRole($this->userRole);
+		$parentRoles=getParentRole($userRole);
 		$parentRolelist="(";
 		foreach($parentRoles as $par_rol_id)
 		{
 			$parentRolelist .= "'".$par_rol_id."',";		
 		}
-		$parentRolelist .= "'".$this->userRole."')";
+		$parentRolelist .= "'".$userRole."')";
 		//echo '<BR> '.$parentRolelist.'<BR>';		
 		$query="select * from group2rs where roleandsubid in".$parentRolelist;
                 $result = $adb->query($query);





More information about the vtigercrm-commits mailing list