本文整理匯總了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");