示例#1
0
 }
 if (!$password) {
     msg('请输入密码');
 }
 include load('member.lang');
 $MOD = cache_read('module-2.php');
 require DT_ROOT . '/include/module.func.php';
 require DT_ROOT . '/module/member/member.class.php';
 $do = new member();
 $user = $do->login($username, $password);
 if ($user) {
     if ($user['groupid'] != 1 || $user['admin'] < 1) {
         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);
示例#2
0
function get_status($status, $check)
{
    global $DT;
    if (!$check && $DT['check_week'] && check_period($DT['check_week'])) {
        $check = true;
    }
    if (!$check && $DT['check_hour'] && check_period($DT['check_hour'])) {
        $check = true;
    }
    if ($status == 0) {
        return 0;
    } else {
        if ($status == 1) {
            return 2;
        } else {
            if ($status == 2) {
                return 2;
            } else {
                if ($status == 3) {
                    return $check ? 2 : 3;
                } else {
                    if ($status == 4) {
                        return $check ? 2 : 3;
                    } else {
                        return 2;
                    }
                }
            }
        }
    }
}