本文整理汇总了PHP中getCurrentUserGroupList函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrentUserGroupList函数的具体用法?PHP getCurrentUserGroupList怎么用?PHP getCurrentUserGroupList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCurrentUserGroupList函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_current_user_access_groups
function get_current_user_access_groups($module)
{
$log = vglobal('log');
$log->debug("Entering get_current_user_access_groups(" . $module . ") method ...");
global $adb, $noof_group_rows;
$current_user_group_list = getCurrentUserGroupList();
$sharing_write_group_list = getWriteSharingGroupsList($module);
$query = "select groupname,groupid from vtiger_groups";
$params = array();
if (count($current_user_group_list) > 0 && count($sharing_write_group_list) > 0) {
$query .= " where (groupid in (" . generateQuestionMarks($current_user_group_list) . ") or groupid in (" . generateQuestionMarks($sharing_write_group_list) . "))";
array_push($params, $current_user_group_list, $sharing_write_group_list);
$result = $adb->pquery($query, $params);
$noof_group_rows = $adb->num_rows($result);
} elseif (count($current_user_group_list) > 0) {
$query .= " where groupid in (" . generateQuestionMarks($current_user_group_list) . ")";
array_push($params, $current_user_group_list);
$result = $adb->pquery($query, $params);
$noof_group_rows = $adb->num_rows($result);
} elseif (count($sharing_write_group_list) > 0) {
$query .= " where groupid in (" . generateQuestionMarks($sharing_write_group_list) . ")";
array_push($params, $sharing_write_group_list);
$result = $adb->pquery($query, $params);
$noof_group_rows = $adb->num_rows($result);
}
$log->debug("Exiting get_current_user_access_groups method ...");
return $result;
}
示例2: getUserIDS
function getUserIDS($viewscope = "all_to_me")
{
global $log;
$log->debug("Entering getUserIDS() method ...");
global $current_user;
if (empty($viewscope)) {
$viewscope = "all_to_me";
}
$key = "sqluserids_" . $viewscope . "_" . $current_user->id;
$userIDS = getSqlCacheData($key);
if (!$userIDS) {
global $adb;
$sec_query = "";
$userIDS = '';
if ($viewscope == "all_to_me") {
$sec_query = "select id as userid from ec_users where status='Active'";
$result = $adb->getList($sec_query);
$userIDS .= '(';
$i = 0;
foreach ($result as $row) {
$userid = $row['userid'];
if ($i != 0) {
$userIDS .= ', ';
}
$userIDS .= $userid;
$i++;
}
if ($userIDS != '(') {
$userIDS .= ', ' . $current_user->id;
} else {
$userIDS .= $current_user->id;
}
$userIDS .= ')';
} elseif ($viewscope == "sub_user") {
if (!isset($current_user_parent_role_seq) || $current_user_parent_role_seq == "") {
$current_user_parent_role_seq = fetchUserRole($current_user->id);
}
$sec_query = "select ec_user2role.userid from ec_user2role inner join ec_users on ec_users.id=ec_user2role.userid inner join ec_role on ec_role.roleid=ec_user2role.roleid where ec_role.parentrole like '%" . $current_user_parent_role_seq . "::%'";
$result = $adb->getList($sec_query);
$userIDS .= '(';
$i = 0;
foreach ($result as $row) {
$userid = $row['userid'];
if ($i != 0) {
$userIDS .= ', ';
}
$userIDS .= $userid;
$i++;
}
$userIDS .= ')';
} elseif ($viewscope == "current_user") {
$userIDS .= '(' . $current_user->id;
$userIDS .= ')';
} elseif ($viewscope == "current_group") {
$sec_query .= "select ec_users2group.userid from ec_users2group where ec_users2group.groupid in " . getCurrentUserGroupList() . "";
$result = $adb->getList($sec_query);
$userIDS .= '(';
$i = 0;
foreach ($result as $row) {
$userid = $row['userid'];
if ($i != 0) {
$userIDS .= ', ';
}
$userIDS .= $userid;
$i++;
}
$userIDS .= ')';
} else {
$userIDS .= '(' . $viewscope . ')';
}
setSqlCacheData($key, $userIDS);
}
if ($userIDS == "()") {
$userIDS = "(-1)";
}
$log->debug("Exiting getUserIDS method ...");
return $userIDS;
}
示例3: getSecParameterforMerge
/** To get security parameter for a particular module -- By Pavani*/
function getSecParameterforMerge($module)
{
global $current_user;
$tab_id = getTabid($module);
$sec_parameter = "";
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) {
$sec_parameter = getListViewSecurityParameter($module);
if ($module == "Accounts") {
$sec_parameter .= " AND (vtiger_crmentity.smownerid IN (" . $current_user->id . ")\n\t\t\t\t\tOR vtiger_crmentity.smownerid IN (\n\t\t\t\t\tSELECT vtiger_user2role.userid\n\t\t\t\t\tFROM vtiger_user2role\n\t\t\t\t\tINNER JOIN vtiger_users ON vtiger_users.id = vtiger_user2role.userid\n\t\t\t\t\tINNER JOIN vtiger_role ON vtiger_role.roleid = vtiger_user2role.roleid\n\t\t\t\t\tWHERE vtiger_role.parentrole LIKE '" . $current_user_parent_role_seq . "::%')\n\t\t\t\t\tOR vtiger_crmentity.smownerid IN (\n\t\t\t\t\tSELECT shareduserid\n\t\t\t\t\tFROM vtiger_tmp_read_user_sharing_per\n\t\t\t\t\tWHERE userid=" . $current_user->id . "\n\t\t\t\t\tAND tabid=" . $tab_id . ")\n\t\t\t\t\tOR (vtiger_crmentity.smownerid in (0)\n\t\t\t\t\tAND (";
if (sizeof($current_user_groups) > 0) {
$sec_parameter .= " vtiger_groups.groupname IN (\n\t\t\t\t\t\t\t\tSELECT groupname\n\t\t\t\t\t\t\t\tFROM vtiger_groups\n\t\t\t\t\t\t\t\tWHERE groupid IN (" . implode(",", getCurrentUserGroupList()) . ")) OR ";
}
$sec_parameter .= " vtiger_groups.groupname IN (\n\t\t\t\tSELECT vtiger_groups.groupname\n\t\t\t\tFROM vtiger_tmp_read_group_sharing_per\n\t\t\t\tINNER JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_tmp_read_group_sharing_per.sharedgroupid\n\t\t\t\tWHERE userid=" . $current_user->id . " AND tabid=" . $tab_id . ")))) ";
}
}
return $sec_parameter;
}