當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。