Beispiel #1
0
    if ($system['code'] == 1) {
        check_code($_POST['code'], $_SESSION['code']);
    }
    //引入验证文件
    include ROOT_PATH . 'includes/login.func.php';
    //接收数据
    $clean = array();
    $clean['username'] = check_username($_POST['username'], 2, 20);
    $clean['password'] = check_password($_POST['password'], 6);
    $clean['time'] = check_time($_POST['time']);
    //数据库验证
    if (!!($rows = fetch_array("SELECT bbs_username,bbs_uniqid,bbs_level FROM bbs_users WHERE bbs_username='******'username']}' AND bbs_password='******'password']}' AND bbs_active='' LIMIT 1"))) {
        //登录成功后记录登录信息
        query("UPDATE bbs_users SET bbs_last_time=NOW(),bbs_last_ip='{$_SERVER["REMOTE_ADDR"]}',bbs_login_count=bbs_login_count+1 WHERE\n                        bbs_username='******'bbs_username']}'");
        //session_destroy();
        setcookies($rows['bbs_username'], $rows['bbs_uniqid'], $clean['time']);
        //管理员生成session
        if ($rows['bbs_level'] == 1) {
            $_SESSION['admin'] = $rows['bbs_username'];
        }
        close();
        location(null, 'userzone.php');
    } else {
        close();
        //session_destroy();
        location('用户名或密码不正确或者该账户未被激活!', 'login.php');
    }
}
?>
<!DOCTYPE html>
<html lang="en">
Beispiel #2
0
                                $parseDate['sy_webkeyword'] = $value['webkeyword'];
                            }
                            if ($value['webmeta']) {
                                $parseDate['sy_webmeta'] = $value['webmeta'];
                            }
                            if ($value['style']) {
                                $parseDate['style'] = $value['style'];
                            }
                            $parseDate['sy_weburl'] = $host;
                            if (strpos($host, $config['sy_onedomain']) !== false) {
                                $domainUrl = $config['sy_onedomain'];
                            } else {
                                $domainUrlAll = parse_url($host);
                                $domainUrl = $domainUrlAll['host'];
                            }
                            setcookies($parseDate, time() + 86400, $domainUrl);
                            $config = array_merge($config, $parseDate);
                        }
                    }
                }
            }
        }
    }
}
function setcookies($parseDate = array(), $time, $domain)
{
    $domain = get_domain($domain);
    if (is_array($parseDate)) {
        foreach ($parseDate as $key => $value) {
            SetCookie($key, $value, $time, "/", $domain);
        }