本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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&userid=<?php
echo $i;
?>
"></a>
<?php
if ($userent['scope'] != "system") {
?>
<a class="fa fa-trash" title="<?php
echo gettext("Delete user");