mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-03 02:58:42 +00:00
Fixed few subscription bugs
This commit is contained in:
@@ -19,7 +19,7 @@ trait ClientConfig
|
||||
if (str_contains($target, 'quantumult')) {
|
||||
return $this->quantumult();
|
||||
}
|
||||
if (str_contains($target, 'clash')) {
|
||||
if (str_contains($target, 'clash') || str_contains($target, 'stash')) {
|
||||
return $this->clash();
|
||||
}
|
||||
if (str_contains($target, 'bob_vpn')) {
|
||||
@@ -48,7 +48,7 @@ trait ClientConfig
|
||||
$user = $this->getUser();
|
||||
$uri = '';
|
||||
if (sysConfig('is_custom_subscribe')) {
|
||||
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=$user->expiration_date");
|
||||
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=".strtotime($user->expired_at));
|
||||
}
|
||||
foreach ($this->getServers() as $server) {
|
||||
if ($server['type'] === 'shadowsocks') {
|
||||
@@ -72,7 +72,7 @@ trait ClientConfig
|
||||
{
|
||||
$user = $this->getUser();
|
||||
if (sysConfig('is_custom_subscribe')) {
|
||||
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=$user->expiration_date");
|
||||
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=".strtotime($user->expired_at));
|
||||
}
|
||||
|
||||
return $this->origin();
|
||||
@@ -107,7 +107,7 @@ trait ClientConfig
|
||||
header('profile-update-interval: 24');
|
||||
header('profile-web-page-url:'.sysConfig('website_url'));
|
||||
if (sysConfig('is_custom_subscribe')) {
|
||||
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=$user->expired_at");
|
||||
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=".strtotime($user->expired_at));
|
||||
}
|
||||
$custom_path = '/resources/rules/custom.clash.yaml';
|
||||
if ($client === 'bob') {
|
||||
@@ -198,12 +198,12 @@ trait ClientConfig
|
||||
}
|
||||
$text .= ', '.trans('model.user.expired_date').": $user->expiration_date";
|
||||
} else {
|
||||
$text .= trans('reason.user.account.reason.expired');
|
||||
$text .= trans('user.account.reason.expired');
|
||||
}
|
||||
$uri .= $this->failedProxyReturn($text, 2);
|
||||
}
|
||||
|
||||
return $uri.$this->origin();
|
||||
return base64_encode($uri.$this->origin(false));
|
||||
}
|
||||
|
||||
private function shaodowsocksSIP008(): string
|
||||
|
||||
@@ -49,7 +49,7 @@ class ProxyService extends BaseService
|
||||
}
|
||||
|
||||
$max = (int) sysConfig('subscribe_max');
|
||||
if ($max) { // 订阅数量限制
|
||||
if ($max && count($servers) > $max) { // 订阅数量限制
|
||||
$servers = Arr::random($servers, $max);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class ProxyService extends BaseService
|
||||
'type' => 'shadowsocks',
|
||||
'passwd' => $user->passwd,
|
||||
], $node->profile);
|
||||
if ($node->port) {
|
||||
if ($node->port && $node->port !== 0) {
|
||||
$config['port'] = $node->port;
|
||||
} else {
|
||||
$config['port'] = $user->port;
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
return [
|
||||
'name' => 'ProxyPanel',
|
||||
'number' => '2.7.e',
|
||||
'number' => '2.7.f',
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user