• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_current_user_access_groups函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_current_user_access_groups函数的典型用法代码示例。如果您正苦于以下问题:PHP get_current_user_access_groups函数的具体用法?PHP get_current_user_access_groups怎么用?PHP get_current_user_access_groups使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_current_user_access_groups函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: vtws_getUserAccessibleGroups

function vtws_getUserAccessibleGroups($moduleId, $user)
{
    global $adb;
    require 'user_privileges/user_privileges_' . $user->id . '.php';
    require 'user_privileges/sharing_privileges_' . $user->id . '.php';
    $tabName = getTabname($moduleId);
    if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$moduleId] == 3 or $defaultOrgSharingPermission[$moduleId] == 0)) {
        $result = get_current_user_access_groups($tabName);
    } else {
        $result = get_group_options();
    }
    $groups = array();
    if ($result != null && $result != '' && is_object($result)) {
        $rowCount = $adb->num_rows($result);
        for ($i = 0; $i < $rowCount; $i++) {
            $nameArray = $adb->query_result_rowdata($result, $i);
            $groupId = $nameArray["groupid"];
            $groupName = $nameArray["groupname"];
            $groups[] = array('id' => $groupId, 'name' => $groupName);
        }
    }
    return $groups;
}
开发者ID:kduqi,项目名称:corebos,代码行数:23,代码来源:Utils.php


示例2: getGroupslist

function getGroupslist()
{
    global $log, $adb, $module, $current_user;
    $log->debug("Entering getGroupslist() method ...");
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    //Commented to avoid security check for groups
    if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module)] == 3 or $defaultOrgSharingPermission[getTabid($module)] == 0)) {
        $result = get_current_user_access_groups($module);
    } else {
        $result = get_group_options();
    }
    if ($result) {
        $nameArray = $adb->fetch_array($result);
    }
    if (!empty($nameArray)) {
        if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module)] == 3 or $defaultOrgSharingPermission[getTabid($module)] == 0)) {
            $groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $current_user->id, 'private'), $current_user->id);
        } else {
            $groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $current_user->id), $current_user->id);
        }
    }
    if (count($groups_combo) > 0) {
        foreach ($groups_combo as $groupid => $value) {
            foreach ($value as $groupname => $selected) {
                $change_groups_owner .= "<option value={$groupid} {$selected} >" . $groupname . "</option>";
            }
        }
    }
    $log->debug("Exiting getGroupslist method ...");
    return $change_groups_owner;
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:32,代码来源:CommonUtils.php


示例3: getAssignedTo

function getAssignedTo($tabid)
{
    global $current_user, $noof_group_rows, $adb;
    $assigned_user_id = $current_user->id;
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$tabid] == 3 or $defaultOrgSharingPermission[$tabid] == 0)) {
        $result = get_current_user_access_groups('Calendar');
    } else {
        $result = get_group_options();
    }
    if ($result) {
        $nameArray = $adb->fetch_array($result);
    }
    if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$tabid] == 3 or $defaultOrgSharingPermission[$tabid] == 0)) {
        $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
    } else {
        $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
    }
    if ($noof_group_rows != 0) {
        do {
            $groupname = $nameArray["groupname"];
            $group_option[] = array($groupname => $selected);
        } while ($nameArray = $adb->fetch_array($result));
    }
    $fieldvalue[] = $users_combo;
    $fieldvalue[] = $group_option;
    return $fieldvalue;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:29,代码来源:CalendarCommon.php


示例4: getOutputHtml


//.........这里部分代码省略.........
            $editview_label[] = getTranslatedString($fieldlabel, $module_name);
            $fieldvalue[] = $value;
        } elseif ($uitype == 21 || $uitype == 24) {
            $editview_label[] = getTranslatedString($fieldlabel, $module_name);
            $fieldvalue[] = $value;
        } elseif ($uitype == 22) {
            $editview_label[] = getTranslatedString($fieldlabel, $module_name);
            $fieldvalue[] = $value;
        } elseif ($uitype == 52 || $uitype == 77) {
            $editview_label[] = getTranslatedString($fieldlabel, $module_name);
            global $current_user;
            if ($value != '') {
                $assigned_user_id = $value;
            } else {
                $assigned_user_id = $current_user->id;
            }
            if ($uitype == 52) {
                $combo_lbl_name = 'assigned_user_id';
            } elseif ($uitype == 77) {
                $combo_lbl_name = 'assigned_user_id1';
            }
            //Control will come here only for Products - Handler and Quotes - Inventory Manager
            if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
                $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
            } else {
                $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
            }
            $fieldvalue[] = $users_combo;
        } elseif ($uitype == 53) {
            global $noof_group_rows;
            $editview_label[] = getTranslatedString($fieldlabel, $module_name);
            //Security Checks
            if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
                $result = get_current_user_access_groups($module_name);
            } else {
                $result = get_group_options();
            }
            if ($result) {
                $nameArray = $adb->fetch_array($result);
            }
            $assigned_user_id = empty($value) ? $current_user->id : $value;
            if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
                $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
            } else {
                $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
            }
            if ($noof_group_rows != 0) {
                if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
                    $groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
                } else {
                    $groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
                }
            }
            $fieldvalue[] = $users_combo;
            $fieldvalue[] = $groups_combo;
        } elseif ($uitype == 51 || $uitype == 50 || $uitype == 73) {
            if (!isset($_REQUEST['convertmode']) || $_REQUEST['convertmode'] != 'update_quote_val' && $_REQUEST['convertmode'] != 'update_so_val') {
                if (isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '') {
                    $value = vtlib_purify($_REQUEST['account_id']);
                }
            }
            if ($value != '') {
                $account_name = getAccountName($value);
            }
            $editview_label[] = getTranslatedString($fieldlabel, $module_name);
            $fieldvalue[] = $account_name;
开发者ID:kduqi,项目名称:corebos,代码行数:67,代码来源:EditViewUtils.php


示例5: getDetailViewOutputHtml


//.........这里部分代码省略.........
            }
            if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module)] == 3 or $defaultOrgSharingPermission[getTabid($module)] == 0)) {
                $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
            } else {
                $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $user_id), $assigned_user_id);
            }
            $label_fld["options"] = $users_combo;
        } elseif ($uitype == 11) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = $col_fields[$fieldname];
        } elseif ($uitype == 53) {
            global $noof_group_rows, $adb;
            $owner_id = $col_fields[$fieldname];
            $user = 'no';
            $result = $adb->pquery("SELECT count(*) as count from vtiger_users where id = ?", array($owner_id));
            if ($adb->query_result($result, 0, 'count') > 0) {
                $user = 'yes';
            }
            $owner_name = getOwnerName($owner_id);
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = $owner_name;
            if (is_admin($current_user)) {
                $label_fld["secid"][] = $owner_id;
                if ($user == 'no') {
                    $label_fld["link"][] = "index.php?module=Settings&action=GroupDetailView&groupId=" . $owner_id;
                } else {
                    $label_fld["link"][] = "index.php?module=Users&action=DetailView&record=" . $owner_id;
                }
                //$label_fld["secid"][] = $groupid;
                //$label_fld["link"][] = "index.php?module=Settings&action=GroupDetailView&groupId=".$groupid;
            }
            //Security Checks
            if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
                $result = get_current_user_access_groups($module_name);
            } else {
                $result = get_group_options();
            }
            if ($result) {
                $nameArray = $adb->fetch_array($result);
            }
            global $current_user;
            //$value = $user_id;
            if ($owner_id != '') {
                if ($user == 'yes') {
                    $label_fld["options"][] = 'User';
                    $assigned_user_id = $owner_id;
                    $user_checked = "checked";
                    $team_checked = '';
                    $user_style = 'display:block';
                    $team_style = 'display:none';
                } else {
                    //$record = $col_fields["record_id"];
                    //$module = $col_fields["record_module"];
                    $label_fld["options"][] = 'Group';
                    $assigned_group_id = $owner_id;
                    $user_checked = '';
                    $team_checked = 'checked';
                    $user_style = 'display:none';
                    $team_style = 'display:block';
                }
            } else {
                $label_fld["options"][] = 'User';
                $assigned_user_id = $current_user->id;
                $user_checked = "checked";
                $team_checked = '';
                $user_style = 'display:block';
开发者ID:jaimeaga84,项目名称:corebos,代码行数:67,代码来源:DetailViewUtils.php



注:本文中的get_current_user_access_groups函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_current_user_id函数代码示例发布时间:2022-05-15
下一篇:
PHP get_current_user_ID函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap