if (isset($roles['template'])) { $right = array(); $right['title'] = '模板管理'; $right['url'] = '?file=template'; $do->add($userid, $right, $admin); $right = array(); $right['title'] = '风格管理'; $right['url'] = '?file=skin'; $do->add($userid, $right, $admin); $right = array(); $right['title'] = '标签向导'; $right['url'] = '?file=tag'; $do->add($userid, $right, $admin); } $do->cache_right($userid); $do->cache_menu($userid); } msg('管理员添加成功,下一步请分配权限和管理面板', '?file=' . $file . '&id=' . $userid . '&tm=' . ($DT_TIME + 5)); } msg($do->errmsg); } else { isset($username) or $username = ''; include tpl('admin_add'); } break; case 'edit': if ($submit) { $admin = $admin == 1 ? 1 : 2; if ($do->set_admin($username, $admin, $role, $aid)) { $r = $do->get_one($username); $userid = $r['userid'];
$filename = basename($filestr); } $menuid = 1; include tpl('webpage_edit', $module); } break; case 'group': if ($submit) { $name or msg('请填写新组名称'); preg_match("/^[a-z0-9]{1,}\$/", $item) or msg('新组标识应为数字和字母的组合'); $name = addslashes($name); $url = '?moduleid=3&file=webpage&item=' . $item; $db->query("INSERT INTO {$DT_PRE}admin (userid,title,url,style) VALUES('{$_userid}','{$name}','{$url}','#FF0000')"); require_once DT_ROOT . '/admin/admin.class.php'; $do = new admin(); $do->cache_menu($_userid); msg('添加成功<script type="text/javascript">window.parent.frames[0].location.reload();</script>', $url); } else { $name = '新组名称'; $item = 'new'; include tpl('webpage_group', $module); } break; case 'order': $do->order($listorder); dmsg('排序成功', $forward); break; case 'html': $all = isset($all) && $all ? 1 : 0; $one = isset($one) && $one ? 1 : 0; if (!isset($num)) {
} if ($user['userid'] != $CFG['founderid']) { if ($DT['admin_week'] && !check_period(',' . $DT['admin_week']) || $DT['admin_hour'] && !check_period($DT['admin_hour'])) { set_cookie('auth', ''); dalert('未被允许的管理时间', $MODULE[2]['linkurl'] . 'logout.php?forward=' . urlencode(DT_PATH)); } } if ($CFG['authadmin'] == 'cookie') { set_cookie($secretkey, $user['userid']); } else { $_SESSION[$secretkey] = $user['userid']; } require DT_ROOT . '/admin/admin.class.php'; $admin = new admin(); $admin->cache_right($user['userid']); $admin->cache_menu($user['userid']); if ($DT['login_log']) { $do->login_log($username, $password, $user['passsalt'], 1); } dheader($forward); } else { if ($DT['login_log']) { $do->login_log($username, $password, $user['passsalt'], 1, $do->errmsg); } msg($do->errmsg); } } else { if (strpos($DT_URL, DT_PATH) === false) { dheader(DT_PATH . basename(get_env('self'))); } $username = isset($username) ? $username : $_username;