no message

master
mmmwhy 9 years ago
parent ae13416c9c
commit 3426112a55

1
.gitignore vendored

@ -8,3 +8,4 @@ config/.config.php
resources/views/material/analytics.tpl resources/views/material/analytics.tpl
*.iml *.iml
*.xml *.xml
*.bak

@ -356,12 +356,12 @@ class AuthController extends BaseController
$user->node_speedlimit=Config::get('user_speedlimit'); $user->node_speedlimit=Config::get('user_speedlimit');
if (Config::get('enable_invite_code')=='true') { if (Config::get('enable_invite_code')=='true') {
$user->ref_by = $c->user_id; $user->ref_by = $c->user_id;
if ($user->ref_by !=0) { if ($user->ref_by !=0) {
$user->money=Config::get('invite_get_money'); $user->money=Config::get('invite_get_money');
$gift_user=User::where("id", "=", $user->ref_by)->first(); $gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->transfer_enable=($gift_user->transfer_enable+Config::get('invite_gift')*1024*1024*1024); $gift_user->transfer_enable=($gift_user->transfer_enable+Config::get('invite_gift')*1024*1024*1024);
$gift_user->save(); $gift_user->save();
} }
} else { } else {
$user->ref_by = 0; $user->ref_by = 0;
} }

@ -42,41 +42,41 @@ class HomeController extends BaseController
{ {
return $this->view()->display('tos.tpl'); return $this->view()->display('tos.tpl');
} }
public function staff() public function staff()
{ {
return $this->view()->display('staff.tpl'); return $this->view()->display('staff.tpl');
} }
public function telegram($request, $response, $args) public function telegram($request, $response, $args)
{ {
$token = ""; $token = "";
if (isset($request->getQueryParams()["token"])) { if (isset($request->getQueryParams()["token"])) {
$token = $request->getQueryParams()["token"]; $token = $request->getQueryParams()["token"];
} }
if ($token == Config::get('telegram_request_token')) { if ($token == Config::get('telegram_request_token')) {
TelegramProcess::process(); TelegramProcess::process();
} else { } else {
echo("不正确请求!"); echo("不正确请求!");
} }
} }
public function page404($request, $response, $args) public function page404($request, $response, $args)
{ {
$pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/404/"); $pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/404/");
if (count($pics)>2) { if (count($pics)>2) {
$pic=$pics[rand(2, count($pics)-1)]; $pic=$pics[rand(2, count($pics)-1)];
} else { } else {
$pic="4041.png"; $pic="4041.png";
} }
$newResponse = $response->withStatus(404); $newResponse = $response->withStatus(404);
$newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/404/".$pic)->display('404.tpl')); $newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/404/".$pic)->display('404.tpl'));
return $newResponse; return $newResponse;
} }
public function page405($request, $response, $args) public function page405($request, $response, $args)
{ {
$pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/405/"); $pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/405/");
@ -85,12 +85,12 @@ class HomeController extends BaseController
} else { } else {
$pic="5001.png"; $pic="5001.png";
} }
$newResponse = $response->withStatus(405); $newResponse = $response->withStatus(405);
$newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/405/".$pic)->display('405.tpl')); $newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/405/".$pic)->display('405.tpl'));
return $newResponse; return $newResponse;
} }
public function page500($request, $response, $args) public function page500($request, $response, $args)
{ {
$pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/500/"); $pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/500/");
@ -99,12 +99,12 @@ class HomeController extends BaseController
} else { } else {
$pic="5001.png"; $pic="5001.png";
} }
$newResponse = $response->withStatus(500); $newResponse = $response->withStatus(500);
$newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/500/".$pic)->display('500.tpl')); $newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/500/".$pic)->display('500.tpl'));
return $newResponse; return $newResponse;
} }
public function pay_callback($request, $response, $args) public function pay_callback($request, $response, $args)
{ {
Pay::callback($request); Pay::callback($request);
@ -113,5 +113,5 @@ class HomeController extends BaseController
public function notify($request, $response, $args) public function notify($request, $response, $args)
{ {
Pay::pay91_notify($request); Pay::pay91_notify($request);
} }
} }

@ -345,7 +345,7 @@ class LinkController extends BaseController
"password"=>$item['passwd'], "password"=>$item['passwd'],
"tcp_over_udp"=>false, "tcp_over_udp"=>false,
"udp_over_tcp"=>false, "udp_over_tcp"=>false,
"group"=>$item['group'], "group"=>Config::get('appName'),
"protocol"=>$item['protocol'], "protocol"=>$item['protocol'],
"protoparam"=>$item['protocol_param'], "protoparam"=>$item['protocol_param'],
"obfs_udp"=>false, "obfs_udp"=>false,
@ -1740,7 +1740,6 @@ FINAL,Proxy';
$bash .= 'nvram set rt_ss_port_x'.$count.'='.$item['port']."\n"; $bash .= 'nvram set rt_ss_port_x'.$count.'='.$item['port']."\n";
$bash .= 'nvram set rt_ss_password_x'.$count.'="'.$item['passwd']."\"\n"; $bash .= 'nvram set rt_ss_password_x'.$count.'="'.$item['passwd']."\"\n";
$bash .= 'nvram set rt_ss_server_x'.$count.'='.$item['address']."\n"; $bash .= 'nvram set rt_ss_server_x'.$count.'='.$item['address']."\n";
$bash .= 'nvram set rt_ss_usage_x'.$count.'=""'."\n";
$bash .= 'nvram set rt_ss_method_x'.$count.'='.$item['method']."\n"; $bash .= 'nvram set rt_ss_method_x'.$count.'='.$item['method']."\n";
$count += 1; $count += 1;
} }

@ -34,21 +34,21 @@ class UserController extends BaseController
$users_raw = User::where( $users_raw = User::where(
function ($query) use ($node){ function ($query) use ($node){
$query->where( $query->where(
function ($query1) use ($node){ function ($query1) use ($node){
$query1->where("class", ">=", $node->node_class) $query1->where("class", ">=", $node->node_class)
->where("node_group", "=", $node->node_group); ->where("node_group", "=", $node->node_group);
} }
)->orwhere('is_admin', 1); )->orwhere('is_admin', 1);
} }
) )
->where("enable", 1)->where("expire_in", ">", date("Y-m-d H:i:s"))->get(); ->where("enable", 1)->where("expire_in", ">", date("Y-m-d H:i:s"))->get();
} else { } else {
$users_raw = User::where( $users_raw = User::where(
function ($query) use ($node){ function ($query) use ($node){
$query->where( $query->where(
function ($query1) use ($node){ function ($query1) use ($node){
$query1->where("class", ">=", $node->node_class); $query1->where("class", ">=", $node->node_class);
} }
)->orwhere('is_admin', 1); )->orwhere('is_admin', 1);
} }
)->where("enable", 1)->where("expire_in", ">", date("Y-m-d H:i:s"))->get(); )->where("enable", 1)->where("expire_in", ">", date("Y-m-d H:i:s"))->get();
@ -68,8 +68,8 @@ class UserController extends BaseController
$users = array(); $users = array();
$key_list = array('method', 'obfs', 'obfs_param', 'protocol', 'protocol_param', $key_list = array('method', 'obfs', 'obfs_param', 'protocol', 'protocol_param',
'forbidden_ip', 'forbidden_port', 'node_speedlimit', 'disconnect_ip', 'forbidden_ip', 'forbidden_port', 'node_speedlimit', 'disconnect_ip',
'is_multi_user', 'id', 'port', 'passwd', 'u', 'd'); 'is_multi_user', 'id', 'port', 'passwd', 'u', 'd');
foreach ($users_raw as $user_raw) { foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) { if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {

@ -86,6 +86,7 @@ class UserController extends BaseController
} }
public function lookingglass($request, $response, $args) public function lookingglass($request, $response, $args)
{ {
$Speedtest=Speedtest::where("datetime", ">", time()-Config::get('Speedtest_duration')*3600)->orderBy('datetime', 'desc')->get(); $Speedtest=Speedtest::where("datetime", ">", time()-Config::get('Speedtest_duration')*3600)->orderBy('datetime', 'desc')->get();
@ -144,6 +145,8 @@ class UserController extends BaseController
} }
} }
public function f2fpayget($request, $response, $args) public function f2fpayget($request, $response, $args)
{ {
$time = $request->getQueryParams()["time"]; $time = $request->getQueryParams()["time"];
@ -192,7 +195,8 @@ class UserController extends BaseController
return $response->getBody()->write(json_encode($res)); return $response->getBody()->write(json_encode($res));
} }
public function alipay($request, $response, $args) public function alipay($request, $response, $args)
{ {
$amount = $request->getQueryParams()["amount"]; $amount = $request->getQueryParams()["amount"];
@ -684,10 +688,6 @@ class UserController extends BaseController
$iplocation = new QQWry(); $iplocation = new QQWry();
$userip=array();
$total = Ip::where("datetime",">=",time()-300)->where('userid', '=',$this->user->id)->get();
$totallogin = LoginIp::where('userid', '=', $this->user->id)->where("type", "=", 0)->orderBy("datetime", "desc")->take(10)->get(); $totallogin = LoginIp::where('userid', '=', $this->user->id)->where("type", "=", 0)->orderBy("datetime", "desc")->take(10)->get();
$userloginip=array(); $userloginip=array();
@ -703,29 +703,9 @@ class UserController extends BaseController
} }
} }
foreach($total as $single)
{
//if(isset($useripcount[$single->userid]))
{
$single->ip = Tools::getRealIp($single->ip);
$is_node = Node::where("node_ip", $single->ip)->first();
if($is_node) {
continue;
}
if(!isset($userip[$single->ip]))
{
//$useripcount[$single->userid]=$useripcount[$single->userid]+1;
$location=$iplocation->getlocation($single->ip);
$userip[$single->ip]=iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']);
}
}
}
return $this->view()->assign("userip",$userip)->assign("userloginip", $userloginip)->assign("paybacks", $paybacks)->display('user/profile.tpl'); return $this->view()->assign("userloginip", $userloginip)->assign("paybacks", $paybacks)->display('user/profile.tpl');
} }
@ -970,10 +950,9 @@ class UserController extends BaseController
$price=$shop->price*((100-$credit)/100); $price=$shop->price*((100-$credit)/100);
$user=$this->user; $user=$this->user;
if ($user->money<$price) {
if ((float)$user->money<(float)$price) {
$res['ret'] = 0; $res['ret'] = 0;
$res['msg'] = "余额不足,总价为".$price."元。"; $res['msg'] = "余额不足";
return $response->getBody()->write(json_encode($res)); return $response->getBody()->write(json_encode($res));
} }
@ -1568,4 +1547,5 @@ class UserController extends BaseController
$newResponse = $response->withStatus(302)->withHeader('Location', '/user'); $newResponse = $response->withStatus(302)->withHeader('Location', '/user');
return $newResponse; return $newResponse;
} }
} }

@ -33,7 +33,7 @@ class Config
"enable_analytics_code" => self::get("enable_analytics_code"), "enable_analytics_code" => self::get("enable_analytics_code"),
"enable_donate" => self::get("enable_donate"), "enable_donate" => self::get("enable_donate"),
"enable_telegram" => self::get("enable_telegram") "enable_telegram" => self::get("enable_telegram")
]; ];
} }
public static function getDbConfig() public static function getDbConfig()
@ -81,12 +81,12 @@ class Config
switch ($type) { switch ($type) {
case 'obfs': case 'obfs':
$list = array('plain', 'http_simple', 'http_simple_compatible', 'http_post', 'http_post_compatible', $list = array('plain', 'http_simple', 'http_simple_compatible', 'http_post', 'http_post_compatible',
'tls1.2_ticket_auth', 'tls1.2_ticket_auth_compatible', 'tls1.2_ticket_fastauth', 'tls1.2_ticket_fastauth_compatible', 'tls1.2_ticket_auth', 'tls1.2_ticket_auth_compatible', 'tls1.2_ticket_fastauth', 'tls1.2_ticket_fastauth_compatible',
'simple_obfs_http', 'simple_obfs_http_compatible', 'simple_obfs_tls', 'simple_obfs_tls_compatible'); 'simple_obfs_http', 'simple_obfs_http_compatible', 'simple_obfs_tls', 'simple_obfs_tls_compatible');
return $list; return $list;
case 'protocol': case 'protocol':
$list = array('origin', 'verify_deflate', $list = array('origin', 'verify_deflate',
'auth_sha1_v4', 'auth_sha1_v4_compatible', 'auth_aes128_sha1', 'auth_aes128_md5', 'auth_chain_a', 'auth_chain_b'); 'auth_sha1_v4', 'auth_sha1_v4_compatible', 'auth_aes128_sha1', 'auth_aes128_md5', 'auth_chain_a', 'auth_chain_b');
return $list; return $list;
case 'allow_none_protocol': case 'allow_none_protocol':
$list = array('auth_chain_a', 'auth_chain_b'); $list = array('auth_chain_a', 'auth_chain_b');
@ -96,17 +96,17 @@ class Config
return $list; return $list;
case 'ss_aead_method': case 'ss_aead_method':
$list = array('aes-128-gcm', 'aes-192-gcm', $list = array('aes-128-gcm', 'aes-192-gcm',
'aes-256-gcm', 'chacha20-ietf-poly1305', 'xchacha20-ietf-poly1305'); 'aes-256-gcm', 'chacha20-ietf-poly1305', 'xchacha20-ietf-poly1305');
return $list; return $list;
case 'ss_obfs': case 'ss_obfs':
$list = array('simple_obfs_http', 'simple_obfs_http_compatible', 'simple_obfs_tls', 'simple_obfs_tls_compatible'); $list = array('simple_obfs_http', 'simple_obfs_http_compatible', 'simple_obfs_tls', 'simple_obfs_tls_compatible');
return $list; return $list;
default: default:
$list = array('rc4-md5', 'rc4-md5-6', 'aes-128-cfb', 'aes-192-cfb', 'aes-256-cfb', $list = array('rc4-md5', 'rc4-md5-6', 'aes-128-cfb', 'aes-192-cfb', 'aes-256-cfb',
'aes-128-ctr', 'aes-192-ctr', 'aes-256-ctr', 'camellia-128-cfb', 'camellia-192-cfb', 'camellia-256-cfb', 'aes-128-ctr', 'aes-192-ctr', 'aes-256-ctr', 'camellia-128-cfb', 'camellia-192-cfb', 'camellia-256-cfb',
'bf-cfb', 'cast5-cfb', 'des-cfb', 'des-ede3-cfb', 'idea-cfb', 'bf-cfb', 'cast5-cfb', 'des-cfb', 'des-ede3-cfb', 'idea-cfb',
'rc2-cfb', 'seed-cfb', 'salsa20', 'chacha20', 'chacha20-ietf', 'none', 'aes-128-gcm', 'aes-192-gcm', 'rc2-cfb', 'seed-cfb', 'salsa20', 'chacha20', 'chacha20-ietf', 'none', 'aes-128-gcm', 'aes-192-gcm',
'aes-256-gcm', 'chacha20-ietf-poly1305', 'xchacha20-ietf-poly1305'); 'aes-256-gcm', 'chacha20-ietf-poly1305', 'xchacha20-ietf-poly1305');
return $list; return $list;
} }
} }

@ -16,7 +16,7 @@ class TelegramProcess
今日已使用 ".$user->TodayusedTraffic()." ".number_format(($user->u+$user->d-$user->last_day_t)/$user->transfer_enable*100, 2)."% 今日已使用 ".$user->TodayusedTraffic()." ".number_format(($user->u+$user->d-$user->last_day_t)/$user->transfer_enable*100, 2)."%
今日之前已使用 ".$user->LastusedTraffic()." ".number_format($user->last_day_t/$user->transfer_enable*100, 2)."% 今日之前已使用 ".$user->LastusedTraffic()." ".number_format($user->last_day_t/$user->transfer_enable*100, 2)."%
未使用 ".$user->unusedTraffic()." ".number_format(($user->transfer_enable-($user->u+$user->d))/$user->transfer_enable*100, 2)."% 未使用 ".$user->unusedTraffic()." ".number_format(($user->transfer_enable-($user->u+$user->d))/$user->transfer_enable*100, 2)."%
", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); ", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
break; break;
case 'checkin': case 'checkin':
if (!$user->isAbleToCheckin()) { if (!$user->isAbleToCheckin()) {
@ -24,10 +24,10 @@ class TelegramProcess
break; break;
} }
$traffic = rand(Config::get('checkinMin'), Config::get('checkinMax')); $traffic = rand(Config::get('checkinMin'), Config::get('checkinMax'));
$user->transfer_enable = $user->transfer_enable + Tools::toMB($traffic); $user->transfer_enable = $user->transfer_enable + Tools::toMB($traffic)*2;
$user->last_check_in_time = time(); $user->last_check_in_time = time();
$user->save(); $user->save();
$bot->sendMessage($message->getChat()->getId(), "天若有情天亦老,我为长者续一秒!获得了 ".$traffic." MB 流量!", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); $bot->sendMessage($message->getChat()->getId(), "天若有情天亦老,我为长者续一秒!获得了 ".$traffic." MB 流量!因为我很喜欢你,所以多送你".$traffic." MB 流量!", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
break; break;
default: default:
$bot->sendMessage($message->getChat()->getId(), "???", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); $bot->sendMessage($message->getChat()->getId(), "???", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
@ -40,11 +40,12 @@ class TelegramProcess
public static function telegram_process($bot, $message, $command) public static function telegram_process($bot, $message, $command)
{ {
$bot->sendChatAction($message->getChat()->getId(), 'typing');
$user = User::where('telegram_id', $message->getFrom()->getId())->first(); $user = User::where('telegram_id', $message->getFrom()->getId())->first();
if ($message->getChat()->getId() > 0) { if ($message->getChat()->getId() > 0) {
//个人 //个人
$bot->sendChatAction($message->getChat()->getId(), 'typing');
switch ($command) { switch ($command) {
case 'ping': case 'ping':
@ -68,7 +69,7 @@ class TelegramProcess
/help 获取帮助信息 /help 获取帮助信息
您可以在面板里点击 资料编辑 ,滑到页面最下方,就可以看到 Telegram 绑定指示了,绑定您的账号,更多精彩功能等着您去发掘。 您可以在面板里点击 资料编辑 ,滑到页面最下方,就可以看到 Telegram 绑定指示了,绑定您的账号,更多精彩功能等着您去发掘。
"; ";
$bot->sendMessage($message->getChat()->getId(), $help_list); $bot->sendMessage($message->getChat()->getId(), $help_list);
break; break;
default: default:
@ -167,8 +168,6 @@ class TelegramProcess
return; return;
} }
$bot->sendChatAction($message->getChat()->getId(), 'typing');
switch ($command) { switch ($command) {
case 'ping': case 'ping':
$bot->sendMessage($message->getChat()->getId(), 'Pong!这个群组的 ID 是 '.$message->getChat()->getId().'!', $parseMode = null, $disablePreview = false, $replyToMessageId = $message->getMessageId()); $bot->sendMessage($message->getChat()->getId(), 'Pong!这个群组的 ID 是 '.$message->getChat()->getId().'!', $parseMode = null, $disablePreview = false, $replyToMessageId = $message->getMessageId());

@ -73,7 +73,7 @@ class Tools
public static function genRandomChar($length = 8) public static function genRandomChar($length = 8)
{ {
// 密码字符集,可任意添加你需要的字符 // 密码字符集,可任意添加你需要的字符
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $chars = '123456789';
$char = ''; $char = '';
for ($i = 0; $i < $length; $i++) { for ($i = 0; $i < $length; $i++) {
$char .= $chars[mt_rand(0, strlen($chars) - 1)]; $char .= $chars[mt_rand(0, strlen($chars) - 1)];
@ -267,8 +267,6 @@ class Tools
public static function is_protocol_relay($user) public static function is_protocol_relay($user)
{ {
return true;
$relay_able_list = Config::getSupportParam('relay_able_protocol'); $relay_able_list = Config::getSupportParam('relay_able_protocol');
if (in_array($user->protocol, $relay_able_list) || Config::get('relay_insecure_mode') == 'true') { if (in_array($user->protocol, $relay_able_list) || Config::get('relay_insecure_mode') == 'true') {
@ -425,9 +423,4 @@ class Tools
return true; return true;
} }
public static function getRealIp($rawIp)
{
return str_replace("::ffff:", "", $rawIp);
}
} }

@ -248,14 +248,14 @@ class URL
$ss_obfs_list = Config::getSupportParam('ss_obfs'); $ss_obfs_list = Config::getSupportParam('ss_obfs');
if(!$is_ss) { if(!$is_ss) {
$ssurl = $item['address'].":".$item['port'].":".$item['protocol'].":".$item['method'].":".$item['obfs'].":".Tools::base64_url_encode($item['passwd'])."/?obfsparam=".Tools::base64_url_encode($item['obfs_param'])."&protoparam=".Tools::base64_url_encode($item['protocol_param'])."&remarks=".Tools::base64_url_encode($item['remark'])."&group=".Tools::base64_url_encode($item['group']); $ssurl = $item['address'].":".$item['port'].":".$item['protocol'].":".$item['method'].":".$item['obfs'].":".Tools::base64_url_encode($item['passwd'])."/?obfsparam=".Tools::base64_url_encode($item['obfs_param'])."&protoparam=".Tools::base64_url_encode($item['protocol_param'])."&remarks=".Tools::base64_url_encode($item['remark'])."&group=".Tools::base64_url_encode(Config::get('appName'));
return "ssr://".Tools::base64_url_encode($ssurl); return "ssr://".Tools::base64_url_encode($ssurl);
} else { } else {
if($is_ss == 2) { if($is_ss == 2) {
$personal_info = $item['method'].':'.$item['passwd']."@".$item['address'].":".$item['port']; $personal_info = $item['method'].':'.$item['passwd']."@".$item['address'].":".$item['port'];
$ssurl = "ss://".Tools::base64_url_encode($personal_info); $ssurl = "ss://".Tools::base64_url_encode($personal_info);
$ssurl .= "#".rawurlencode($item['remark']); $ssurl .= "#".rawurlencode(Config::get('appName')." - ".$item['remark']);
}else{ }else{
$personal_info = $item['method'].':'.$item['passwd']; $personal_info = $item['method'].':'.$item['passwd'];
$ssurl = "ss://".Tools::base64_url_encode($personal_info)."@".$item['address'].":".$item['port']; $ssurl = "ss://".Tools::base64_url_encode($personal_info)."@".$item['address'].":".$item['port'];
@ -275,7 +275,7 @@ class URL
$ssurl .= "?plugin=".rawurlencode($plugin); $ssurl .= "?plugin=".rawurlencode($plugin);
} }
$ssurl .= "#".rawurlencode($item['remark']); $ssurl .= "#".rawurlencode(Config::get('appName')." - ".$item['remark']);
} }
return $ssurl; return $ssurl;
} }
@ -328,7 +328,6 @@ class URL
* protocol_param * protocol_param
* obfs * obfs
* obfs_param * obfs_param
* group
*/ */
public static function getItem($user, $node, $mu_port = 0, $relay_rule_id = 0, $is_ss = 0) { public static function getItem($user, $node, $mu_port = 0, $relay_rule_id = 0, $is_ss = 0) {
@ -381,10 +380,6 @@ class URL
$return_array['protocol_param'] = $user->protocol_param; $return_array['protocol_param'] = $user->protocol_param;
$return_array['obfs'] = $user->obfs; $return_array['obfs'] = $user->obfs;
$return_array['obfs_param'] = $user->obfs_param; $return_array['obfs_param'] = $user->obfs_param;
$return_array['group'] = Config::get('appName');
if($mu_port != 0) {
$return_array['group'] .= ' - 单端口多用户';
}
return $return_array; return $return_array;
} }

Loading…
Cancel
Save