Exemple #1
0
                 }
                 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);
Exemple #2
0
            msg('您无权限访问后台', $MODULE[2]['linkurl'] . 'logout.php?forward=' . urlencode(DT_PATH));
        }
        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')));
    }