Skip to content

Commit 26fea33

Browse files
authored
Update config.php
1 parent 07d87d7 commit 26fea33

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

config.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ function checkSpam(){
437437
$spamInfo['count'] = 1;
438438
$spamInfo['date'] = strtotime("+1 minute");
439439
}
440-
if($spamInfo['count'] >= 50){
440+
if($spamInfo['count'] >= 20){
441441
$spamInfo['banned'] = strtotime("+1 day");
442442
}
443443
$spamInfo = json_encode($spamInfo);
@@ -1676,7 +1676,7 @@ function getOrderDetailKeys($from_id, $id){
16761676
];
16771677

16781678
$temp = array();
1679-
if($price != 0){
1679+
if($price != 0 && $agentBought == true){
16801680
if($botState['renewAccountState']=="on") $temp[] = ['text' => $buttonValues['renew_config'], 'callback_data' => "renewAccount$id" ];
16811681
if($botState['switchLocationState']=="on") $temp[] = ['text' => $buttonValues['change_config_location'], 'callback_data' => "switchLocation{$id}_{$server_id}_{$leftgb}_".$order['expire_date']];
16821682
}
@@ -1711,7 +1711,7 @@ function getOrderDetailKeys($from_id, $id){
17111711

17121712

17131713
$temp = array();
1714-
if($price != 0){
1714+
if($price != 0 || $agentBought == true){
17151715
if($botState['renewAccountState']=="on") $temp[] = ['text' => $buttonValues['renew_config'], 'callback_data' => "renewAccount$id" ];
17161716
if($botState['switchLocationState']=="on") $temp[] = ['text' => $buttonValues['change_config_location'], 'callback_data' => "switchLocation{$id}_{$server_id}_{$leftgb}_".$order['expire_date'] ];
17171717
}
@@ -1747,7 +1747,7 @@ function getOrderDetailKeys($from_id, $id){
17471747

17481748

17491749
$temp = array();
1750-
if($price != 0){
1750+
if($price != 0 || $agentBought == true){
17511751
if($botState['renewAccountState']=="on") $temp[] = ['text' => $buttonValues['renew_config'], 'callback_data' => "renewAccount$id" ];
17521752
if($botState['switchLocationState']=="on") $temp[] = ['text' => $buttonValues['change_config_location'], 'callback_data' => "switchLocation{$id}_{$server_id}_{$leftgb}_".$order['expire_date'] ];
17531753
}
@@ -1781,7 +1781,7 @@ function getOrderDetailKeys($from_id, $id){
17811781
];
17821782

17831783
$temp = array();
1784-
if($price != 0){
1784+
if($price != 0 || $agentBought == true){
17851785
if($botState['renewAccountState']=="on") $temp[] = ['text' => $buttonValues['renew_config'], 'callback_data' => "renewAccount$id" ];
17861786
if($botState['switchLocationState']=="on") $temp[] = ['text' => $buttonValues['change_config_location'], 'callback_data' => "switchLocation{$id}_{$server_id}_{$leftgb}_".$order['expire_date'] ];
17871787
}
@@ -1822,7 +1822,7 @@ function getOrderDetailKeys($from_id, $id){
18221822
];
18231823

18241824
$temp = array();
1825-
if($price != 0){
1825+
if($price != 0 || $agentBought == true){
18261826
if($botState['renewAccountState']=="on") $temp[] = ['text' => $buttonValues['renew_config'], 'callback_data' => "renewAccount$id" ];
18271827
if($botState['switchLocationState']=="on" && $rahgozar != true) $temp[] = ['text' => $buttonValues['change_config_location'], 'callback_data' => "switchLocation{$id}_{$server_id}_{$leftgb}_".$order['expire_date'] ];
18281828
}
@@ -1857,7 +1857,7 @@ function getOrderDetailKeys($from_id, $id){
18571857
];
18581858

18591859
$temp = array();
1860-
if($price != 0){
1860+
if($price != 0 || $agentBought == true){
18611861
if($botState['renewAccountState']=="on") $temp[] = ['text' => $buttonValues['renew_config'], 'callback_data' => "renewAccount$id" ];
18621862
if($botState['switchLocationState']=="on" && $rahgozar != true) $temp[] = ['text' => $buttonValues['change_config_location'], 'callback_data' => "switchLocation{$id}_{$server_id}_{$leftgb}_".$order['expire_date'] ];
18631863
}
@@ -1877,8 +1877,8 @@ function getOrderDetailKeys($from_id, $id){
18771877
$msg = str_replace(['NAME','CONNECT-LINK', 'SUB-LINK'], [$remark, $configLinks, $subLink], $mainValues['config_details_message']);
18781878

18791879
$extrakey = [];
1880-
if($botState['increaseVolumeState']=="on" && $price != 0) $extrakey[] = ['text' => $buttonValues['increase_config_volume'], 'callback_data' => "increaseAVolume{$id}"];
1881-
if($botState['increaseTimeState']=="on" && $price != 0) $extrakey[] = ['text' => $buttonValues['increase_config_days'], 'callback_data' => "increaseADay{$id}"];
1880+
if($botState['increaseVolumeState']=="on" && ($price != 0 || $agentBought == true)) $extrakey[] = ['text' => $buttonValues['increase_config_volume'], 'callback_data' => "increaseAVolume{$id}"];
1881+
if($botState['increaseTimeState']=="on" && ($price != 0 || $agentBought == true)) $extrakey[] = ['text' => $buttonValues['increase_config_days'], 'callback_data' => "increaseADay{$id}"];
18821882
$keyboard[] = $extrakey;
18831883

18841884

@@ -2345,6 +2345,7 @@ function renewInboundUuid($server_id, $remark){
23452345

23462346
$newUuid = generateUID();
23472347
$settings['clients'][0]['id'] = $newUuid;
2348+
if(!isset($settings['clients'][0]['subId']) && ($serverType == "sanaei" || $serverType == "alireza")) $settings['clients'][0]['subId'] = RandomString(16);
23482349

23492350
$editedClient = $settings['clients'][$client_key];
23502351
$settings['clients'] = array_values($settings['clients']);
@@ -2442,6 +2443,7 @@ function renewClientUuid($server_id, $inbound_id, $remark){
24422443

24432444
$newUuid = generateUID();
24442445
$settings['clients'][$client_key]['id'] = $newUuid;
2446+
if(!isset($settings['clients'][$client_key]['subId']) && ($serverType == "sanaei" || $serverType == "alireza")) $settings['clients'][$client_key]['subId'] = RandomString(16);
24452447

24462448
$editedClient = $settings['clients'][$client_key];
24472449
$settings['clients'] = array_values($settings['clients']);
@@ -2571,6 +2573,7 @@ function editClientRemark($server_id, $inbound_id, $remark, $newRemark){
25712573
}
25722574
}
25732575
$settings['clients'][$client_key]['email'] = $newRemark;
2576+
if(!isset($settings['clients'][$client_key]['subId']) && ($serverType == "sanaei" || $serverType == "alireza")) $settings['clients'][$client_key]['subId'] = RandomString(16);
25742577

25752578
$editedClient = $settings['clients'][$client_key];
25762579
$settings['clients'] = array_values($settings['clients']);
@@ -2707,6 +2710,7 @@ function editClientTraffic($server_id, $inbound_id, $remark, $volume, $days, $ed
27072710
else resetClientTraffic($server_id, $remark);
27082711
}
27092712
$settings['clients'][$client_key]['totalGB'] = $volume;
2713+
if(!isset($settings['clients'][$client_key]['subId']) && ($serverType == "sanaei" || $serverType == "alireza")) $settings['clients'][$client_key]['subId'] = RandomString(16);
27102714
}
27112715

27122716
if($days != 0){
@@ -2716,6 +2720,7 @@ function editClientTraffic($server_id, $inbound_id, $remark, $volume, $days, $ed
27162720
if($editType == "renew") $expire_microdate = $now_microdate + $extend_date;
27172721
else $expire_microdate = ($now_microdate > $expiryTime) ? $now_microdate + $extend_date : $expiryTime + $extend_date;
27182722
$settings['clients'][$client_key]['expiryTime'] = $expire_microdate;
2723+
if(!isset($settings['clients'][$client_key]['subId']) && ($serverType == "sanaei" || $serverType == "alireza")) $settings['clients'][$client_key]['subId'] = RandomString(16);
27192724
}
27202725
$editedClient = $settings['clients'][$client_key];
27212726
$settings['clients'] = array_values($settings['clients']);

0 commit comments

Comments
 (0)