|
20 | 20 | $server_id = $info['server_id']; |
21 | 21 | $inbound_id = $info['inbound_id']; |
22 | 22 | $protocol = $info['protocol']; |
23 | | - $server_id = $info['server_id']; |
24 | 23 | $rahgozar = $info['rahgozar']; |
25 | 24 |
|
26 | 25 | $file_id = $info['fileid']; |
|
33 | 32 | $customPort = $file_detail['custom_port']; |
34 | 33 | $customSni = $file_detail['custom_sni']; |
35 | 34 |
|
| 35 | + |
| 36 | + $stmt = $connection->prepare("SELECT * FROM `server_config` WHERE id=?"); |
| 37 | + $stmt->bind_param("i", $server_id); |
| 38 | + $stmt->execute(); |
| 39 | + $server_info = $stmt->get_result()->fetch_assoc(); |
| 40 | + $stmt->close(); |
| 41 | + $serverType = $server_info['type']; |
| 42 | + |
36 | 43 | $response = getJson($server_id)->obj; |
37 | 44 | if($inbound_id == 0) { |
38 | 45 | foreach($response as $row){ |
| 46 | + $clientInbound = $row->id; |
39 | 47 | $clients = json_decode($row->settings)->clients; |
40 | 48 | if($clients[0]->id == $uuid || $clients[0]->password == $uuid) { |
41 | 49 | $total = $row->total; |
|
50 | 58 | }else { |
51 | 59 | foreach($response as $row){ |
52 | 60 | if($row->id == $inbound_id) { |
| 61 | + $clientInbound = $row->id; |
53 | 62 | $port = $row->port; |
54 | 63 | $netType = json_decode($row->streamSettings)->network; |
55 | 64 | $security = json_decode($row->streamSettings)->security; |
|
93 | 102 |
|
94 | 103 | $newRemark = preg_replace("/\(📊.+-.+\|📆.+\)/","", $remark) . "(📊" . $totalUsed . " - " . $total . "|📆" . $daysLeft . ")"; |
95 | 104 | if($inbound_id == 0) $res = editInboundRemark($server_id, $uuid, $newRemark); |
96 | | - else $res = editClientRemark($server_id, $inbound_id, $uuid, $newRemark); |
| 105 | + else $res = editClientRemark($server_id, $clientInbound, $uuid, $newRemark); |
97 | 106 |
|
98 | 107 | if($res->success){ |
99 | 108 | $vraylink = getConnectionLink($server_id, $uniqid, $protocol, $newRemark, $port, $netType, $inbound_id, $rahgozar, $customPath, $customPort, $customSni); |
|
0 commit comments