本文整理汇总了PHP中permissions::getAllGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP permissions::getAllGroups方法的具体用法?PHP permissions::getAllGroups怎么用?PHP permissions::getAllGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类permissions
的用法示例。
在下文中一共展示了permissions::getAllGroups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
case 'user_delete':
if ($_SESSION['rand'] != $_POST['u_token_key']) {
header('Location: /404.php');
exit;
}
$user_id = __paramInit('int', 'uid', 'uid', 0);
permissions::deleteUser($user_id);
header('Location: ?action=user_list');
exit;
break;
case 'user_edit':
$user_id = __paramInit('int', 'uid', 'uid');
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
$user = new users();
$user->GetUserByUID($user_id);
$groups = permissions::getAllGroups();
foreach ($groups as $k => $group) {
$g_rights = permissions::getGroupInfo($group['id']);
$groups[$k]['rights'] = $g_rights['rights'];
}
$rights = permissions::getAllRights();
$user_groups_data = permissions::getUserGroups($user_id);
$user_groups = array();
$user_groups_rights = array();
foreach ($user_groups_data as $user_group) {
array_push($user_groups, $user_group['id']);
$g_rights = permissions::getGroupInfo($user_group['id']);
if ($g_rights['rights']) {
foreach ($g_rights['rights'] as $g_right) {
if (!in_array($g_right, $user_groups_rights)) {
array_push($user_groups_rights, $g_right);