hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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();