$tpl['_body'] = 'list'; /* ------------------------------------------------------ */ // - 异步 - 列表页,列表查询 /* ------------------------------------------------------ */ if ($_REQUEST['act'] == 'list') { /* 列表查询 */ if ($_REQUEST['actsub'] == 'query') { /* 初始化页面信息 */ $tpl['_bodysub'] = 'query'; } /* 返回JSON */ make_json_ok('', tpl_fetch('db_optimize.html', $tpl)); } else { /* 初始化页面信息 */ $tpl['_header'] = 'title'; /* 取得管理员的优化操作 */ $m_aa = admin_module_acts('db_optimize.php'); $m_ab = filter_module_acts($m_aa, array('optimize'), true); /* 操作属性 */ $attribs = array(); $attribs['optimize']['icon'] = 'optimize'; $attribs['optimize']['onclick'] = 'deal_dboptimize()'; /* 初始化页面信息 */ $tpl['title'] = admin_privilege_name_fk('db_optimize.php', 'optimize'); //权限名称 $tpl['titleacts'] = format_module_acts($m_ab, $attribs, 'btn'); //格式化模块的操作(非内嵌) } } /* 加载视图 */ include $_CFG['DIR_ADMIN_TPL'] . 'db_optimize.html';
$sql .= ' OR (' . tname('role') . '.lft>' . $_PRIV['role']['lft']; $sql .= ' AND ' . tname('role') . '.rht<' . $_PRIV['role']['rht'] . '))'; if ($_GET['limit'] == 'choice') { if (is_string($_GET['ids']) || $_GET['ids'] != '') { $sql .= ' AND admin_id IN("' . implode('","', explode(',', $_GET['ids'])) . '")'; } else { $sql .= ' LIMIT 0,0'; } } /* 导出数据 */ list_export('admin.csv', $db->getAll($sql)); } else { /* 权限检查 */ admin_privilege_valid('admin.php', 'list'); /* 取得管理员的非增加、列表操作 */ $m_aa = admin_module_acts('admin.php'); $m_ac = filter_module_acts($m_aa, array('add', 'list'), false); /* 管理员列表(子级管理员) - 如果是当前管理员ID为1,则列出所有无角色的管理员 */ $tpl['list'] = list_admin(array('role_info' => $_PRIV['role'])); /* 管理员列表 - 数据重构,绑定操作权限 */ foreach ($tpl['list']['data'] as $i => $r) { /* 编辑操作 */ $attribs = array(); $attribs['edit']['onclick'] = "wnd_admin_fill(this,'edit',{$r[admin_id]})"; /* 删除操作 */ $attribs['del']['onclick'] = "ListTable.del(this,{$r[admin_id]},'"; $attribs['del']['onclick'] .= f(sprintf($_LANG['spr_confirm_del'], $r['name']), 'hstr') . "')"; /* 绑定操作 */ $tpl['list']['data'][$i]['acts'] = format_module_acts($m_ac, $attribs, 'a'); } /* 初始化页面信息 */
init_privilege_sys_pfile(); make_json_ok(); } } elseif ($_REQUEST['act'] == 'del') { /* 权限检查 */ admin_privilege_valid('privilege.php', 'del'); /* 删除权限 */ del_privilege(array('privilege_id' => $_POST['id'])); /* 初始化权限系统的权限文件和系统提示 */ init_privilege_sys_pfile(); make_json_ok(); } else { /* 权限检查 */ admin_privilege_valid('privilege.php', 'list'); /* 取得管理员的非增加、列表操作 */ $m_aa = admin_module_acts('privilege.php'); $m_ac = filter_module_acts($m_aa, array('add', 'list'), false); /* 权限列表 */ $tpl['list'] = list_privilege(); /* 权限列表 - 数据重构,绑定操作权限 */ foreach ($tpl['list']['data'] as $i => $r) { /* 编辑操作 */ $attribs = array(); $attribs['edit']['onclick'] = "wnd_privilege_fill(this,'edit',{$r[privilege_id]})"; /* 删除操作 */ $attribs['del']['onclick'] = "ListTable.del(this,{$r[privilege_id]},'"; $attribs['del']['onclick'] .= f(sprintf($_LANG['spr_confirm_del'], $r['name']), 'hstr') . "')"; /* 绑定操作 */ $tpl['list']['data'][$i]['acts'] = format_module_acts($m_ac, $attribs, 'a'); } /* HTML控件 */
/* 初始化页面信息 */ $tpl['_bodysub'] = 'query'; } /* 返回JSON */ make_json_ok('', tpl_fetch('db_backup.html', $tpl)); } else { /* HTML控件 */ $attribs = array(); $attribs['upload'] = array('onclick' => "filecbox_upload(this,{'confirm':'确定上传SQL文件?'});"); $attribs['overlay'] = array('style' => "border-right-width:0px;"); $attribs['filebox'] = array('onchange' => "filecbox_change(this,filecbox_change_ext('sql','请上传SQL文件!'));"); $tpl['cbox_file'] = filecbox('file', $attribs); /* 初始化页面信息 */ $tpl['_header'] = 'title'; /* 取得管理员的备份操作 */ $m_aa = admin_module_acts('db_backup.php'); $m_ab = filter_module_acts($m_aa, array('backup'), true); /* 操作属性 */ $attribs = array(); $attribs['backup']['onclick'] = 'wnd_dbbackup_fill()'; /* 初始化页面信息 */ $tpl['title'] = admin_privilege_name_fk('db_backup.php', 'backup'); //权限名称 $tpl['titleacts'] = format_module_acts($m_ab, $attribs, 'btn'); //格式化模块的操作(非内嵌) } } /* 加载视图 */ include $_CFG['DIR_ADMIN_TPL'] . 'db_backup.html'; ?>
$info_p = info_role(array('role_id' => $_GET['prole_id'])); /* 允许获取权限表检查 */ allow_privtable($info_p); /* 角色权限IDS */ $role_priv_ids = all_role_privilege_id(array('role_id' => $info_p['role_id'])); /* 角色权限表 */ if (empty($role_priv_ids)) { exit('<div class="tips-div"><span>' . $_LANG['str_role_nopriv'] . '</span></div>'); } else { exit(html_privilege_table('privilege_ids', '', $role_priv_ids)); } } else { /* 权限检查 */ admin_privilege_valid('role.php', 'list'); /* 取得管理员的非增加、列表操作 */ $m_aa = admin_module_acts('role.php'); $m_ac = filter_module_acts($m_aa, array('add', 'list'), false); array_unshift($m_ac, array('module_act_name' => $_LANG['act_dmove'], 'module_act_code' => 'dmove')); array_unshift($m_ac, array('module_act_name' => $_LANG['act_umove'], 'module_act_code' => 'umove')); /* 角色列表,小于当前管理员角色的角色 */ $tpl['all'] = sub_role(array('info' => $_PRIV['role']), false); /* 角色列表 - 数据重构,绑定操作权限 */ foreach ($tpl['all'] as $i => $r) { $tpl['all'][$i]['pre'] = '<span class="'; $tpl['all'][$i]['pre'] .= ($r['lvl'] == 1 && $r['rht'] - $r['lft'] > 1 ? 'plus' : 'minus') . '" style="'; $tpl['all'][$i]['pre'] .= $r['rht'] - $r['lft'] > 1 ? 'cursor:pointer;' : ''; $tpl['all'][$i]['pre'] .= 'margin-left:' . intval($r['lvl'] - $tpl['all'][0]['lvl']) * 2 . 'em;" '; $tpl['all'][$i]['pre'] .= 'onclick="tabletree_click(this)"></span>'; /* 编辑操作 */ $attribs = array(); $attribs['edit']['onclick'] = "wnd_role_fill(this,'edit',{$r[role_id]})";