Exemple #1
0
if (isset($_GET['code'])) {
    $code = $_GET['code'];
} else {
    header('Location: ./');
    exit;
}
//Check Valid
$url = 'https://passport.sky31.com/api/check_code.php?role=' . ROLE . '&hash=' . HASH . '&code=' . $code;
$jsonData = getSslData($url);
$jsonArray = json_decode($jsonData, 'ture');
if (isset($jsonArray) && $jsonArray['code'] != 0) {
    die("<script>alert('账号验证失败!');document.location = './';</script>");
}
//Setting Back To Page
if (isset($_SESSION['bakStatus']) && $_SESSION['bakStatus'] == 1) {
    $backPage = $_SESSION['bakPage'] . '.php';
    $_SESSION['bakStatus'] = 0;
}
//Setting Session
$_SESSION = $jsonArray['data'];
$_SESSION['loginStatus'] = 1;
$_SESSION['studentName'] = $jsonArray['data']['name'];
$_SESSION['password'] = passwordDecode($jsonArray['data']['password']);
//Back To Page
if (isset($backPage)) {
    header("Location: {$backPage}");
    exit;
} else {
    header("Location: ./");
    exit;
}
Exemple #2
0
<?php 
header("Content-type: text/html; charset=utf-8");
session_start();
include 'config.php';
include 'lib/getSslData.inc.php';
include 'lib/processPassword.inc.php';
//Check Valid
if (isset($_SESSION['sid'])) {
    $url = 'https://passport.sky31.com/api/get_ecard_password.php?role=' . ROLE . '&hash=' . HASH . '&sid=' . $_SESSION['sid'];
    $jsonData = getSslData($url);
    $jsonArray = json_decode($jsonData, 'ture');
    if (isset($jsonArray) && $jsonArray['code'] == 0) {
        $password = passwordDecode($jsonArray['password']);
        echo '<form style="display:none" id="loginForm" name="loginForm" action="ecard_balance.php" method="POST"><input name="sid" id="sid" value="' . $_SESSION['sid'] . '"/><input name="password" id="password" value="' . $password . '"/><input name="bind_status" id="bind_status" value="1"/></form>';
        echo "<script type='text/javascript'>function load_submit(){document.loginForm.submit()}load_submit();</script>";
        exit;
    }
}
?>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="<?php 
echo $description;
?>
">
	<title>查饭卡 - <?php