<?php
|
include_once "/Account/User.php";
|
include_once "/Common/Logging.php";
|
include_once "/Common/CommFunc.php";
|
|
function Process()
|
{
|
\CommFunc\SessionStart();
|
\Logging\CreateLogging("SelectJump.php");
|
\Logging\LogInfo("_POST:" . print_r($_POST, true));
|
\Logging\LogInfo("_SESSION:" . print_r($_SESSION, true));
|
$select_spid = $_POST['select_spid'];
|
$select_id = $_POST['select_id'];
|
|
\Logging\LogInfo("选择服务器: select_spid: " . $select_spid . " select_id: " . $select_id);
|
|
$user = new \User\User($_SESSION['UserAccount']);
|
$spid = $user->GetSPID();
|
|
// 切换spid, 重刷服务器列表
|
if ($select_spid != $spid) {
|
$user->ResetServers();
|
}
|
|
$saveSession = array('spid' => $select_spid, 'server_id' => $select_id);
|
\CommFunc\SessionSave($saveSession);
|
|
$serversArray = $user->GetServers();
|
if (array_key_exists($select_id, $serversArray)) {
|
$Page = $serversArray[$select_id]["Page"];
|
$ServerID = $serversArray[$select_id]["ServerID"];
|
\Logging\LogInfo("服务器ToolPage: " . $Page);
|
$saveSession['tool_page'] = $Page;
|
$saveSession['serverID'] = intval($ServerID);
|
\CommFunc\SessionSave($saveSession);
|
} else {
|
\Logging\LogError("选择的服务器不存在: select_id:" . $select_id . " not in serversArray:" . print_r($serversArray, true));
|
header("location:/Account/Server/SelectServer.php?error=1");
|
return;
|
}
|
|
\Logging\LogInfo("_SESSION after:" . print_r($_SESSION, true));
|
header("Location:/index.php");
|
}
|
|
Process();
|