当前位置: 首页>>代码示例>>PHP>>正文


PHP local_user_get_groups函数代码示例

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


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

示例1: get_user_privdesc

function get_user_privdesc(&$user)
{
    global $priv_list;
    $privs = array();
    $user_privs = $user['priv'];
    if (!is_array($user_privs)) {
        $user_privs = array();
    }
    $names = local_user_get_groups($user, true);
    foreach ($names as $name) {
        $group = getGroupEntry($name);
        $group_privs = $group['priv'];
        if (!is_array($group_privs)) {
            continue;
        }
        foreach ($group_privs as $pname) {
            if (in_array($pname, $user_privs)) {
                continue;
            }
            if (!$priv_list[$pname]) {
                continue;
            }
            $priv = $priv_list[$pname];
            $priv['group'] = $group['name'];
            $privs[] = $priv;
        }
    }
    foreach ($user_privs as $pname) {
        if ($priv_list[$pname]) {
            $privs[] = $priv_list[$pname];
        }
    }
    return $privs;
}
开发者ID:karawan,项目名称:core,代码行数:34,代码来源:system_usermanager.php

示例2: getUserGroups

function getUserGroups($username, $authcfg)
{
    global $config;
    $member_groups = array();
    $user = getUserEntry($username);
    if ($user !== false) {
        $allowed_groups = local_user_get_groups($user, true);
        if (isset($config['system']['group'])) {
            foreach ($config['system']['group'] as $group) {
                if (in_array($group['name'], $allowed_groups)) {
                    $member_groups[] = $group['name'];
                }
            }
        }
    }
    return $member_groups;
}
开发者ID:karawan,项目名称:core,代码行数:17,代码来源:diag_authentication.php

示例3: get_user_privdesc

function get_user_privdesc(&$user)
{
    global $priv_list;
    $privs = array();
    if (!isset($user['priv']) || !is_array($user['priv'])) {
        $user_privs = array();
    } else {
        $user_privs = $user['priv'];
    }
    $names = local_user_get_groups($user, true);
    foreach ($names as $name) {
        $group = getGroupEntry($name);
        if (isset($group['priv']) && is_array($group['priv'])) {
            foreach ($group['priv'] as $pname) {
                if (in_array($pname, $user_privs)) {
                    continue;
                }
                if (empty($priv_list[$pname])) {
                    continue;
                }
                $priv = $priv_list[$pname];
                $priv['group'] = $group['name'];
                $priv['id'] = $pname;
                $privs[] = $priv;
            }
        }
    }
    foreach ($user_privs as $pname) {
        if (!empty($priv_list[$pname])) {
            $priv_list[$pname]['id'] = $pname;
            $privs[] = $priv_list[$pname];
        }
    }
    legacy_html_escape_form_data($privs);
    return $privs;
}
开发者ID:alisamar,项目名称:core,代码行数:36,代码来源:system_usermanager.php

示例4: htmlspecialchars

					<?php 
        echo htmlspecialchars($userent['name']);
        ?>
				</td>
				<td><?php 
        echo htmlspecialchars($userent['descr']);
        ?>
</td>
				<td><?php 
        if (isset($userent['disabled'])) {
            echo "*";
        }
        ?>
</td>
				<td><?php 
        echo implode(",", local_user_get_groups($userent));
        ?>
</td>
				<td>
					<a class="fa fa-pencil" title="<?php 
        echo gettext("Edit user");
        ?>
" href="?act=edit&amp;userid=<?php 
        echo $i;
        ?>
"></a>
<?php 
        if ($userent['scope'] != "system") {
            ?>
					<a class="fa fa-trash"	title="<?php 
            echo gettext("Delete user");
开发者ID:sjourdois,项目名称:pfsense,代码行数:31,代码来源:system_usermanager.php


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