2 Star 1 Fork 0

黄Java/RBAC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
power.php 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
wangpeiwen 提交于 2014-01-17 10:51 . 修正一些bug,完善功能
<?php session_start(); ?>
<?php header("Content-type: text/html; charset=utf-8"); ?>
<?php
include __DIR__ . '/db/db.php';
include __DIR__ . '/func/functions.php';
//$args = filter_input_array(INPUT_GET, [
// 'do' => FILTER_DEFAULT,
// 'id' => FILTER_DEFAULT
// ]);
$owner = Owner::find_by_user_id($_SESSION['id']);
if ($owner == null) {
jumpTo('no role', 'main.php');
}
$queue[] = [
'id' => $owner->role_id
];
while ($queue != null) {
$record = array_pop($queue);
foreach (Level::find('all', ['h_id' => $record['id']]) as $value) {
$roles_name[] = ['name' => $value->low->name];
array_push($queue, ['id' => $value->l_id]);
}
}
$result = [];
array_push($result, [
'name' => Role::find_by_id($owner->role_id)->name
]);
if ($roles_name != null) {
foreach ($roles_name as $value) {
$role[] = $value['name'];
}
$role = array_unique($role);
foreach ($role as $value) {
$result[] = ['name' => $value];
}
}
$temple = __DIR__ . '/module/power.phtml';
include __DIR__ . '/module/public/layout.phtml';
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/javahuang/RBAC.git
git@gitee.com:javahuang/RBAC.git
javahuang
RBAC
RBAC
master

搜索帮助