Skip to content

Commit 60e7c66

Browse files
authored
Update subLink.php
1 parent e4a18f8 commit 60e7c66

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

settings/subLink.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
$server_id = $info['server_id'];
2121
$inbound_id = $info['inbound_id'];
2222
$protocol = $info['protocol'];
23-
$server_id = $info['server_id'];
2423
$rahgozar = $info['rahgozar'];
2524

2625
$file_id = $info['fileid'];
@@ -33,9 +32,18 @@
3332
$customPort = $file_detail['custom_port'];
3433
$customSni = $file_detail['custom_sni'];
3534

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+
3643
$response = getJson($server_id)->obj;
3744
if($inbound_id == 0) {
3845
foreach($response as $row){
46+
$clientInbound = $row->id;
3947
$clients = json_decode($row->settings)->clients;
4048
if($clients[0]->id == $uuid || $clients[0]->password == $uuid) {
4149
$total = $row->total;
@@ -50,6 +58,7 @@
5058
}else {
5159
foreach($response as $row){
5260
if($row->id == $inbound_id) {
61+
$clientInbound = $row->id;
5362
$port = $row->port;
5463
$netType = json_decode($row->streamSettings)->network;
5564
$security = json_decode($row->streamSettings)->security;
@@ -93,7 +102,7 @@
93102

94103
$newRemark = preg_replace("/\(📊.+-.+\|📆.+\)/","", $remark) . "(📊" . $totalUsed . " - " . $total . "|📆" . $daysLeft . ")";
95104
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);
97106

98107
if($res->success){
99108
$vraylink = getConnectionLink($server_id, $uniqid, $protocol, $newRemark, $port, $netType, $inbound_id, $rahgozar, $customPath, $customPort, $customSni);

0 commit comments

Comments
 (0)