| Raw bytes | ");
+ $raw_text = file_get_contents('https://zxing.org/w/decode?u=' . urlencode($url));
+ return Tools::get_middle_text($raw_text, '| Raw text | ', ' | | Raw bytes | ');
}
}
diff --git a/app/Utils/Radius.php b/app/Utils/Radius.php
index 677d0bcd..9c5f4ffc 100644
--- a/app/Utils/Radius.php
+++ b/app/Utils/Radius.php
@@ -19,10 +19,9 @@ class Radius
{
if (Config::get('enable_radius') == 'true') {
$email = $user->email;
- $email = str_replace("@", "", $email);
- $email = str_replace(".", "", $email);
+ $email = str_replace(array('@', '.'), '', $email);
- $exists = RadiusRadCheck::where("username", $email)->first();
+ $exists = RadiusRadCheck::where('username', $email)->first();
if ($exists == null) {
$rb = RadiusBan::where('userid', $user->id)->first();
@@ -32,15 +31,15 @@ class Radius
$newRad = new RadiusRadCheck();
$newRad->username = $email;
- $newRad->attribute = "Cleartext-Password";
- $newRad->op = ":=";
+ $newRad->attribute = 'Cleartext-Password';
+ $newRad->op = ':=';
$newRad->value = $pwd;
$newRad->save();
$newRad = new RadiusRadUserGroup();
$newRad->username = $email;
- $newRad->groupname = "user";
- $newRad->priority = "0";
+ $newRad->groupname = 'user';
+ $newRad->priority = '0';
$newRad->save();
} else {
$exists->value = $pwd;
@@ -53,15 +52,14 @@ class Radius
public static function Delete($email)
{
if (Config::get('enable_radius') == 'true') {
- $email = str_replace("@", "", $email);
- $email = str_replace(".", "", $email);
+ $email = str_replace(array('@', '.'), '', $email);
- $exists = RadiusRadCheck::where("username", $email)->first();
+ $exists = RadiusRadCheck::where('username', $email)->first();
if ($exists != null) {
- RadiusRadCheck::where("username", $email)->delete();
- RadiusRadUserGroup::where("username", $email)->delete();
+ RadiusRadCheck::where('username', $email)->delete();
+ RadiusRadUserGroup::where('username', $email)->delete();
}
}
}
@@ -69,19 +67,17 @@ class Radius
public static function ChangeUserName($origin_email, $new_email, $passwd)
{
if (Config::get('enable_radius') == 'true') {
- $email1 = str_replace("@", "", $origin_email);
- $email1 = str_replace(".", "", $email1);
- $email2 = str_replace("@", "", $new_email);
- $email2 = str_replace(".", "", $email2);
+ $email1 = str_replace(array('@', '.'), '', $origin_email);
+ $email2 = str_replace(array('@', '.'), '', $new_email);
- $exists = RadiusRadCheck::where("username", $email1)->first();
+ $exists = RadiusRadCheck::where('username', $email1)->first();
if ($exists != null) {
$exists->username = $email2;
$exists->value = $passwd;
$exists->save();
- $exists = RadiusRadUserGroup::where("username", $email1)->first();
+ $exists = RadiusRadUserGroup::where('username', $email1)->first();
$exists->username = $email2;
$exists->save();
} else {
@@ -93,15 +89,15 @@ class Radius
$newRad = new RadiusRadCheck();
$newRad->username = $email2;
- $newRad->attribute = "Cleartext-Password";
- $newRad->op = ":=";
+ $newRad->attribute = 'Cleartext-Password';
+ $newRad->op = ':=';
$newRad->value = $passwd;
$newRad->save();
$newRad = new RadiusRadUserGroup();
$newRad->username = $email2;
- $newRad->groupname = "user";
- $newRad->priority = "0";
+ $newRad->groupname = 'user';
+ $newRad->priority = '0';
$newRad->save();
}
}
@@ -110,12 +106,12 @@ class Radius
public static function AddNas($ip, $name)
{
if (Config::get('enable_radius') == 'true') {
- $exists = RadiusNas::where("shortname", $ip)->first();
+ $exists = RadiusNas::where('shortname', $ip)->first();
if ($exists == null) {
$exists = new RadiusNas();
$exists->nasname = $ip;
$exists->shortname = $ip;
- $exists->type = "other";
+ $exists->type = 'other';
$exists->secret = Config::get('radius_secret');
$exists->description = $ip;
$exists->save();
@@ -126,14 +122,12 @@ class Radius
public static function DelNas($ip)
{
if (Config::get('enable_radius') == 'true') {
- RadiusNas::where("shortname", $ip)->delete();
+ RadiusNas::where('shortname', $ip)->delete();
}
}
public static function GetUserName($email)
{
- $emailt = str_replace("@", "", $email);
- $emailt = str_replace(".", "", $emailt);
- return $emailt;
+ return str_replace(array('@', '.'), '', $email);
}
}
diff --git a/app/Utils/Response.php b/app/Utils/Response.php
index 4099ae73..b80fcb3c 100644
--- a/app/Utils/Response.php
+++ b/app/Utils/Response.php
@@ -6,7 +6,6 @@ class Response
{
public static function redirect($response, $to)
{
- $newResponse = $response->withStatus(302)->withHeader('Location', $to);
- return $newResponse;
+ return $response->withStatus(302)->withHeader('Location', $to);
}
}
diff --git a/app/Utils/Telegram.php b/app/Utils/Telegram.php
index 2bf83315..84bd1089 100644
--- a/app/Utils/Telegram.php
+++ b/app/Utils/Telegram.php
@@ -3,6 +3,8 @@
namespace App\Utils;
use App\Services\Config;
+use Exception;
+use TelegramBot\Api\BotApi;
class Telegram
{
@@ -13,10 +15,10 @@ class Telegram
public static function Send($messageText)
{
if (Config::get('enable_telegram') == 'true') {
- $bot = new \TelegramBot\Api\BotApi(Config::get('telegram_token'));
+ $bot = new BotApi(Config::get('telegram_token'));
try {
$bot->sendMessage(Config::get('telegram_chatid'), $messageText);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
}
@@ -26,10 +28,10 @@ class Telegram
public static function SendMarkdown($messageText)
{
if (Config::get('enable_telegram') == 'true') {
- $bot = new \TelegramBot\Api\BotApi(Config::get('telegram_token'));
+ $bot = new BotApi(Config::get('telegram_token'));
try {
- $bot->sendMessage(Config::get('telegram_chatid'), $messageText, "Markdown");
- } catch (\Exception $e) {
+ $bot->sendMessage(Config::get('telegram_chatid'), $messageText, 'Markdown');
+ } catch (Exception $e) {
echo $e->getMessage();
}
}
diff --git a/app/Utils/TelegramProcess.php b/app/Utils/TelegramProcess.php
index dc165870..27dbf547 100644
--- a/app/Utils/TelegramProcess.php
+++ b/app/Utils/TelegramProcess.php
@@ -5,32 +5,35 @@ namespace App\Utils;
use App\Models\User;
use App\Services\Config;
use App\Controllers\LinkController;
+use TelegramBot\Api\Client;
+use TelegramBot\Api\Exception;
+use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
class TelegramProcess
{
private static $all_rss = [
- "clean_link" => "重置订阅",
- "?mu=0" => "SSR普通订阅",
- "?mu=1" => "SSR单端口订阅",
- "?mu=3" => "SS/SSD订阅",
- "?mu=2" => "V2ray订阅",
- "?mu=4" => "Clash订阅"];
+ 'clean_link' => '重置订阅',
+ '?mu=0' => 'SSR普通订阅',
+ '?mu=1' => 'SSR单端口订阅',
+ '?mu=3' => 'SS/SSD订阅',
+ '?mu=2' => 'V2ray订阅',
+ '?mu=4' => 'Clash订阅'];
private static function callback_bind_method($bot, $message, $command)
{
$reply_to = $message->getMessageId();
$user = User::where('telegram_id', $message->getFrom()->getId())->first();
- $reply_message = "???";
+ $reply_message = '???';
if ($user != null) {
switch (true) {
- case (strpos($command, "mu")):
+ case (strpos($command, 'mu')):
$ssr_sub_token = LinkController::GenerateSSRSubCode($user->id, 0);
$subUrl = Config::get('subUrl');
- $reply_message = self::$all_rss[$command] . ": " . $subUrl . $ssr_sub_token . $command . PHP_EOL;
+ $reply_message = self::$all_rss[$command] . ': ' . $subUrl . $ssr_sub_token . $command . PHP_EOL;
break;
- case ($command == "clean_link"):
+ case ($command == 'clean_link'):
$user->clean_link();
- $reply_message = "链接重置成功";
+ $reply_message = '链接重置成功';
break;
}
$bot->sendMessage($message->getChat()->getId(), $reply_message, $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
@@ -40,46 +43,45 @@ class TelegramProcess
private static function needbind_method($bot, $message, $command, $user, $reply_to = null)
{
$reply = [
- "message" => "???",
- "markup" => null,
+ 'message' => '???',
+ 'markup' => null,
];
if ($user != null) {
switch ($command) {
case 'traffic':
- $reply['message'] = "您当前的流量状况:
-今日已使用 " . $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->unusedTraffic() . " " . number_format(($user->transfer_enable - ($user->u + $user->d)) / $user->transfer_enable * 100, 2) . "%";
+ $reply['message'] = '您当前的流量状况:
+今日已使用 ' . $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->unusedTraffic() . ' ' . number_format(($user->transfer_enable - ($user->u + $user->d)) / $user->transfer_enable * 100, 2) . '%';
break;
case 'checkin':
if (!$user->isAbleToCheckin()) {
- $reply['message'] = "您今天已经签过到了!";
+ $reply['message'] = '您今天已经签过到了!';
break;
}
- $traffic = rand(Config::get('checkinMin'), Config::get('checkinMax'));
- $user->transfer_enable = $user->transfer_enable + Tools::toMB($traffic);
+ $traffic = random_int(Config::get('checkinMin'), Config::get('checkinMax'));
+ $user->transfer_enable += Tools::toMB($traffic);
$user->last_check_in_time = time();
$user->save();
- $reply['message'] = "签到成功!获得了 " . $traffic . " MB 流量!";
+ $reply['message'] = '签到成功!获得了 ' . $traffic . ' MB 流量!';
break;
case 'prpr':
$prpr = array('⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄', '(≧ ﹏ ≦)', '(*/ω\*)', 'ヽ(*。>Д<)o゜', '(つ ﹏ ⊂)', '( > < )');
- $reply['message'] = $prpr[mt_rand(0, 5)];
+ $reply['message'] = $prpr[random_int(0, 5)];
break;
- case "rss":
- $reply['message'] = "点击以下按钮获取对应订阅: ";
+ case 'rss':
+ $reply['message'] = '点击以下按钮获取对应订阅: ';
$keys = [];
foreach (self::$all_rss as $key => $value) {
- $keys[] = [["text" => $value, "callback_data" => $key]];
+ $keys[] = [['text' => $value, 'callback_data' => $key]];
}
- $reply['mark'] = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup(
+ $reply['mark'] = new InlineKeyboardMarkup(
$keys
);
break;
-
}
} else {
- $reply['message'] = "您未绑定本站账号,您可以进入网站的“资料编辑”,在右下方绑定您的账号";
+ $reply['message'] = '您未绑定本站账号,您可以进入网站的“资料编辑”,在右下方绑定您的账号';
}
return $reply;
@@ -91,8 +93,8 @@ class TelegramProcess
$user = User::where('telegram_id', $message->getFrom()->getId())->first();
$reply_to = $message->getMessageId();
$reply = [
- "message" => "???",
- "markup" => null,
+ 'message' => '???',
+ 'markup' => null,
];
if ($message->getChat()->getId() > 0) {
//个人
@@ -105,18 +107,18 @@ class TelegramProcess
case 'traffic':
case 'checkin':
case 'prpr':
- case "rss":
- $reply = TelegramProcess::needbind_method($bot, $message, $command, $user, $reply_to);
+ case 'rss':
+ $reply = self::needbind_method($bot, $message, $command, $user, $reply_to);
break;
case 'help':
- $reply['message'] = "命令列表:
+ $reply['message'] = '命令列表:
/ping 获取群组ID
/traffic 查询流量
/checkin 签到
/help 获取帮助信息
- /rss 获取节点订阅";
+ /rss 获取节点订阅';
if ($user == null) {
- $help_list .= PHP_EOL . "您未绑定本站账号,您可以进入网站的“资料编辑”,在右下方绑定您的账号";
+ $help_list .= PHP_EOL . '您未绑定本站账号,您可以进入网站的“资料编辑”,在右下方绑定您的账号';
}
break;
default:
@@ -124,21 +126,23 @@ class TelegramProcess
if (!is_numeric($message->getText()) || strlen($message->getText()) != 6) {
$reply['message'] = Tuling::chat($message->getFrom()->getId(), $message->getText());
break;
- }else if($user != null) {
+ }
+
+ if ($user != null) {
$uid = TelegramSessionManager::verify_login_number($message->getText(), $user->id);
if ($uid != 0) {
- $reply['message'] = "登录验证成功,邮箱:" . $user->email;
+ $reply['message'] = '登录验证成功,邮箱:' . $user->email;
} else {
- $reply['message'] = "登录验证失败,数字无效";
+ $reply['message'] = '登录验证失败,数字无效';
}
break;
- } else {
- $reply['message'] = "登录验证失败,您未绑定本站账号";
- break;
}
+
+ $reply['message'] = '登录验证失败,您未绑定本站账号';
+ break;
}
- $bot->sendMessage($message->getChat()->getId(), "正在解码,请稍候。。。");
+ $bot->sendMessage($message->getChat()->getId(), '正在解码,请稍候。。。');
$bot->sendChatAction($message->getChat()->getId(), 'typing');
$photos = $message->getPhoto();
@@ -163,27 +167,27 @@ class TelegramProcess
$photo_id_list_array[$real_id] = array();
}
- array_push($photo_id_list_array[$real_id], $file->getFileId());
+ $photo_id_list_array[$real_id][] = $file->getFileId();
}
foreach ($photo_id_array as $key => $value) {
$file = $bot->getFile($value);
- $qrcode_text = QRcode::decode("https://api.telegram.org/file/bot" . Config::get('telegram_token') . "/" . $file->getFilePath());
+ $qrcode_text = QRcode::decode('https://api.telegram.org/file/bot' . Config::get('telegram_token') . '/' . $file->getFilePath());
if ($qrcode_text == null) {
foreach ($photo_id_list_array[$key] as $fail_key => $fail_value) {
$fail_file = $bot->getFile($fail_value);
- $qrcode_text = QRcode::decode("https://api.telegram.org/file/bot" . Config::get('telegram_token') . "/" . $fail_file->getFilePath());
+ $qrcode_text = QRcode::decode('https://api.telegram.org/file/bot' . Config::get('telegram_token') . '/' . $fail_file->getFilePath());
if ($qrcode_text != null) {
break;
}
}
}
- if (substr($qrcode_text, 0, 11) == 'mod://bind/' && strlen($qrcode_text) == 27) {
+ if (strpos($qrcode_text, 'mod://bind/') === 0 && strlen($qrcode_text) == 27) {
$uid = TelegramSessionManager::verify_bind_session(substr($qrcode_text, 11));
if ($uid == 0) {
- $reply['message'] = "绑定失败,二维码无效:" . substr($qrcode_text, 11) . "二维码的有效期为10分钟,请尝试刷新网站的“资料编辑”页面以更新二维码";
+ $reply['message'] = '绑定失败,二维码无效:' . substr($qrcode_text, 11) . '二维码的有效期为10分钟,请尝试刷新网站的“资料编辑”页面以更新二维码';
continue;
}
$user = User::where('id', $uid)->first();
@@ -191,21 +195,21 @@ class TelegramProcess
$user->im_type = 4;
$user->im_value = $message->getFrom()->getUsername();
$user->save();
- $reply['message'] = "绑定成功,邮箱:" . $user->email;
+ $reply['message'] = '绑定成功,邮箱:' . $user->email;
break;
}
- if (substr($qrcode_text, 0, 12) == 'mod://login/' && strlen($qrcode_text) == 28) {
+ if (strpos($qrcode_text, 'mod://login/') === 0 && strlen($qrcode_text) == 28) {
if ($user == null) {
- $reply['message'] = "登录验证失败,您未绑定本站账号" . substr($qrcode_text, 12);
+ $reply['message'] = '登录验证失败,您未绑定本站账号' . substr($qrcode_text, 12);
break;
}
$uid = TelegramSessionManager::verify_login_session(substr($qrcode_text, 12), $user->id);
if ($uid != 0) {
- $reply['message'] = "登录验证成功,邮箱:" . $user->email;
+ $reply['message'] = '登录验证成功,邮箱:' . $user->email;
} else {
- $reply['message'] = "登录验证失败,二维码无效" . substr($qrcode_text, 12);
+ $reply['message'] = '登录验证失败,二维码无效' . substr($qrcode_text, 12);
}
break;
}
@@ -227,17 +231,17 @@ class TelegramProcess
case 'traffic':
case 'checkin':
case 'prpr':
- $reply = TelegramProcess::needbind_method($bot, $message, $command, $user, $reply_to);
+ $reply = self::needbind_method($bot, $message, $command, $user, $reply_to);
break;
case 'help':
- $reply['message'] = "命令列表:
+ $reply['message'] = '命令列表:
/ping 获取群组ID
/traffic 查询流量
/checkin 签到
/help 获取帮助信息
- /rss 获取节点订阅 ";
+ /rss 获取节点订阅 ';
if ($user == null) {
- $reply['message'] .= PHP_EOL . "您未绑定本站账号,您可以进入网站的“资料编辑”,在右下方绑定您的账号";
+ $reply['message'] .= PHP_EOL . '您未绑定本站账号,您可以进入网站的“资料编辑”,在右下方绑定您的账号';
}
break;
default:
@@ -249,7 +253,7 @@ class TelegramProcess
}
}
if ($message->getNewChatMember() != null && Config::get('enable_welcome_message') == 'true') {
- $reply['message'] = "欢迎 " . $message->getNewChatMember()->getFirstName() . " " . $message->getNewChatMember()->getLastName();
+ $reply['message'] = '欢迎 ' . $message->getNewChatMember()->getFirstName() . ' ' . $message->getNewChatMember()->getLastName();
} else {
$reply['message'] = null;
}
@@ -263,38 +267,35 @@ class TelegramProcess
public static function process()
{
try {
- $bot = new \TelegramBot\Api\Client(Config::get('telegram_token'));
+ $bot = new Client(Config::get('telegram_token'));
// or initialize with botan.io tracker api key
// $bot = new \TelegramBot\Api\Client('YOUR_BOT_API_TOKEN', 'YOUR_BOTAN_TRACKER_API_KEY');
- $command_list = array("ping", "traffic", "help", "prpr", "checkin", "rss");
+ $command_list = array('ping', 'traffic', 'help', 'prpr', 'checkin', 'rss');
foreach ($command_list as $command) {
- $bot->command($command, function ($message) use ($bot, $command) {
+ $bot->command($command, static function ($message) use ($bot, $command) {
TelegramProcess::telegram_process($bot, $message, $command);
});
}
- $bot->on($bot->getEvent(function ($message) use ($bot) {
+ $bot->on($bot->getEvent(static function ($message) use ($bot) {
TelegramProcess::telegram_process($bot, $message, '');
- }), function () {
+ }), static function () {
return true;
});
- $bot->on(function ($update) use ($bot) {
+ $bot->on(static function ($update) use ($bot) {
$callback = $update->getCallbackQuery();
//Answer to Telegram, you make answer in the end, or in the beginning.
$message = $callback->getMessage();
$message->setFrom($callback->getFrom());
TelegramProcess::callback_bind_method($bot, $message, $callback->getData());
- }, function ($update) {
+ }, static function ($update) {
$callback = $update->getCallbackQuery();
- if (is_null($callback) || !strlen($callback->getData())) {
- return false;
- }
- return true;
+ return !($callback === null || $callback->getData() == '');
});
$bot->run();
- } catch (\TelegramBot\Api\Exception $e) {
+ } catch (Exception $e) {
$e->getMessage();
}
}
diff --git a/app/Utils/TelegramSessionManager.php b/app/Utils/TelegramSessionManager.php
index 48714362..0fc91df5 100644
--- a/app/Utils/TelegramSessionManager.php
+++ b/app/Utils/TelegramSessionManager.php
@@ -3,8 +3,6 @@
namespace App\Utils;
use App\Models\TelegramSession;
-use App\Utils\Tools;
-use App\Services\Config;
class TelegramSessionManager
{
@@ -13,7 +11,7 @@ class TelegramSessionManager
$i = 0;
for ($i = 0; $i < 10; $i++) {
$token = Tools::genRandomChar(16);
- $Elink = TelegramSession::where("session_content", "=", $token)->first();
+ $Elink = TelegramSession::where('session_content', '=', $token)->first();
if ($Elink == null) {
return $token;
}
@@ -27,10 +25,10 @@ class TelegramSessionManager
$i = 0;
for ($i = 0; $i < 10; $i++) {
$token = Tools::genRandomChar(16);
- $number = rand(100000, 999999);
- $Elink = TelegramSession::where("session_content", "LIKE", $token . "|%")->orWhere("session_content", "LIKE", "%|" . $number)->first();
+ $number = random_int(100000, 999999);
+ $Elink = TelegramSession::where('session_content', 'LIKE', $token . '|%')->orWhere('session_content', 'LIKE', '%|' . $number)->first();
if ($Elink == null) {
- return $token . "|" . $number;
+ return $token . '|' . $number;
}
}
@@ -39,10 +37,10 @@ class TelegramSessionManager
public static function add_bind_session($user)
{
- $Elink = TelegramSession::where("type", "=", 0)->where("user_id", "=", $user->id)->first();
+ $Elink = TelegramSession::where('type', '=', 0)->where('user_id', '=', $user->id)->first();
if ($Elink != null) {
$Elink->datetime = time();
- $Elink->session_content = TelegramSessionManager::GenerateRandomLink();
+ $Elink->session_content = self::GenerateRandomLink();
$Elink->save();
return $Elink->session_content;
}
@@ -51,7 +49,7 @@ class TelegramSessionManager
$NLink->type = 0;
$NLink->user_id = $user->id;
$NLink->datetime = time();
- $NLink->session_content = TelegramSessionManager::GenerateRandomLink();
+ $NLink->session_content = self::GenerateRandomLink();
$NLink->save();
return $NLink->session_content;
@@ -59,7 +57,7 @@ class TelegramSessionManager
public static function verify_bind_session($token)
{
- $Elink = TelegramSession::where("type", "=", 0)->where('session_content', $token)->where('datetime', '>', time() - 600)->orderBy('datetime', 'desc')->first();
+ $Elink = TelegramSession::where('type', '=', 0)->where('session_content', $token)->where('datetime', '>', time() - 600)->orderBy('datetime', 'desc')->first();
if ($Elink != null) {
$uid = $Elink->user_id;
$Elink->delete();
@@ -74,7 +72,7 @@ class TelegramSessionManager
$NLink->type = 1;
$NLink->user_id = 0;
$NLink->datetime = time();
- $NLink->session_content = TelegramSessionManager::GenerateLoginRandomLink();
+ $NLink->session_content = self::GenerateLoginRandomLink();
$NLink->save();
return $NLink->session_content;
@@ -82,7 +80,7 @@ class TelegramSessionManager
public static function verify_login_session($token, $uid)
{
- $Elink = TelegramSession::where("type", "=", 1)->where('user_id', 0)->where('session_content', "LIKE", $token . "|%")->where('datetime', '>', time() - 90)->orderBy('datetime', 'desc')->first();
+ $Elink = TelegramSession::where('type', '=', 1)->where('user_id', 0)->where('session_content', 'LIKE', $token . '|%')->where('datetime', '>', time() - 90)->orderBy('datetime', 'desc')->first();
if ($Elink != null) {
$Elink->user_id = $uid;
$Elink->save();
@@ -93,7 +91,7 @@ class TelegramSessionManager
public static function verify_login_number($token, $uid)
{
- $Elink = TelegramSession::where("type", "=", 1)->where('user_id', 0)->where('session_content', "LIKE", "%|" . $token)->where('datetime', '>', time() - 90)->orderBy('datetime', 'desc')->first();
+ $Elink = TelegramSession::where('type', '=', 1)->where('user_id', 0)->where('session_content', 'LIKE', '%|' . $token)->where('datetime', '>', time() - 90)->orderBy('datetime', 'desc')->first();
if ($Elink != null) {
$Elink->user_id = $uid;
$Elink->save();
@@ -104,7 +102,7 @@ class TelegramSessionManager
public static function step2_verify_login_session($token, $number)
{
- $Elink = TelegramSession::where("type", "=", 1)->where('session_content', $token . "|" . $number)->where('datetime', '>', time() - 90)->orderBy('datetime', 'desc')->first();
+ $Elink = TelegramSession::where('type', '=', 1)->where('session_content', $token . '|' . $number)->where('datetime', '>', time() - 90)->orderBy('datetime', 'desc')->first();
if ($Elink != null) {
$uid = $Elink->user_id;
$Elink->delete();
@@ -115,7 +113,7 @@ class TelegramSessionManager
public static function check_login_session($token, $number)
{
- $Elink = TelegramSession::where("type", "=", 1)->where('session_content', $token . "|" . $number)->orderBy('datetime', 'desc')->first();
+ $Elink = TelegramSession::where('type', '=', 1)->where('session_content', $token . '|' . $number)->orderBy('datetime', 'desc')->first();
if ($Elink != null) {
if ($Elink->datetime < time() - 90) {
return -1;
diff --git a/app/Utils/Tools.php b/app/Utils/Tools.php
index 900a9890..c1ef0fca 100644
--- a/app/Utils/Tools.php
+++ b/app/Utils/Tools.php
@@ -22,18 +22,26 @@ class Tools
$tb = $gb * 1024;
$pb = $tb * 1024;
if (abs($value) > $pb) {
- return round($value / $pb, 2) . "PB";
- } elseif (abs($value) > $tb) {
- return round($value / $tb, 2) . "TB";
- } elseif (abs($value) > $gb) {
- return round($value / $gb, 2) . "GB";
- } elseif (abs($value) > $mb) {
- return round($value / $mb, 2) . "MB";
- } elseif (abs($value) > $kb) {
- return round($value / $kb, 2) . "KB";
- } else {
- return round($value, 2) . "B";
+ return round($value / $pb, 2) . 'PB';
+ }
+
+ if (abs($value) > $tb) {
+ return round($value / $tb, 2) . 'TB';
+ }
+
+ if (abs($value) > $gb) {
+ return round($value / $gb, 2) . 'GB';
+ }
+
+ if (abs($value) > $mb) {
+ return round($value / $mb, 2) . 'MB';
}
+
+ if (abs($value) > $kb) {
+ return round($value / $kb, 2) . 'KB';
+ }
+
+ return round($value, 2) . 'B';
}
//虽然名字是toMB,但是实际上功能是from MB to B
@@ -79,7 +87,7 @@ class Tools
$chars = '0123456789';
$char = '';
for ($i = 0; $i < $length; $i++) {
- $char .= $chars[mt_rand(0, strlen($chars) - 1)];
+ $char .= $chars[random_int(0, strlen($chars) - 1)];
}
return $char;
}
@@ -90,7 +98,7 @@ class Tools
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$char = '';
for ($i = 0; $i < $length; $i++) {
- $char .= $chars[mt_rand(0, strlen($chars) - 1)];
+ $char .= $chars[random_int(0, strlen($chars) - 1)];
}
return $char;
}
@@ -114,14 +122,14 @@ class Tools
public static function secondsToTime($seconds)
{
- $dtF = new DateTime("@0");
+ $dtF = new DateTime('@0');
$dtT = new DateTime("@$seconds");
return $dtF->diff($dtT)->format('%a 天, %h 小时, %i 分 + %s 秒');
}
public static function genSID()
{
- $unid = uniqid(Config::get('key'));
+ $unid = uniqid(Config::get('key'), true);
return Hash::sha256WithSalt($unid);
}
@@ -165,7 +173,7 @@ class Tools
if (false != ($handle = opendir($dir))) {
$i = 0;
while (false !== ($file = readdir($handle))) {
- if ($file != "." && $file != ".." && !strpos($file, ".")) {
+ if ($file != '.' && $file != '..' && !strpos($file, '.')) {
$dirArray[$i] = $file;
$i++;
}
@@ -192,11 +200,7 @@ class Tools
}
}
- if ($cur_id != $rule->id) {
- return false;
- }
-
- return true;
+ return !($cur_id != $rule->id);
}
public static function pick_out_relay_rule($relay_node_id, $port, $ruleset)
@@ -239,10 +243,8 @@ class Tools
}
}
- if ($match_rule != null) {
- if ($match_rule->dist_node_id == -1) {
- return null;
- }
+ if (($match_rule != null) && $match_rule->dist_node_id == -1) {
+ return null;
}
return $match_rule;
@@ -278,11 +280,7 @@ class Tools
$relay_able_list = Config::getSupportParam('relay_able_protocol');
- if (in_array($user->protocol, $relay_able_list) || Config::get('relay_insecure_mode') == 'true') {
- return true;
- }
-
- return false;
+ return in_array($user->protocol, $relay_able_list) || Config::get('relay_insecure_mode') == 'true';
}
public static function has_conflict_rule($input_rule, $ruleset, $edit_rule_id = 0, $origin_node_id = 0, $user_id = 0)
@@ -294,7 +292,7 @@ class Tools
}
//递归处理这个节点
- $maybe_rule_id = Tools::has_conflict_rule($rule, $ruleset, $edit_rule_id, $origin_node_id, $rule->user_id);
+ $maybe_rule_id = self::has_conflict_rule($rule, $ruleset, $edit_rule_id, $origin_node_id, $rule->user_id);
if ($maybe_rule_id != 0) {
return $maybe_rule_id;
}
@@ -333,11 +331,11 @@ class Tools
if ($single_rule->dist_node_id == $path->begin_node->id) {
$path->begin_node = $single_rule->Source_Node();
if ($path->begin_node->isNodeAccessable() == false) {
- $path->path = '' . $single_rule->Source_Node()->name . '' . " → " . $path->path;
- $path->status = "阻断";
+ $path->path = '' . $single_rule->Source_Node()->name . '' . ' → ' . $path->path;
+ $path->status = '阻断';
} else {
- $path->path = $single_rule->Source_Node()->name . " → " . $path->path;
- $path->status = "通畅";
+ $path->path = $single_rule->Source_Node()->name . ' → ' . $path->path;
+ $path->status = '通畅';
}
return $pathset;
}
@@ -345,10 +343,10 @@ class Tools
if ($path->end_node->id == $single_rule->source_node_id) {
$path->end_node = $single_rule->Dist_Node();
if ($path->end_node->isNodeAccessable() == false) {
- $path->path = $path->path . " → " . '' . $single_rule->Dist_Node()->name . '';
- $path->status = "阻断";
+ $path->path = $path->path . ' → ' . '' . $single_rule->Dist_Node()->name . '';
+ $path->status = '阻断';
} else {
- $path->path = $path->path . " → " . $single_rule->Dist_Node()->name;
+ $path->path = $path->path . ' → ' . $single_rule->Dist_Node()->name;
}
return $pathset;
}
@@ -359,18 +357,18 @@ class Tools
$new_path->begin_node = $single_rule->Source_Node();
if ($new_path->begin_node->isNodeAccessable() == false) {
$new_path->path = '' . $single_rule->Source_Node()->name . '';
- $new_path->status = "阻断";
+ $new_path->status = '阻断';
} else {
$new_path->path = $single_rule->Source_Node()->name;
- $new_path->status = "通畅";
+ $new_path->status = '通畅';
}
$new_path->end_node = $single_rule->Dist_Node();
if ($new_path->end_node->isNodeAccessable() == false) {
- $new_path->path .= " -> " . '' . $single_rule->Dist_Node()->name . '';
- $new_path->status = "阻断";
+ $new_path->path .= ' -> ' . '' . $single_rule->Dist_Node()->name . '';
+ $new_path->status = '阻断';
} else {
- $new_path->path .= " -> " . $single_rule->Dist_Node()->name;
+ $new_path->path .= ' -> ' . $single_rule->Dist_Node()->name;
}
$new_path->port = $port;
@@ -393,17 +391,15 @@ class Tools
{
$dist_ip_str = $dist_node->node_ip;
$dist_ip_array = explode(',', $dist_ip_str);
- $return_ip = NULL;
+ $return_ip = null;
foreach ($dist_ip_array as $single_dist_ip_str) {
$child1_array = explode('#', $single_dist_ip_str);
if ($child1_array[0] == $single_dist_ip_str) {
$return_ip = $child1_array[0];
- } else {
- if (isset($child1_array[1])) {
- $node_id_array = explode('|', $child1_array[1]);
- if (in_array($source_node->id, $node_id_array)) {
- $return_ip = $child1_array[0];
- }
+ } elseif (isset($child1_array[1])) {
+ $node_id_array = explode('|', $child1_array[1]);
+ if (in_array($source_node->id, $node_id_array)) {
+ $return_ip = $child1_array[0];
}
}
}
@@ -418,23 +414,19 @@ class Tools
foreach ($rules as $rule) {
$source_node = Node::where('id', $rule->source_node_id)->first();
- $rule->dist_ip = Tools::getRelayNodeIp($source_node, $dist_node);
+ $rule->dist_ip = self::getRelayNodeIp($source_node, $dist_node);
$rule->save();
}
}
public static function checkNoneProtocol($user)
{
- if ($user->method == 'none' && !in_array($user->protocol, Config::getSupportParam('allow_none_protocol'))) {
- return false;
- }
-
- return true;
+ return !($user->method == 'none' && !in_array($user->protocol, Config::getSupportParam('allow_none_protocol')));
}
public static function getRealIp($rawIp)
{
- return str_replace("::ffff:", "", $rawIp);
+ return str_replace('::ffff:', '', $rawIp);
}
public static function isInt($str)
@@ -494,12 +486,8 @@ class Tools
public static function checkTls($node)
{
- $server = Tools::v2Array($node);
- if ($server['tls'] == 'tls' && Tools::is_ip($server['add'])) {
- return false;
- } else {
- return true;
- }
+ $server = self::v2Array($node);
+ return !($server['tls'] == 'tls' && self::is_ip($server['add']));
}
public static function ssv2Array($node)
diff --git a/app/Utils/Tuling.php b/app/Utils/Tuling.php
index 322d450d..efd6961a 100644
--- a/app/Utils/Tuling.php
+++ b/app/Utils/Tuling.php
@@ -2,7 +2,6 @@
namespace App\Utils;
-use App\Models\User;
use App\Services\Config;
class Tuling
@@ -18,8 +17,8 @@ class Tuling
$param = json_encode($data);
- $sock = new HTTPSocket;
- $sock->connect("www.tuling123.com", 80);
+ $sock = new HTTPSocket();
+ $sock->connect('www.tuling123.com', 80);
$sock->set_method('POST');
$sock->add_header('Content-Type', 'application/json');
$sock->query('/openapi/api', $param);
diff --git a/app/Utils/URL.php b/app/Utils/URL.php
index 86f26d4e..bb71b521 100644
--- a/app/Utils/URL.php
+++ b/app/Utils/URL.php
@@ -32,11 +32,11 @@ class URL
public static function CanProtocolConnect($protocol)
{
if ($protocol != 'origin') {
- if (strpos($protocol, '_compatible') === FALSE) {
+ if (strpos($protocol, '_compatible') === false) {
return 1;
- } else {
- return 3;
}
+
+ return 3;
}
return 3;
}
@@ -54,22 +54,21 @@ class URL
//SS obfs only
$ss_obfs = Config::getSupportParam('ss_obfs');
if (in_array($obfs, $ss_obfs)) {
- if (strpos($obfs, '_compatible') === FALSE) {
+ if (strpos($obfs, '_compatible') === false) {
return 2;
- } else {
- return 4;//SSR need origin plain
- }
- } else {
- //SSR obfs only
- if (strpos($obfs, '_compatible') === FALSE) {
- return 1;
- } else {
- return 5;//SS need plain
}
+
+ return 4;//SSR need origin plain
}
- } else {
- return 3;
+
+ if (strpos($obfs, '_compatible') === false) {
+ return 1;
+ }
+
+ return 5;//SS need plain
}
+
+ return 3;
}
public static function parse_args($origin)
@@ -90,60 +89,52 @@ class URL
public static function SSCanConnect($user, $mu_port = 0)
{
if ($mu_port != 0) {
- $mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
+ $mu_user = User::where('port', '=', $mu_port)->where('is_multi_user', '<>', 0)->first();
if ($mu_user == null) {
return;
}
- return URL::SSCanConnect($mu_user);
- }
- if (URL::CanMethodConnect($user->method) >= 2 && URL::CanProtocolConnect($user->protocol) >= 2 && URL::CanObfsConnect($user->obfs) >= 2) {
- return true;
- } else {
- return false;
+ return self::SSCanConnect($mu_user);
}
+ return self::CanMethodConnect($user->method) >= 2 && self::CanProtocolConnect($user->protocol) >= 2 && self::CanObfsConnect($user->obfs) >= 2;
}
public static function SSRCanConnect($user, $mu_port = 0)
{
if ($mu_port != 0) {
- $mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
+ $mu_user = User::where('port', '=', $mu_port)->where('is_multi_user', '<>', 0)->first();
if ($mu_user == null) {
return;
}
- return URL::SSRCanConnect($mu_user);
- }
- if (URL::CanMethodConnect($user->method) != 2 && URL::CanProtocolConnect($user->protocol) != 2 && URL::CanObfsConnect($user->obfs) != 2) {
- return true;
- } else {
- return false;
+ return self::SSRCanConnect($mu_user);
}
+ return self::CanMethodConnect($user->method) != 2 && self::CanProtocolConnect($user->protocol) != 2 && self::CanObfsConnect($user->obfs) != 2;
}
public static function getSSConnectInfo($user)
{
$new_user = clone $user;
- if (URL::CanObfsConnect($new_user->obfs) == 5) {
+ if (self::CanObfsConnect($new_user->obfs) == 5) {
$new_user->obfs = 'plain';
$new_user->obfs_param = '';
}
- if (URL::CanProtocolConnect($new_user->protocol) == 3) {
+ if (self::CanProtocolConnect($new_user->protocol) == 3) {
$new_user->protocol = 'origin';
$new_user->protocol_param = '';
}
- $new_user->obfs = str_replace("_compatible", "", $new_user->obfs);
- $new_user->protocol = str_replace("_compatible", "", $new_user->protocol);
+ $new_user->obfs = str_replace('_compatible', '', $new_user->obfs);
+ $new_user->protocol = str_replace('_compatible', '', $new_user->protocol);
return $new_user;
}
public static function getSSRConnectInfo($user)
{
$new_user = clone $user;
- if (URL::CanObfsConnect($new_user->obfs) == 4) {
+ if (self::CanObfsConnect($new_user->obfs) == 4) {
$new_user->obfs = 'plain';
$new_user->obfs_param = '';
}
- $new_user->obfs = str_replace("_compatible", "", $new_user->obfs);
- $new_user->protocol = str_replace("_compatible", "", $new_user->protocol);
+ $new_user->obfs = str_replace('_compatible', '', $new_user->obfs);
+ $new_user->protocol = str_replace('_compatible', '', $new_user->protocol);
return $new_user;
}
@@ -152,49 +143,47 @@ class URL
$return_array = array();
if ($user->is_admin) {
$nodes = Node::where(
- function ($query) {
+ static function ($query) {
$query->where('sort', 0)
->orwhere('sort', 10)
->orwhere('sort', 13);
}
- )->where("type", "1")->orderBy("name")->get();
+ )->where('type', '1')->orderBy('name')->get();
} else {
$nodes = Node::where(
- function ($query) {
+ static function ($query) {
$query->where('sort', 0)
->orwhere('sort', 10)
->orwhere('sort', 13);
}
)->where(
- function ($query) use ($user) {
- $query->where("node_group", "=", $user->node_group)
- ->orWhere("node_group", "=", 0);
+ static function ($query) use ($user) {
+ $query->where('node_group', '=', $user->node_group)
+ ->orWhere('node_group', '=', 0);
}
- )->where("type", "1")->where("node_class", "<=", $user->class)->orderBy("name")->get();
+ )->where('type', '1')->where('node_class', '<=', $user->class)->orderBy('name')->get();
}
if ($is_mu) {
if ($user->is_admin) {
if ($is_mu != 1) {
- $mu_nodes = Node::where('sort', 9)->where('server', '=', $is_mu)->where("type", "1")->get();
+ $mu_nodes = Node::where('sort', 9)->where('server', '=', $is_mu)->where('type', '1')->get();
} else {
- $mu_nodes = Node::where('sort', 9)->where("type", "1")->get();
+ $mu_nodes = Node::where('sort', 9)->where('type', '1')->get();
}
+ } elseif ($is_mu != 1) {
+ $mu_nodes = Node::where('sort', 9)->where('server', '=', $is_mu)->where('node_class', '<=', $user->class)->where('type', '1')->where(
+ static function ($query) use ($user) {
+ $query->where('node_group', '=', $user->node_group)
+ ->orWhere('node_group', '=', 0);
+ }
+ )->get();
} else {
- if ($is_mu != 1) {
- $mu_nodes = Node::where('sort', 9)->where('server', '=', $is_mu)->where('node_class', '<=', $user->class)->where("type", "1")->where(
- function ($query) use ($user) {
- $query->where("node_group", "=", $user->node_group)
- ->orWhere("node_group", "=", 0);
- }
- )->get();
- } else {
- $mu_nodes = Node::where('sort', 9)->where('node_class', '<=', $user->class)->where("type", "1")->where(
- function ($query) use ($user) {
- $query->where("node_group", "=", $user->node_group)
- ->orWhere("node_group", "=", 0);
- }
- )->get();
- }
+ $mu_nodes = Node::where('sort', 9)->where('node_class', '<=', $user->class)->where('type', '1')->where(
+ static function ($query) use ($user) {
+ $query->where('node_group', '=', $user->node_group)
+ ->orWhere('node_group', '=', 0);
+ }
+ )->get();
}
}
$relay_rules = Relay::where('user_id', $user->id)->orwhere('user_id', 0)->orderBy('id', 'asc')->get();
@@ -206,19 +195,17 @@ class URL
if ($node->sort == 10) {
$relay_rule_id = 0;
$relay_rule = Tools::pick_out_relay_rule($node->id, $user->port, $relay_rules);
- if ($relay_rule != null) {
- if ($relay_rule->dist_node() != null) {
- $relay_rule_id = $relay_rule->id;
- }
+ if (($relay_rule != null) && $relay_rule->dist_node() != null) {
+ $relay_rule_id = $relay_rule->id;
}
- $item = URL::getItem($user, $node, 0, $relay_rule_id, $is_ss);
+ $item = self::getItem($user, $node, 0, $relay_rule_id, $is_ss);
if ($item != null) {
- array_push($return_array, $item);
+ $return_array[] = $item;
}
} else {
- $item = URL::getItem($user, $node, 0, 0, $is_ss);
+ $item = self::getItem($user, $node, 0, 0, $is_ss);
if ($item != null) {
- array_push($return_array, $item);
+ $return_array[] = $item;
}
}
}
@@ -227,19 +214,17 @@ class URL
if ($node->sort == 10) {
$relay_rule_id = 0;
$relay_rule = Tools::pick_out_relay_rule($node->id, $mu_node->server, $relay_rules);
- if ($relay_rule != null) {
- if ($relay_rule->dist_node() != null) {
- $relay_rule_id = $relay_rule->id;
- }
+ if (($relay_rule != null) && $relay_rule->dist_node() != null) {
+ $relay_rule_id = $relay_rule->id;
}
- $item = URL::getItem($user, $node, $mu_node->server, $relay_rule_id, $is_ss);
+ $item = self::getItem($user, $node, $mu_node->server, $relay_rule_id, $is_ss);
if ($item != null) {
- array_push($return_array, $item);
+ $return_array[] = $item;
}
} else {
- $item = URL::getItem($user, $node, $mu_node->server, 0, $is_ss);
+ $item = self::getItem($user, $node, $mu_node->server, 0, $is_ss);
if ($item != null) {
- array_push($return_array, $item);
+ $return_array[] = $item;
}
}
}
@@ -252,21 +237,21 @@ class URL
{
$return_url = '';
if (!$is_ss) {
- $return_url .= URL::getUserTraffic($user, $is_mu) . PHP_EOL;
- $return_url .= URL::getUserClassExpiration($user, $is_mu) . PHP_EOL;
+ $return_url .= self::getUserTraffic($user, $is_mu) . PHP_EOL;
+ $return_url .= self::getUserClassExpiration($user, $is_mu) . PHP_EOL;
}
if (strtotime($user->expire_in) < time()) {
return $return_url;
}
- $items = URL::getAllItems($user, $is_mu, $is_ss);
+ $items = self::getAllItems($user, $is_mu, $is_ss);
foreach ($items as $item) {
- $return_url .= URL::getItemUrl($item, $is_ss) . PHP_EOL;
+ $return_url .= self::getItemUrl($item, $is_ss) . PHP_EOL;
}
if (Config::get('mergeSub') == 'true' and in_array($is_mu, array(0, 1))) {
$is_mu = $is_mu == 0 ? 1 : 0;
- $items = URL::getAllItems($user, $is_mu, $is_ss);
+ $items = self::getAllItems($user, $is_mu, $is_ss);
foreach ($items as $item) {
- $return_url .= URL::getItemUrl($item, $is_ss) . PHP_EOL;
+ $return_url .= self::getItemUrl($item, $is_ss) . PHP_EOL;
}
}
return $return_url;
@@ -276,73 +261,73 @@ class URL
{
$ss_obfs_list = Config::getSupportParam('ss_obfs');
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']);
- return "ssr://" . Tools::base64_url_encode($ssurl);
+ $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']);
+ return 'ssr://' . Tools::base64_url_encode($ssurl);
+ }
+
+ if ($is_ss == 2) {
+ $personal_info = $item['method'] . ':' . $item['passwd'] . '@' . $item['address'] . ':' . $item['port'];
+ $ssurl = 'ss://' . Tools::base64_url_encode($personal_info);
+ $ssurl .= '#' . rawurlencode(Config::get('appName') . ' - ' . $item['remark']);
} else {
- if ($is_ss == 2) {
- $personal_info = $item['method'] . ':' . $item['passwd'] . "@" . $item['address'] . ":" . $item['port'];
- $ssurl = "ss://" . Tools::base64_url_encode($personal_info);
- $ssurl .= "#" . rawurlencode(Config::get('appName') . " - " . $item['remark']);
- } else {
- $personal_info = $item['method'] . ':' . $item['passwd'];
- $ssurl = "ss://" . Tools::base64_url_encode($personal_info) . "@" . $item['address'] . ":" . $item['port'];
- $plugin = '';
- if (in_array($item['obfs'], $ss_obfs_list) || $item['obfs'] == "v2ray") {
- if (strpos($item['obfs'], 'http') !== FALSE) {
- $plugin .= "obfs-local;obfs=http";
- } elseif (strpos($item['obfs'], 'tls') !== false) {
- $plugin .= "obfs-local;obfs=tls";
- } else {
- $plugin .= "v2ray;" . $item['obfs_param'];
- }
- if ($item['obfs_param'] != '' && $item['obfs'] != "v2ray") {
- $plugin .= ";obfs-host=" . $item['obfs_param'];
- }
- $ssurl .= "?plugin=" . rawurlencode($plugin);
+ $personal_info = $item['method'] . ':' . $item['passwd'];
+ $ssurl = 'ss://' . Tools::base64_url_encode($personal_info) . '@' . $item['address'] . ':' . $item['port'];
+ $plugin = '';
+ if (in_array($item['obfs'], $ss_obfs_list) || $item['obfs'] == 'v2ray') {
+ if (strpos($item['obfs'], 'http') !== false) {
+ $plugin .= 'obfs-local;obfs=http';
+ } elseif (strpos($item['obfs'], 'tls') !== false) {
+ $plugin .= 'obfs-local;obfs=tls';
+ } else {
+ $plugin .= 'v2ray;' . $item['obfs_param'];
}
- $ssurl .= "#" . rawurlencode(Config::get('appName') . " - " . $item['remark']);
+ if ($item['obfs_param'] != '' && $item['obfs'] != 'v2ray') {
+ $plugin .= ';obfs-host=' . $item['obfs_param'];
+ }
+ $ssurl .= '?plugin=' . rawurlencode($plugin);
}
- return $ssurl;
+ $ssurl .= '#' . rawurlencode(Config::get('appName') . ' - ' . $item['remark']);
}
+ return $ssurl;
}
public static function getV2Url($user, $node, $arrout = 0)
{
$item = Tools::v2Array($node->server);
- $item['v'] = "2";
+ $item['v'] = '2';
$item['ps'] = $node->name;
$item['id'] = $user->getUuid();
if ($arrout == 0) {
- return "vmess://" . base64_encode((json_encode($item, JSON_UNESCAPED_UNICODE)));
- } else {
- return $item;
+ return 'vmess://' . base64_encode(json_encode($item, JSON_UNESCAPED_UNICODE));
}
+
+ return $item;
}
public static function getAllVMessUrl($user, $arrout = 0)
{
$nodes = Node::where(
- function ($query) {
+ static function ($query) {
$query->where('sort', 11)
->orwhere('sort', 12);
}
)->where(
- function ($query) use ($user) {
- $query->where("node_group", "=", $user->node_group)
- ->orWhere("node_group", "=", 0);
+ static function ($query) use ($user) {
+ $query->where('node_group', '=', $user->node_group)
+ ->orWhere('node_group', '=', 0);
}
- )->where("type", "1")->where("node_class", "<=", $user->class)->orderBy("name")->get();
+ )->where('type', '1')->where('node_class', '<=', $user->class)->orderBy('name')->get();
if ($arrout == 0) {
- $result = "";
+ $result = '';
foreach ($nodes as $node) {
- $result .= (URL::getV2Url($user, $node, $arrout) . "\n");
+ $result .= (self::getV2Url($user, $node, $arrout) . "\n");
}
} else {
$result = [];
foreach ($nodes as $node) {
- array_push($result, URL::getV2Url($user, $node, $arrout));
+ $result[] = self::getV2Url($user, $node, $arrout);
}
}
return $result;
@@ -350,11 +335,11 @@ class URL
public static function getAllSSDUrl($user)
{
- if (!URL::SSCanConnect($user)) {
+ if (!self::SSCanConnect($user)) {
return null;
}
$array_all = array();
- $array_all['airport'] = Config::get("appName");
+ $array_all['airport'] = Config::get('appName');
$array_all['port'] = $user->port;
$array_all['encryption'] = $user->method;
$array_all['password'] = $user->passwd;
@@ -363,10 +348,10 @@ class URL
$array_all['expiry'] = $user->class_expire;
$array_all['url'] = Config::get('subUrl') . LinkController::GenerateSSRSubCode($user->id, 0) . '?mu=3';
$plugin_options = '';
- if (strpos($user->obfs, 'http') != FALSE) {
+ if (strpos($user->obfs, 'http') != false) {
$plugin_options = 'obfs=http';
}
- if (strpos($user->obfs, 'tls') != FALSE) {
+ if (strpos($user->obfs, 'tls') != false) {
$plugin_options = 'obfs=tls';
}
if ($plugin_options != '') {
@@ -380,12 +365,12 @@ class URL
$nodes_muport = Node::where('type', 1)->where('sort', '=', 9)->orderBy('name')->get();
$array_server = array();
$nodes = Node::where('type', 1)->where('node_class', '<=', $user->class)
- ->where(function ($func) {
+ ->where(static function ($func) {
$func->where('sort', '=', 0)
->orwhere('sort', '=', 10)
->orwhere('sort', '=', 13);
})
- ->where(function ($func) use ($user) {
+ ->where(static function ($func) use ($user) {
$func->where('node_group', '=', $user->node_group)
->orwhere('node_group', '=', 0);
})->orderBy('name')->get();
@@ -393,7 +378,7 @@ class URL
foreach ($nodes as $node) {
$server = array();
if ($node->sort == 13) {
- if (URL::CanMethodConnect($user->method) != 2) {
+ if (self::CanMethodConnect($user->method) != 2) {
continue;
}
$ssv2Array = Tools::ssv2Array($node->server);
@@ -404,12 +389,12 @@ class URL
$server['encryption'] = $user->method;
$server['password'] = $user->passwd;
$server['plugin'] = 'v2ray';
- if ($ssv2Array['tls'] == "tls" && $ssv2Array['net'] == "ws") {
- $server['plugin_options'] = "mode=ws;security=tls;path=" . $ssv2Array['path'] . ";host=" . $user->getMuMd5();
+ if ($ssv2Array['tls'] == 'tls' && $ssv2Array['net'] == 'ws') {
+ $server['plugin_options'] = 'mode=ws;security=tls;path=' . $ssv2Array['path'] . ';host=' . $user->getMuMd5();
} else {
- $server['plugin_options'] = "mode=ws;security=none;path=" . $ssv2Array['path'] . ";host=" . $user->getMuMd5();
+ $server['plugin_options'] = 'mode=ws;security=none;path=' . $ssv2Array['path'] . ';host=' . $user->getMuMd5();
}
- array_push($array_server, $server);
+ $array_server[] = $server;
$server_index++;
continue;
}
@@ -417,7 +402,7 @@ class URL
$server['server'] = $node->server;
//判断是否是中转起源节点
$relay_rule = Relay::where('source_node_id', $node->id)->where(
- function ($query) use ($user) {
+ static function ($query) use ($user) {
$query->Where('user_id', '=', $user->id)
->orWhere('user_id', '=', 0);
}
@@ -426,7 +411,7 @@ class URL
//是中转起源节点
$server['remarks'] = $node->name . ' => ' . $relay_rule->dist_node()->name;
$server['ratio'] = $node->traffic_rate + $relay_rule->dist_node()->traffic_rate;
- array_push($array_server, $server);
+ $array_server[] = $server;
$server_index++;
continue;
}
@@ -437,13 +422,13 @@ class URL
//包含普通
if ($node->mu_only == 0 || $node->mu_only == -1) {
$server['remarks'] = $node->name;
- array_push($array_server, $server);
+ $array_server[] = $server;
$server_index++;
}
//包含单多
if ($node->mu_only == 0 || $node->mu_only == 1) {
$nodes_muport = Node::where('type', '1')->where('sort', '=', 9)
- ->where(function ($query) use ($user) {
+ ->where(static function ($query) use ($user) {
$query->Where('node_group', '=', $user->group)
->orWhere('node_group', '=', 0);
})
@@ -451,7 +436,7 @@ class URL
->orderBy('server')->get();
foreach ($nodes_muport as $node_muport) {
$muport_user = User::where('port', '=', $node_muport->server)->first();
- if (!URL::SSCanConnect($muport_user)) {
+ if (!self::SSCanConnect($muport_user)) {
continue;
}
$server['id'] = $server_index;
@@ -461,14 +446,14 @@ class URL
$server['password'] = $muport_user->passwd;
$server['plugin'] = 'simple-obfs';//目前只支持这个
$plugin_options = '';
- if (strpos($muport_user->obfs, 'http') != FALSE) {
+ if (strpos($muport_user->obfs, 'http') != false) {
$plugin_options = 'obfs=http';
}
- if (strpos($muport_user->obfs, 'tls') != FALSE) {
+ if (strpos($muport_user->obfs, 'tls') != false) {
$plugin_options = 'obfs=tls';
}
$server['plugin_options'] = $plugin_options . ';obfs-host=' . $user->getMuMd5();
- array_push($array_server, $server);
+ $array_server[] = $server;
$server_index++;
}
}
@@ -483,15 +468,15 @@ class URL
public static function getJsonObfs($item)
{
$ss_obfs_list = Config::getSupportParam('ss_obfs');
- $plugin = "";
+ $plugin = '';
if (in_array($item['obfs'], $ss_obfs_list)) {
- if (strpos($item['obfs'], 'http') !== FALSE) {
- $plugin .= "obfs-local --obfs http";
+ if (strpos($item['obfs'], 'http') !== false) {
+ $plugin .= 'obfs-local --obfs http';
} else {
- $plugin .= "obfs-local --obfs tls";
+ $plugin .= 'obfs-local --obfs tls';
}
if ($item['obfs_param'] != '') {
- $plugin .= "--obfs-host " . $item['obfs_param'];
+ $plugin .= '--obfs-host ' . $item['obfs_param'];
}
}
return $plugin;
@@ -500,17 +485,17 @@ class URL
public static function getSurgeObfs($item)
{
$ss_obfs_list = Config::getSupportParam('ss_obfs');
- $plugin = "";
+ $plugin = '';
if (in_array($item['obfs'], $ss_obfs_list)) {
- if (strpos($item['obfs'], 'http') !== FALSE) {
- $plugin .= ",obfs=http";
+ if (strpos($item['obfs'], 'http') !== false) {
+ $plugin .= ',obfs=http';
} else {
- $plugin .= ",obfs=tls";
+ $plugin .= ',obfs=tls';
}
if ($item['obfs_param'] != '') {
- $plugin .= ",obfs-host=" . $item['obfs_param'];
+ $plugin .= ',obfs-host=' . $item['obfs_param'];
} else {
- $plugin .= ",obfs-host=wns.windows.com";
+ $plugin .= ',obfs-host=wns.windows.com';
}
}
return $plugin;
@@ -531,50 +516,50 @@ class URL
public static function getItem($user, $node, $mu_port = 0, $relay_rule_id = 0, $is_ss = 0)
{
$relay_rule = Relay::where('id', $relay_rule_id)->where(
- function ($query) use ($user) {
- $query->Where("user_id", "=", $user->id)
- ->orWhere("user_id", "=", 0);
+ static function ($query) use ($user) {
+ $query->Where('user_id', '=', $user->id)
+ ->orWhere('user_id', '=', 0);
}
)->orderBy('priority', 'DESC')->orderBy('id')->first();
$node_name = $node->name;
if ($relay_rule != null) {
- $node_name .= " - " . $relay_rule->dist_node()->name;
+ $node_name .= ' - ' . $relay_rule->dist_node()->name;
}
if ($mu_port != 0) {
- $mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
+ $mu_user = User::where('port', '=', $mu_port)->where('is_multi_user', '<>', 0)->first();
if ($mu_user == null) {
return;
}
$mu_user->obfs_param = $user->getMuMd5();
- $mu_user->protocol_param = $user->id . ":" . $user->passwd;
+ $mu_user->protocol_param = $user->id . ':' . $user->passwd;
$user = $mu_user;
if (Config::get('mergeSub') != 'true') {
- $node_name .= " - " . $mu_port . " 单端口";
+ $node_name .= ' - ' . $mu_port . ' 单端口';
}
}
if ($is_ss) {
- if (!URL::SSCanConnect($user)) {
+ if (!self::SSCanConnect($user)) {
return;
}
- $user = URL::getSSConnectInfo($user);
+ $user = self::getSSConnectInfo($user);
} else {
- if (!URL::SSRCanConnect($user)) {
+ if (!self::SSRCanConnect($user)) {
return;
}
- $user = URL::getSSRConnectInfo($user);
+ $user = self::getSSRConnectInfo($user);
}
if ($node->sort == 13) {
$server = Tools::ssv2Array($node->server);
$return_array['address'] = $server['add'];
$return_array['port'] = $server['port'];
- $return_array['protocol'] = "origin";
- $return_array['protocol_param'] = "";
+ $return_array['protocol'] = 'origin';
+ $return_array['protocol_param'] = '';
$return_array['path'] = $server['path'];
- $return_array['obfs'] = "v2ray";
- if ($server['tls'] == "tls" && $server['net'] == "ws") {
- $return_array['obfs_param'] = "mode=ws;security=tls;path=" . $server['path'] . ";host=" . $user->getMuMd5();
+ $return_array['obfs'] = 'v2ray';
+ if ($server['tls'] == 'tls' && $server['net'] == 'ws') {
+ $return_array['obfs_param'] = 'mode=ws;security=tls;path=' . $server['path'] . ';host=' . $user->getMuMd5();
} else {
- $return_array['obfs_param'] = "mode=ws;security=none;path=" . $server['path'] . ";host=" . $user->getMuMd5();
+ $return_array['obfs_param'] = 'mode=ws;security=none;path=' . $server['path'] . ';host=' . $user->getMuMd5();
}
} else {
$return_array['address'] = $node->server;
@@ -596,8 +581,7 @@ class URL
public static function cloneUser($user)
{
- $new_user = clone $user;
- return $new_user;
+ return clone $user;
}
public static function getUserTraffic($user, $is_mu = 0)
@@ -612,11 +596,11 @@ class URL
} else {
$percent = number_format(($user->transfer_enable - $user->u - $user->d) / $user->transfer_enable * 100, 2) . '%';
}
- $ssurl = "www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=" . Tools::base64_url_encode('剩余流量:' . $percent . ' ' . $user->unusedTraffic()) . "&group=" . Tools::base64_url_encode($group_name);
+ $ssurl = 'www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=' . Tools::base64_url_encode('剩余流量:' . $percent . ' ' . $user->unusedTraffic()) . '&group=' . Tools::base64_url_encode($group_name);
} else {
- $ssurl = "www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=" . Tools::base64_url_encode("账户已过期,请续费后使用") . "&group=" . Tools::base64_url_encode($group_name);
+ $ssurl = 'www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=' . Tools::base64_url_encode('账户已过期,请续费后使用') . '&group=' . Tools::base64_url_encode($group_name);
}
- return "ssr://" . Tools::base64_url_encode($ssurl);
+ return 'ssr://' . Tools::base64_url_encode($ssurl);
}
public static function getUserClassExpiration($user, $is_mu = 0)
@@ -626,10 +610,10 @@ class URL
$group_name .= ' - 单端口';
}
if (strtotime($user->expire_in) > time()) {
- $ssurl = "www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=" . Tools::base64_url_encode("过期时间:" . $user->class_expire) . "&group=" . Tools::base64_url_encode($group_name);
+ $ssurl = 'www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=' . Tools::base64_url_encode('过期时间:' . $user->class_expire) . '&group=' . Tools::base64_url_encode($group_name);
} else {
- $ssurl = "www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=" . Tools::base64_url_encode("账户已过期,请续费后使用") . "&group=" . Tools::base64_url_encode($group_name);
+ $ssurl = 'www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=' . Tools::base64_url_encode('账户已过期,请续费后使用') . '&group=' . Tools::base64_url_encode($group_name);
}
- return "ssr://" . Tools::base64_url_encode($ssurl);
+ return 'ssr://' . Tools::base64_url_encode($ssurl);
}
}
From 98368c63f49929f6da532600c0b2eacb55662058 Mon Sep 17 00:00:00 2001
From: Anankke
Date: Thu, 30 May 2019 17:54:31 -0400
Subject: [PATCH 008/182] =?UTF-8?q?=E5=B0=8F=E5=9C=BA=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/Controllers/ApiController.php | 1 -
app/Controllers/BaseController.php | 8 +-
app/Controllers/HomeController.php | 13 +--
app/Controllers/LinkController.php | 1 -
app/Controllers/Mu/NodeController.php | 16 +--
app/Controllers/Mu/UserController.php | 64 +++++------
app/Controllers/RelayController.php | 1 -
app/Controllers/UserController.php | 3 -
app/Controllers/VueController.php | 156 ++++++++++++--------------
app/Services/BitPayment.php | 1 -
app/Services/Gateway/AopF2F.php | 1 -
app/Services/Gateway/Codepay.php | 2 -
app/Services/Gateway/PaymentWall.php | 2 -
app/Services/Gateway/SPay.php | 1 -
app/Services/Mail/NullMail.php | 2 -
app/Services/Payment.php | 1 -
app/Services/Slim.php | 6 -
17 files changed, 117 insertions(+), 162 deletions(-)
diff --git a/app/Controllers/ApiController.php b/app/Controllers/ApiController.php
index b7c13b63..c5c4dc7a 100644
--- a/app/Controllers/ApiController.php
+++ b/app/Controllers/ApiController.php
@@ -2,7 +2,6 @@
namespace App\Controllers;
-use App\Models\InviteCode;
use App\Models\Node;
use App\Models\User;
use App\Services\Factory;
diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php
index 50461eb1..62c13a72 100644
--- a/app/Controllers/BaseController.php
+++ b/app/Controllers/BaseController.php
@@ -2,8 +2,10 @@
namespace App\Controllers;
+use App\Models\User;
use App\Services\View;
use App\Services\Auth;
+use Smarty;
/**
* BaseController
@@ -11,12 +13,12 @@ use App\Services\Auth;
class BaseController
{
/**
- * @var \Smarty
+ * @var Smarty
*/
protected $view;
/**
- * @var \App\Models\User
+ * @var User
*/
protected $user;
@@ -32,7 +34,7 @@ class BaseController
/**
* Get smarty
*
- * @return \Smarty
+ * @return Smarty
*/
public function view()
{
diff --git a/app/Controllers/HomeController.php b/app/Controllers/HomeController.php
index 1efb8953..ce3cd1a8 100644
--- a/app/Controllers/HomeController.php
+++ b/app/Controllers/HomeController.php
@@ -3,20 +3,9 @@
namespace App\Controllers;
use App\Models\InviteCode;
-use App\Models\User;
-use App\Models\Code;
-use App\Models\Payback;
-use App\Models\Paylist;
-use App\Services\Auth;
use App\Services\Config;
-use App\Services\Payment;
use App\Utils\AliPay;
-use App\Utils\Tools;
-use App\Utils\Telegram;
-use App\Utils\Tuling;
use App\Utils\TelegramSessionManager;
-use App\Utils\QRcode;
-use App\Utils\Pay;
use App\Utils\TelegramProcess;
use App\Utils\Spay_tool;
use App\Utils\Geetest;
@@ -91,7 +80,7 @@ class HomeController extends BaseController
public function telegram($request, $response, $args)
{
- $token = $request->getQueryParams()["token"] ?? "";
+ $token = $request->getQueryParams()['token'] ?? '';
if ($token == Config::get('telegram_request_token')) {
TelegramProcess::process();
diff --git a/app/Controllers/LinkController.php b/app/Controllers/LinkController.php
index 677d221c..67765a97 100644
--- a/app/Controllers/LinkController.php
+++ b/app/Controllers/LinkController.php
@@ -194,5 +194,4 @@ class LinkController extends BaseController
);
return $render->fetch('clash.tpl');
}
-
}
diff --git a/app/Controllers/Mu/NodeController.php b/app/Controllers/Mu/NodeController.php
index ed6d23cb..534661c9 100644
--- a/app/Controllers/Mu/NodeController.php
+++ b/app/Controllers/Mu/NodeController.php
@@ -19,14 +19,14 @@ class NodeController extends BaseController
$log->log_time = time();
if (!$log->save()) {
$res = [
- "ret" => 0,
- "msg" => "update failed",
+ 'ret' => 0,
+ 'msg' => 'update failed',
];
return $this->echoJson($response, $res);
}
$res = [
- "ret" => 1,
- "msg" => "ok",
+ 'ret' => 1,
+ 'msg' => 'ok',
];
return $this->echoJson($response, $res);
}
@@ -43,14 +43,14 @@ class NodeController extends BaseController
$log->log_time = time();
if (!$log->save()) {
$res = [
- "ret" => 0,
- "msg" => "update failed",
+ 'ret' => 0,
+ 'msg' => 'update failed',
];
return $this->echoJson($response, $res);
}
$res = [
- "ret" => 1,
- "msg" => "ok",
+ 'ret' => 1,
+ 'msg' => 'ok',
];
return $this->echoJson($response, $res);
}
diff --git a/app/Controllers/Mu/UserController.php b/app/Controllers/Mu/UserController.php
index 7b1d1229..733b5274 100644
--- a/app/Controllers/Mu/UserController.php
+++ b/app/Controllers/Mu/UserController.php
@@ -13,10 +13,10 @@ class UserController extends BaseController
// User List
public function index($request, $response, $args)
{
- $node = Node::where("node_ip", "=", $_SERVER["REMOTE_ADDR"])->where(
- function ($query) {
- $query->where("sort", "=", 0)
- ->orWhere("sort", "=", 10)->orWhere("sort", "=", 12);
+ $node = Node::where('node_ip', '=', $_SERVER['REMOTE_ADDR'])->where(
+ static function ($query) {
+ $query->where('sort', '=', 0)
+ ->orWhere('sort', '=', 10)->orWhere('sort', '=', 12);
}
)->first();
$node->node_heartbeat = time();
@@ -24,37 +24,35 @@ class UserController extends BaseController
if ($node->node_group != 0) {
$users_raw = User::where(
- function ($query) use ($node) {
+ static function ($query) use ($node) {
$query->where(
- function ($query1) use ($node) {
- $query1->where("class", ">=", $node->node_class)
- ->where("node_group", "=", $node->node_group);
+ static function ($query1) use ($node) {
+ $query1->where('class', '>=', $node->node_class)
+ ->where('node_group', '=', $node->node_group);
}
)->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 {
$users_raw = User::where(
- function ($query) use ($node) {
+ static function ($query) use ($node) {
$query->where(
- function ($query1) use ($node) {
- $query1->where("class", ">=", $node->node_class);
+ static function ($query1) use ($node) {
+ $query1->where('class', '>=', $node->node_class);
}
)->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();
}
- if ($node->node_bandwidth_limit != 0) {
- if ($node->node_bandwidth_limit < $node->node_bandwidth) {
- $users = null;
-
- $res = [
- "ret" => 1,
- "data" => $users
- ];
- return $this->echoJson($response, $res);
- }
+ if (($node->node_bandwidth_limit != 0) && $node->node_bandwidth_limit < $node->node_bandwidth) {
+ $users = null;
+
+ $res = [
+ 'ret' => 1,
+ 'data' => $users
+ ];
+ return $this->echoJson($response, $res);
}
$key_list = array('method', 'id', 'port', 'passwd', 'u', 'd', 'enable',
@@ -65,14 +63,14 @@ class UserController extends BaseController
foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
- array_push($users_output, $user_raw);
+ $users_output[] = $user_raw;
}
}
$res = [
- "ret" => 1,
- "msg" => "ok",
- "data" => $users_output
+ 'ret' => 1,
+ 'msg' => 'ok',
+ 'data' => $users_output
];
return $this->echoJson($response, $res);
}
@@ -95,12 +93,12 @@ class UserController extends BaseController
$user = User::find($id);
$user->t = time();
- $user->u = $user->u + ($u * $rate);
- $user->d = $user->d + ($d * $rate);
+ $user->u += ($u * $rate);
+ $user->d += ($d * $rate);
if (!$user->save()) {
$res = [
- "ret" => 0,
- "msg" => "update failed",
+ 'ret' => 0,
+ 'msg' => 'update failed',
];
//return $this->echoJson($response, $res);
}
@@ -116,8 +114,8 @@ class UserController extends BaseController
$traffic->save();
$res = [
- "ret" => 1,
- "msg" => "ok",
+ 'ret' => 1,
+ 'msg' => 'ok',
];
return $this->echoJson($response, $res);
}
diff --git a/app/Controllers/RelayController.php b/app/Controllers/RelayController.php
index 1868fcca..7774b47a 100644
--- a/app/Controllers/RelayController.php
+++ b/app/Controllers/RelayController.php
@@ -6,7 +6,6 @@ use App\Models\Relay;
use App\Models\Node;
use App\Models\User;
use App\Services\Auth;
-use App\Controllers\UserController;
use App\Utils\Tools;
use App\Services\Config;
use ArrayObject;
diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php
index 9e44c1bb..32fb5cdd 100755
--- a/app/Controllers/UserController.php
+++ b/app/Controllers/UserController.php
@@ -6,7 +6,6 @@ use App\Services\Auth;
use App\Models\Node;
use App\Models\TrafficLog;
use App\Models\InviteCode;
-use App\Models\CheckInLog;
use App\Models\Ann;
use App\Models\Speedtest;
use App\Models\Shop;
@@ -22,7 +21,6 @@ use App\Utils\AliPay;
use App\Utils\Hash;
use App\Utils\Tools;
use App\Utils\Radius;
-use App\Models\RadiusBan;
use App\Models\DetectLog;
use App\Models\DetectRule;
@@ -32,7 +30,6 @@ use voku\helper\AntiXSS;
use App\Models\User;
use App\Models\Code;
use App\Models\Ip;
-use App\Models\Paylist;
use App\Models\LoginIp;
use App\Models\BlockIp;
use App\Models\UnblockIp;
diff --git a/app/Controllers/VueController.php b/app/Controllers/VueController.php
index 1be60f4b..7d415f51 100644
--- a/app/Controllers/VueController.php
+++ b/app/Controllers/VueController.php
@@ -6,27 +6,17 @@ use App\Models\InviteCode;
use App\Models\User;
use App\Models\Code;
use App\Models\Payback;
-use App\Models\Paylist;
use App\Models\Ann;
use App\Models\Shop;
use App\Services\Auth;
use App\Services\Config;
-use App\Services\Payment;
use App\Utils\AliPay;
use App\Utils\Tools;
-use App\Utils\Telegram;
-use App\Utils\Tuling;
use App\Utils\TelegramSessionManager;
-use App\Utils\QRcode;
-use App\Utils\Pay;
-use App\Utils\TelegramProcess;
use App\Utils\Spay_tool;
use App\Utils\Geetest;
-use voku\helper\AntiXSS;
-
use App\Utils\URL;
-use App\Models\Ip;
use App\Models\Node;
use App\Models\Relay;
@@ -43,7 +33,7 @@ class VueController extends BaseController
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
- $uid = time() . rand(1, 10000);
+ $uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
break;
}
@@ -51,7 +41,7 @@ class VueController extends BaseController
if (Config::get('enable_telegram') == 'true') {
$login_text = TelegramSessionManager::add_login_session();
- $login = explode("|", $login_text);
+ $login = explode('|', $login_text);
$login_token = $login[0];
$login_number = $login[1];
} else {
@@ -60,25 +50,25 @@ class VueController extends BaseController
}
$res['globalConfig'] = array(
- "geetest_html" => $GtSdk,
- "login_token" => $login_token,
- "login_number" => $login_number,
- "telegram_bot" => Config::get('telegram_bot'),
- "enable_logincaptcha" => Config::get('enable_login_captcha'),
- "enable_regcaptcha" => Config::get('enable_reg_captcha'),
- "enable_checkin_captcha" => Config::get('enable_checkin_captcha'),
- "base_url" => Config::get('baseUrl'),
- "recaptcha_sitekey" => $recaptcha_sitekey,
- "captcha_provider" => Config::get('captcha_provider'),
- "jump_delay" => Config::get('jump_delay'),
- "register_mode" => Config::get('register_mode'),
- "enable_email_verify" => Config::get('enable_email_verify'),
- "appName" => Config::get('appName'),
- "dateY" => date("Y"),
- "isLogin" => $user->isLogin,
- "enable_telegram" => Config::get('enable_telegram'),
- "enable_mylivechat" => Config::get('enable_mylivechat'),
- "payment_type" => Config::get('payment_system'),
+ 'geetest_html' => $GtSdk,
+ 'login_token' => $login_token,
+ 'login_number' => $login_number,
+ 'telegram_bot' => Config::get('telegram_bot'),
+ 'enable_logincaptcha' => Config::get('enable_login_captcha'),
+ 'enable_regcaptcha' => Config::get('enable_reg_captcha'),
+ 'enable_checkin_captcha' => Config::get('enable_checkin_captcha'),
+ 'base_url' => Config::get('baseUrl'),
+ 'recaptcha_sitekey' => $recaptcha_sitekey,
+ 'captcha_provider' => Config::get('captcha_provider'),
+ 'jump_delay' => Config::get('jump_delay'),
+ 'register_mode' => Config::get('register_mode'),
+ 'enable_email_verify' => Config::get('enable_email_verify'),
+ 'appName' => Config::get('appName'),
+ 'dateY' => date('Y'),
+ 'isLogin' => $user->isLogin,
+ 'enable_telegram' => Config::get('enable_telegram'),
+ 'enable_mylivechat' => Config::get('enable_mylivechat'),
+ 'payment_type' => Config::get('payment_system'),
);
$res['ret'] = 1;
@@ -118,7 +108,7 @@ class VueController extends BaseController
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
- $uid = time() . rand(1, 10000);
+ $uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
break;
}
@@ -133,17 +123,17 @@ class VueController extends BaseController
$user['online_ip_count'] = $user->online_ip_count();
$res['info'] = array(
- "user" => $user,
- "ssrSubToken" => $ssr_sub_token,
- "displayIosClass" => $display_ios_class,
- "iosAccount" => $ios_account,
- "iosPassword" => $ios_password,
- "mergeSub" => $mergeSub,
- "subUrl" => $subUrl,
- "baseUrl" => $baseUrl,
- "ann" => $Ann,
- "recaptchaSitekey" => $recaptcha_sitekey,
- "GtSdk" => $GtSdk,
+ 'user' => $user,
+ 'ssrSubToken' => $ssr_sub_token,
+ 'displayIosClass' => $display_ios_class,
+ 'iosAccount' => $ios_account,
+ 'iosPassword' => $ios_password,
+ 'mergeSub' => $mergeSub,
+ 'subUrl' => $subUrl,
+ 'baseUrl' => $baseUrl,
+ 'ann' => $Ann,
+ 'recaptchaSitekey' => $recaptcha_sitekey,
+ 'GtSdk' => $GtSdk,
);
$res['ret'] = 1;
@@ -168,22 +158,22 @@ class VueController extends BaseController
$pageNum = $request->getParam('current');
- $paybacks = Payback::where("ref_by", $user->id)->orderBy("id", "desc")->paginate(15, ['*'], 'page', $pageNum);
- if (!$paybacks_sum = Payback::where("ref_by", $user->id)->sum('ref_get')) {
+ $paybacks = Payback::where('ref_by', $user->id)->orderBy('id', 'desc')->paginate(15, ['*'], 'page', $pageNum);
+ if (!$paybacks_sum = Payback::where('ref_by', $user->id)->sum('ref_get')) {
$paybacks_sum = 0;
}
$paybacks->setPath('/#/user/panel');
$res['inviteInfo'] = array(
- "code" => $code,
- "paybacks" => $paybacks,
- "paybacks_sum" => $paybacks_sum,
- "invite_num" => $user->invite_num,
- "invitePrice" => Config::get('invite_price'),
- "customPrice" => Config::get('custom_invite_price'),
- "invite_gift" => Config::get('invite_gift'),
- "invite_get_money" => Config::get('invite_get_money'),
- "code_payback" => Config::get('code_payback'),
+ 'code' => $code,
+ 'paybacks' => $paybacks,
+ 'paybacks_sum' => $paybacks_sum,
+ 'invite_num' => $user->invite_num,
+ 'invitePrice' => Config::get('invite_price'),
+ 'customPrice' => Config::get('custom_invite_price'),
+ 'invite_gift' => Config::get('invite_gift'),
+ 'invite_get_money' => Config::get('invite_get_money'),
+ 'code_payback' => Config::get('code_payback'),
);
$res['ret'] = 1;
@@ -200,7 +190,7 @@ class VueController extends BaseController
return $response->getBody()->write(json_encode($res));
}
- $shops = Shop::where("status", 1)->orderBy("name")->get();
+ $shops = Shop::where('status', 1)->orderBy('name')->get();
$res['arr'] = array(
'shops' => $shops,
@@ -220,13 +210,13 @@ class VueController extends BaseController
}
$res['resourse'] = array(
- "money" => $user->money,
- "class" => $user->class,
- "class_expire" => $user->class_expire,
- "expire_in" => $user->expire_in,
- "online_ip_count" => $user->online_ip_count(),
- "node_speedlimit" => $user->node_speedlimit,
- "node_connector" => $user->node_connector,
+ 'money' => $user->money,
+ 'class' => $user->class,
+ 'class_expire' => $user->class_expire,
+ 'expire_in' => $user->expire_in,
+ 'online_ip_count' => $user->online_ip_count(),
+ 'node_speedlimit' => $user->node_speedlimit,
+ 'node_connector' => $user->node_connector,
);
$res['ret'] = 1;
@@ -271,7 +261,7 @@ class VueController extends BaseController
}
$res['arr'] = array(
- "code" => $code,
+ 'code' => $code,
);
$res['ret'] = 1;
@@ -289,9 +279,9 @@ class VueController extends BaseController
}
$res['arr'] = array(
- "todayUsedTraffic" => $user->TodayusedTraffic(),
- "lastUsedTraffic" => $user->LastusedTraffic(),
- "unUsedTraffic" => $user->unusedTraffic(),
+ 'todayUsedTraffic' => $user->TodayusedTraffic(),
+ 'lastUsedTraffic' => $user->LastusedTraffic(),
+ 'unUsedTraffic' => $user->unusedTraffic(),
);
$res['ret'] = 1;
@@ -310,7 +300,7 @@ class VueController extends BaseController
$res['recaptchaKey'] = $recaptcha_sitekey;
break;
case 'geetest':
- $uid = time() . rand(1, 10000);
+ $uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
$res['GtSdk'] = $GtSdk;
break;
@@ -366,7 +356,7 @@ class VueController extends BaseController
if ($node->sort == 9) {
$mu_user = User::where('port', '=', $node->server)->first();
$mu_user->obfs_param = $this->user->getMuMd5();
- array_push($nodes_muport, array('server' => $node, 'user' => $mu_user));
+ $nodes_muport[] = array('server' => $node, 'user' => $mu_user);
continue;
}
$array_node = array();
@@ -376,13 +366,11 @@ class VueController extends BaseController
$array_node['name'] = $node->name;
if ($this->user->class < $node->node_class) {
$array_node['server'] = '***.***.***.***';
+ } elseif ($node->sort == 13) {
+ $server = Tools::ssv2Array($node->server);
+ $array_node['server'] = $server['add'];
} else {
- if ($node->sort == 13) {
- $server = Tools::ssv2Array($node->server);
- $array_node['server'] = $server['add'];
- } else {
- $array_node['server'] = $node->server;
- }
+ $array_node['server'] = $node->server;
}
$array_node['sort'] = $node->sort;
@@ -403,9 +391,9 @@ class VueController extends BaseController
$node_online = $node->isNodeOnline();
if ($node_online === null) {
$array_node['online'] = 0;
- } else if ($node_online === true) {
+ } elseif ($node_online === true) {
$array_node['online'] = 1;
- } else if ($node_online === false) {
+ } elseif ($node_online === false) {
$array_node['online'] = -1;
}
@@ -417,7 +405,7 @@ class VueController extends BaseController
$nodeLoad = $node->getNodeLoad();
if (isset($nodeLoad[0]['load'])) {
- $array_node['latest_load'] = ((explode(" ", $nodeLoad[0]['load']))[0]) * 100;
+ $array_node['latest_load'] = (explode(' ', $nodeLoad[0]['load']))[0] * 100;
} else {
$array_node['latest_load'] = -1;
}
@@ -426,7 +414,7 @@ class VueController extends BaseController
$array_node['traffic_limit'] = (int)Tools::flowToGB($node->node_bandwidth_limit);
if ($node->node_speedlimit == 0.0) {
$array_node['bandwidth'] = 0;
- } else if ($node->node_speedlimit >= 1024.00) {
+ } elseif ($node->node_speedlimit >= 1024.00) {
$array_node['bandwidth'] = round($node->node_speedlimit / 1024.00, 1) . 'Gbps';
} else {
$array_node['bandwidth'] = $node->node_speedlimit . 'Mbps';
@@ -435,15 +423,15 @@ class VueController extends BaseController
$array_node['traffic_rate'] = $node->traffic_rate;
$array_node['status'] = $node->status;
- array_push($array_nodes, $array_node);
+ $array_nodes[] = $array_node;
}
$res['nodeinfo'] = array(
- "nodes" => $array_nodes,
- "nodes_muport" => $nodes_muport,
- "relay_rules" => $relay_rules,
- "user" => $user,
- "tools" => new Tools(),
+ 'nodes' => $array_nodes,
+ 'nodes_muport' => $nodes_muport,
+ 'relay_rules' => $relay_rules,
+ 'user' => $user,
+ 'tools' => new Tools(),
);
$res['ret'] = 1;
diff --git a/app/Services/BitPayment.php b/app/Services/BitPayment.php
index b954f1a1..e43215c3 100644
--- a/app/Services/BitPayment.php
+++ b/app/Services/BitPayment.php
@@ -7,7 +7,6 @@
*/
namespace App\Services;
-use App\Services\Config;
use App\Services\Gateway\BitPay;
class BitPayment
diff --git a/app/Services/Gateway/AopF2F.php b/app/Services/Gateway/AopF2F.php
index 861fdb09..92026fb9 100644
--- a/app/Services/Gateway/AopF2F.php
+++ b/app/Services/Gateway/AopF2F.php
@@ -10,7 +10,6 @@ namespace App\Services\Gateway;
use App\Services\Auth;
use App\Services\Config;
-use App\Models\Code;
use App\Models\Paylist;
use App\Services\View;
use Exception;
diff --git a/app/Services/Gateway/Codepay.php b/app/Services/Gateway/Codepay.php
index dd1fc304..80426928 100755
--- a/app/Services/Gateway/Codepay.php
+++ b/app/Services/Gateway/Codepay.php
@@ -10,8 +10,6 @@ namespace App\Services\Gateway;
use App\Services\Auth;
use App\Services\Config;
-use App\Models\User;
-use App\Models\Code;
use App\Models\Paylist;
diff --git a/app/Services/Gateway/PaymentWall.php b/app/Services/Gateway/PaymentWall.php
index 42d2c992..35d5e748 100644
--- a/app/Services/Gateway/PaymentWall.php
+++ b/app/Services/Gateway/PaymentWall.php
@@ -11,10 +11,8 @@ namespace App\Services\Gateway;
use App\Models\User;
use App\Models\Code;
use App\Services\Auth;
-use App\Models\Paylist;
use App\Models\Payback;
use App\Services\Config;
-use App\Services\Payment;
use Paymentwall_Config;
use Paymentwall_Pingback;
use Paymentwall_Widget;
diff --git a/app/Services/Gateway/SPay.php b/app/Services/Gateway/SPay.php
index 4b0accfc..05b4c1f4 100755
--- a/app/Services/Gateway/SPay.php
+++ b/app/Services/Gateway/SPay.php
@@ -8,7 +8,6 @@
namespace App\Services\Gateway;
-use App\Services\View;
use App\Services\Auth;
use App\Services\Config;
diff --git a/app/Services/Mail/NullMail.php b/app/Services/Mail/NullMail.php
index 260b2f9f..5aac0a42 100644
--- a/app/Services/Mail/NullMail.php
+++ b/app/Services/Mail/NullMail.php
@@ -2,8 +2,6 @@
namespace App\Services\Mail;
-use App\Services\Config;
-
class NullMail extends Base
{
diff --git a/app/Services/Payment.php b/app/Services/Payment.php
index 87619f32..197a3d23 100644
--- a/app/Services/Payment.php
+++ b/app/Services/Payment.php
@@ -8,7 +8,6 @@
namespace App\Services;
-use App\Services\Config;
use App\Services\Gateway\{
AopF2F, Codepay, DoiAMPay, PaymentWall, ChenPay, SPay, TrimePay
};
diff --git a/app/Services/Slim.php b/app/Services/Slim.php
index b6a31bee..026481b7 100644
--- a/app/Services/Slim.php
+++ b/app/Services/Slim.php
@@ -3,12 +3,6 @@
namespace App\Services;
use Slim\App;
-use Slim\Container;
-use App\Controllers;
-use App\Middleware\Auth;
-use App\Middleware\Guest;
-use App\Middleware\Admin;
-use App\Middleware\Api;
use Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware;
/***
From a8f2a0f3d2fdc4da3c21f0297310255da1cf1eb9 Mon Sep 17 00:00:00 2001
From: Colinwood11
Date: Fri, 31 May 2019 02:01:41 +0200
Subject: [PATCH 009/182] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E8=84=91CTR?=
=?UTF-8?q?L+V=20(#667)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/Controllers/Admin/AnnController.php | 33 ++++++++-----------
.../material/admin/announcement/create.tpl | 19 +++--------
2 files changed, 18 insertions(+), 34 deletions(-)
diff --git a/app/Controllers/Admin/AnnController.php b/app/Controllers/Admin/AnnController.php
index b8d25c23..94d875bb 100644
--- a/app/Controllers/Admin/AnnController.php
+++ b/app/Controllers/Admin/AnnController.php
@@ -35,6 +35,7 @@ class AnnController extends AdminController
$PushBear = $request->getParam('PushBear');
$vip = $request->getParam('vip');
$content = $request->getParam('content');
+ $subject = Config::get('appName') . '-公告';
if ($request->getParam('page') == 1) {
$ann = new Ann();
@@ -47,12 +48,23 @@ class AnnController extends AdminController
$rs['msg'] = '添加失败';
return $response->getBody()->write(json_encode($rs));
}
+ }
+ if ($PushBear == 1) {
+ $PushBear_sendkey = Config::get('PushBear_sendkey');
+ $postdata = http_build_query(
+ array(
+ 'text' => $subject,
+ 'desp' => $request->getParam('markdown'),
+ 'sendkey'=> $PushBear_sendkey
+ )
+ );
+ file_get_contents('https://pushbear.ftqq.com/sub?' . $postdata, false);
}
if ($issend == 1) {
$beginSend = ($request->getParam('page') - 1) * Config::get('sendPageLimit');
$users = User::where('class', '>=', $vip)->skip($beginSend)->limit(Config::get('sendPageLimit'))->get();
foreach ($users as $user) {
- $subject = Config::get('appName') . '-公告';
+
$to = $user->email;
if (!filter_var($to, FILTER_VALIDATE_EMAIL)) {
continue;
@@ -67,29 +79,12 @@ class AnnController extends AdminController
continue;
}
}
- }
- if ($PushBear == 1) {
- $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
- $postdata = http_build_query(
- array(
- 'text' => Config::get('appName') . '-公告',
- 'desp' => $$request->getParam('markdown')
- )
- );
- $opts = array('http' =>
- array(
- 'method' => 'POST',
- 'header' => 'Content-type: application/x-www-form-urlencoded',
- 'content' => $postdata
- ));
- $context = stream_context_create($opts);
- file_get_contents('https://sc.ftqq.com/' . $ScFtqq_SCKEY . '.send', false, $context);
- }
if (count($users) == Config::get('sendPageLimit')) {
$rs['ret'] = 2;
$rs['msg'] = $request->getParam('page') + 1;
return $response->getBody()->write(json_encode($rs));
}
+ }
Telegram::SendMarkdown('新公告:' . PHP_EOL . $request->getParam('markdown'));
$rs['ret'] = 1;
diff --git a/resources/views/material/admin/announcement/create.tpl b/resources/views/material/admin/announcement/create.tpl
index 763bb861..9af9087a 100644
--- a/resources/views/material/admin/announcement/create.tpl
+++ b/resources/views/material/admin/announcement/create.tpl
@@ -24,9 +24,7 @@
-
-
-
+
@@ -44,15 +42,12 @@
-
- {if $config["usePushBear"] == "true"}
info向关注了二维码的用户以微信方式推送消息
- {/if}
@@ -100,20 +95,16 @@
} else {
var issend=0;
}
- {if $config["usePushBear"] == "true"}
if ($$.getElementById('PushBear').checked) {
- var PushBear=1;
+ var PushBear = 1;
} else {
- var PushBear=0;
+ var PushBear = 0;
}
- {/if}
if (page === -1) {
sedPage = 1;
} else {
sedPage = page;
- {if $config["usePushBear"] == "true"}
- var PushBear=0;
- {/if}
+ var PushBear = 0;
}
$.ajax({
@@ -125,9 +116,7 @@
markdown: $('.editormd-markdown-textarea').val(),
vip: $$getValue('vip'),
issend,
- {if $config["usePushBear"] == "true"}
PushBear,
- {/if}
page: sedPage
},
success: data => {
From 3fde99fe681d8754282558962b695657aaece4f5 Mon Sep 17 00:00:00 2001
From: Anankke
Date: Thu, 30 May 2019 20:11:08 -0400
Subject: [PATCH 010/182] PSR 12
---
app/Controllers/Admin/AnnController.php | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/app/Controllers/Admin/AnnController.php b/app/Controllers/Admin/AnnController.php
index 94d875bb..7d7dac5d 100644
--- a/app/Controllers/Admin/AnnController.php
+++ b/app/Controllers/Admin/AnnController.php
@@ -35,7 +35,7 @@ class AnnController extends AdminController
$PushBear = $request->getParam('PushBear');
$vip = $request->getParam('vip');
$content = $request->getParam('content');
- $subject = Config::get('appName') . '-公告';
+ $subject = Config::get('appName') . '-公告';
if ($request->getParam('page') == 1) {
$ann = new Ann();
@@ -49,13 +49,13 @@ class AnnController extends AdminController
return $response->getBody()->write(json_encode($rs));
}
}
- if ($PushBear == 1) {
+ if ($PushBear == 1) {
$PushBear_sendkey = Config::get('PushBear_sendkey');
$postdata = http_build_query(
array(
'text' => $subject,
'desp' => $request->getParam('markdown'),
- 'sendkey'=> $PushBear_sendkey
+ 'sendkey' => $PushBear_sendkey
)
);
file_get_contents('https://pushbear.ftqq.com/sub?' . $postdata, false);
@@ -64,7 +64,6 @@ class AnnController extends AdminController
$beginSend = ($request->getParam('page') - 1) * Config::get('sendPageLimit');
$users = User::where('class', '>=', $vip)->skip($beginSend)->limit(Config::get('sendPageLimit'))->get();
foreach ($users as $user) {
-
$to = $user->email;
if (!filter_var($to, FILTER_VALIDATE_EMAIL)) {
continue;
@@ -79,12 +78,12 @@ class AnnController extends AdminController
continue;
}
}
- if (count($users) == Config::get('sendPageLimit')) {
- $rs['ret'] = 2;
- $rs['msg'] = $request->getParam('page') + 1;
- return $response->getBody()->write(json_encode($rs));
+ if (count($users) == Config::get('sendPageLimit')) {
+ $rs['ret'] = 2;
+ $rs['msg'] = $request->getParam('page') + 1;
+ return $response->getBody()->write(json_encode($rs));
+ }
}
- }
Telegram::SendMarkdown('新公告:' . PHP_EOL . $request->getParam('markdown'));
$rs['ret'] = 1;
From 076073f808fa9e64315bcba6f037c2105f57cb36 Mon Sep 17 00:00:00 2001
From: Anankke
Date: Thu, 30 May 2019 20:25:20 -0400
Subject: [PATCH 011/182] Update gitignore
---
.gitignore | 4 +---
storage/framework/smarty/cache/.gitignore | 2 --
storage/framework/smarty/compile/.gitignore | 2 --
storage/framework/views/.gitignore | 2 --
4 files changed, 1 insertion(+), 9 deletions(-)
delete mode 100644 storage/framework/smarty/cache/.gitignore
delete mode 100644 storage/framework/smarty/compile/.gitignore
delete mode 100644 storage/framework/views/.gitignore
diff --git a/.gitignore b/.gitignore
index 9882b8c4..bdf4838f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,10 +8,8 @@ index.html
public/ssr-download/
public/images/*.*
public/theme/material/css/images/bg
-storage/trimepay_notify.log
-storage/traffic_notified/
+storage
.idea
-storage/qqwry.*
.vs/
.htaccess
php_errors.log
diff --git a/storage/framework/smarty/cache/.gitignore b/storage/framework/smarty/cache/.gitignore
deleted file mode 100644
index c96a04f0..00000000
--- a/storage/framework/smarty/cache/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!.gitignore
\ No newline at end of file
diff --git a/storage/framework/smarty/compile/.gitignore b/storage/framework/smarty/compile/.gitignore
deleted file mode 100644
index c96a04f0..00000000
--- a/storage/framework/smarty/compile/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!.gitignore
\ No newline at end of file
diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore
deleted file mode 100644
index c96a04f0..00000000
--- a/storage/framework/views/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!.gitignore
\ No newline at end of file
From 9463b97c2ca9efbca64757e5e07ffe82ee450c90 Mon Sep 17 00:00:00 2001
From: Anankke
Date: Fri, 31 May 2019 04:17:42 -0400
Subject: [PATCH 012/182] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=BB=98=E8=AE=A4?=
=?UTF-8?q?=E5=8A=A0=E5=AF=86=E9=80=9F=E5=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/.config.example.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/.config.example.php b/config/.config.example.php
index 30f68506..d9750027 100644
--- a/config/.config.example.php
+++ b/config/.config.example.php
@@ -259,7 +259,7 @@ $System_Config['v2ray_level']='0';
$System_Config['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定
$System_Config['rememberMeDuration']='7'; //登录时记住账号时长天数
$System_Config['authDriver'] = 'cookie'; //不能更改此项
-$System_Config['pwdMethod'] = 'sha256'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2)
+$System_Config['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2)
$System_Config['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项
$System_Config['sessionDriver'] = 'cookie'; //可选: cookie,redis
$System_Config['cacheDriver'] = 'cookie'; //可选: cookie,redis
From 246ab2f3921413956fdd0c54d629bc67576b33a6 Mon Sep 17 00:00:00 2001
From: Anankke
Date: Fri, 31 May 2019 04:20:39 -0400
Subject: [PATCH 013/182] =?UTF-8?q?=E5=84=BF=E7=AB=A5=E8=8A=82=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=20(#668)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Master 儿童节更新
注意加入新的 config 选项
---
.editorconfig | 22 +
.github/ISSUE_TEMPLATE/new-issue.md | 47 -
.../issue.md => issue_template.md} | 24 +-
.gitignore | 7 +-
.travis.yml | 22 +-
README.md | 30 +-
app/Command/DailyMail.php | 52 +-
app/Command/ExtMail.php | 29 +-
app/Command/FinanceMail.php | 369 +-
app/Command/Job.php | 1031 ++--
app/Command/SyncRadius.php | 131 +-
app/Command/Update.php | 257 +-
app/Command/XCat.php | 251 +-
app/Controllers/Admin/AnnController.php | 110 +-
app/Controllers/Admin/AutoController.php | 31 +-
app/Controllers/Admin/CodeController.php | 69 +-
app/Controllers/Admin/DetectController.php | 67 +-
app/Controllers/Admin/IpController.php | 88 +-
app/Controllers/Admin/NodeController.php | 274 +-
app/Controllers/Admin/RelayController.php | 149 +-
app/Controllers/Admin/ShopController.php | 216 +-
app/Controllers/Admin/TicketController.php | 83 +-
app/Controllers/Admin/UserController.php | 553 +-
app/Controllers/AdminController.php | 120 +-
app/Controllers/ApiController.php | 116 +-
app/Controllers/AuthController.php | 267 +-
app/Controllers/BaseController.php | 36 +-
.../Client/ClientApiController.php | 25 +-
app/Controllers/HomeController.php | 77 +-
app/Controllers/LinkController.php | 651 +--
app/Controllers/Mod_Mu/FuncController.php | 127 +-
app/Controllers/Mod_Mu/NodeController.php | 58 +-
app/Controllers/Mod_Mu/UserController.php | 127 +-
app/Controllers/Mu/NodeController.php | 18 +-
app/Controllers/Mu/UserController.php | 76 +-
app/Controllers/PasswordController.php | 15 +-
app/Controllers/QuickPayFunction.php | 104 -
app/Controllers/RelayController.php | 285 +-
app/Controllers/ResController.php | 2 +-
app/Controllers/UserController.php | 990 ++--
app/Controllers/VueController.php | 440 ++
app/Middleware/Admin.php | 3 +-
app/Middleware/Api.php | 10 +-
app/Middleware/Auth.php | 6 +-
app/Middleware/Guest.php | 3 +-
app/Middleware/Mod_Mu.php | 21 +-
app/Middleware/Mu.php | 21 +-
app/Models/Ann.php | 7 +-
app/Models/Auto.php | 11 +-
app/Models/BlockIp.php | 15 +-
app/Models/Bought.php | 22 +-
app/Models/CheckInLog.php | 4 +-
app/Models/Code.php | 12 +-
app/Models/Config.php | 2 +-
app/Models/Coupon.php | 20 +-
app/Models/DetectLog.php | 34 +-
app/Models/DetectRule.php | 5 +-
app/Models/Disconnect.php | 5 +-
app/Models/EmailVerify.php | 5 +-
app/Models/InviteCode.php | 5 +-
app/Models/Ip.php | 31 +-
app/Models/Link.php | 4 +-
app/Models/LoginIp.php | 21 +-
app/Models/Model.php | 1 -
app/Models/Node.php | 50 +-
app/Models/NodeInfoLog.php | 11 +-
app/Models/NodeOnlineLog.php | 4 +-
app/Models/PasswordReset.php | 2 +-
app/Models/Payback.php | 10 +-
app/Models/Paylist.php | 2 +-
app/Models/RadiusBan.php | 4 +-
app/Models/RadiusNas.php | 4 +-
app/Models/RadiusRadAcct.php | 4 +-
app/Models/RadiusRadCheck.php | 4 +-
app/Models/RadiusRadPostauth.php | 4 +-
app/Models/RadiusRadUserGroup.php | 4 +-
app/Models/Relay.php | 29 +-
app/Models/Role.php | 5 +-
app/Models/Shop.php | 193 +-
app/Models/Speedtest.php | 48 +-
app/Models/TelegramSession.php | 15 +-
app/Models/Ticket.php | 17 +-
app/Models/Token.php | 4 +-
app/Models/TrafficLog.php | 26 +-
app/Models/UnblockIp.php | 18 +-
app/Models/User.php | 176 +-
app/Models/YftOrder.php | 17 -
app/Services/Analytic.php | 2 +-
app/Services/Analytics.php | 66 +-
app/Services/Auth/Base.php | 2 +
app/Services/Auth/Cookie.php | 60 +-
app/Services/Auth/JwtToken.php | 10 +-
app/Services/Auth/Redis.php | 19 +-
app/Services/Aws/Client.php | 4 +-
app/Services/Aws/Factory.php | 6 +-
app/Services/BitPayment.php | 43 +
app/Services/Boot.php | 14 +-
app/Services/Config.php | 112 +-
app/Services/Gateway/AbstractPayment.php | 75 +-
app/Services/Gateway/AopF2F.php | 45 +-
app/Services/Gateway/BitPay.php | 201 +
app/Services/Gateway/ChenPay.php | 129 +-
app/Services/Gateway/Codepay.php | 98 +-
app/Services/Gateway/DoiAMPay.php | 108 +-
app/Services/Gateway/PaymentWall.php | 78 +-
app/Services/Gateway/SPay.php | 123 +-
app/Services/Gateway/SPay/Spay_notify.php | 126 +-
app/Services/Gateway/SPay/Spay_submit.php | 29 +-
app/Services/Gateway/SPay/Spay_tool.php | 142 +-
app/Services/Gateway/TrimePay.php | 144 +-
app/Services/Gateway/YftPay.php | 281 -
app/Services/Gateway/YftPayConfig.php | 17 -
app/Services/Jwt.php | 5 +-
app/Services/Mail.php | 19 +-
app/Services/Mail/Mailgun.php | 43 +-
app/Services/Mail/NullMail.php | 2 -
app/Services/Mail/SendGrid.php | 32 +-
app/Services/Mail/Smtp.php | 22 +-
app/Services/Password.php | 9 +-
app/Services/Payment.php | 55 +-
app/Services/RedisClient.php | 6 +-
app/Services/Slim.php | 13 +-
app/Services/Token/Base.php | 2 +
app/Services/Token/Dynamodb.php | 12 +-
app/Services/View.php | 30 +-
app/Utils/AntiXSS.php | 4964 ++++++++---------
app/Utils/Check.php | 6 +-
app/Utils/CloudflareDriver.php | 23 +-
app/Utils/ConfRender.php | 11 +-
app/Utils/Cookie.php | 7 +-
app/Utils/DatatablesHelper.php | 15 +-
app/Utils/Discord.php | 73 +
app/Utils/DoiAMPay.php | 181 +-
app/Utils/GA.php | 41 +-
app/Utils/Geetest.php | 18 +-
app/Utils/GeetestLib.php | 164 +-
app/Utils/HTTPSocket.php | 59 +-
app/Utils/Hash.php | 42 +-
app/Utils/Helper.php | 6 +-
app/Utils/Pay.php | 7 +-
app/Utils/QQWry.php | 190 +-
app/Utils/QRcode.php | 66 +-
app/Utils/Radius.php | 108 +-
app/Utils/Response.php | 3 +-
app/Utils/Telegram.php | 24 +-
app/Utils/TelegramProcess.php | 322 +-
app/Utils/TelegramSessionManager.php | 58 +-
app/Utils/Tools.php | 253 +-
app/Utils/Tuling.php | 13 +-
app/Utils/URL.php | 844 ++-
composer-setup.php | 4823 ++++++++++++++++
composer.json | 3 +-
composer.lock | 3726 -------------
composer.phar | Bin 1591764 -> 1914314 bytes
...config.php.example => .config.example.php} | 82 +-
config/routes.php | 531 +-
public/assets/fonts/FontAwesome.otf | Bin 124988 -> 0 bytes
.../fonts/font-awesome-4.7.0/HELP-US-OUT.txt | 7 -
.../font-awesome-4.7.0/css/font-awesome.css | 2337 --------
.../css/font-awesome.min.css | 4 -
.../font-awesome-4.7.0/fonts/FontAwesome.otf | Bin 134808 -> 0 bytes
.../fonts/fontawesome-webfont.eot | Bin 165742 -> 0 bytes
.../fonts/fontawesome-webfont.svg | 2671 ---------
.../fonts/fontawesome-webfont.ttf | Bin 165548 -> 0 bytes
.../fonts/fontawesome-webfont.woff | Bin 98024 -> 0 bytes
.../fonts/fontawesome-webfont.woff2 | Bin 77160 -> 0 bytes
.../font-awesome-4.7.0/less/animated.less | 34 -
.../less/bordered-pulled.less | 25 -
.../fonts/font-awesome-4.7.0/less/core.less | 12 -
.../font-awesome-4.7.0/less/fixed-width.less | 6 -
.../font-awesome-4.7.0/less/font-awesome.less | 18 -
.../fonts/font-awesome-4.7.0/less/icons.less | 789 ---
.../fonts/font-awesome-4.7.0/less/larger.less | 13 -
.../fonts/font-awesome-4.7.0/less/list.less | 19 -
.../fonts/font-awesome-4.7.0/less/mixins.less | 60 -
.../fonts/font-awesome-4.7.0/less/path.less | 15 -
.../less/rotated-flipped.less | 20 -
.../less/screen-reader.less | 5 -
.../font-awesome-4.7.0/less/stacked.less | 20 -
.../font-awesome-4.7.0/less/variables.less | 800 ---
.../font-awesome-4.7.0/scss/_animated.scss | 34 -
.../scss/_bordered-pulled.scss | 25 -
.../fonts/font-awesome-4.7.0/scss/_core.scss | 12 -
.../font-awesome-4.7.0/scss/_fixed-width.scss | 6 -
.../fonts/font-awesome-4.7.0/scss/_icons.scss | 789 ---
.../font-awesome-4.7.0/scss/_larger.scss | 13 -
.../fonts/font-awesome-4.7.0/scss/_list.scss | 19 -
.../font-awesome-4.7.0/scss/_mixins.scss | 60 -
.../fonts/font-awesome-4.7.0/scss/_path.scss | 15 -
.../scss/_rotated-flipped.scss | 20 -
.../scss/_screen-reader.scss | 5 -
.../font-awesome-4.7.0/scss/_stacked.scss | 20 -
.../font-awesome-4.7.0/scss/_variables.scss | 800 ---
.../font-awesome-4.7.0/scss/font-awesome.scss | 18 -
public/assets/fonts/fontawesome-webfont.eot | Bin 76518 -> 0 bytes
public/assets/fonts/fontawesome-webfont.svg | 685 ---
public/assets/fonts/fontawesome-webfont.ttf | Bin 152796 -> 0 bytes
public/assets/fonts/fontawesome-webfont.woff | Bin 90412 -> 0 bytes
public/assets/fonts/fontawesome-webfont.woff2 | Bin 71896 -> 0 bytes
public/assets/js/fuck.js | 103 +
public/assets/sass/base/_page.scss | 35 -
public/assets/sass/base/_typography.scss | 183 -
public/assets/sass/components/_box.scss | 26 -
public/assets/sass/components/_button.scss | 80 -
public/assets/sass/components/_form.scss | 253 -
public/assets/sass/components/_icon.scss | 17 -
public/assets/sass/components/_image.scss | 87 -
public/assets/sass/components/_list.scss | 198 -
public/assets/sass/components/_table.scss | 81 -
public/assets/sass/ie9.scss | 48 -
public/assets/sass/layout/_bg.scss | 68 -
public/assets/sass/layout/_footer.scss | 37 -
public/assets/sass/layout/_header.scss | 261 -
public/assets/sass/layout/_main.scss | 102 -
public/assets/sass/layout/_wrapper.scss | 36 -
public/assets/sass/libs/_functions.scss | 34 -
public/assets/sass/libs/_mixins.scss | 398 --
public/assets/sass/libs/_skel.scss | 587 --
public/assets/sass/libs/_vars.scss | 43 -
public/assets/sass/main.scss | 49 -
public/assets/sass/noscript.scss | 19 -
public/favicon.ico | Bin 203086 -> 17382 bytes
public/images/Avatar.jpg | Bin 2593 -> 1411 bytes
public/images/alipay.jpg | Bin 18581 -> 13958 bytes
public/images/authlogo.jpg | Bin 42200 -> 31817 bytes
public/images/c-linux-1.png | Bin 15081 -> 15002 bytes
public/images/c-linux-2.png | Bin 12484 -> 12265 bytes
public/images/c-linux-3.png | Bin 5998 -> 2713 bytes
public/images/c-linux-4.png | Bin 16621 -> 16345 bytes
public/images/c-linux-5.png | Bin 16604 -> 16417 bytes
public/images/c-linux-6.png | Bin 22138 -> 21810 bytes
public/images/c-linux-7.png | Bin 19092 -> 16331 bytes
public/images/c_android_1.jpg | Bin 74689 -> 64061 bytes
public/images/c_android_2.jpg | Bin 41473 -> 34650 bytes
public/images/c_android_3.jpg | Bin 44309 -> 34725 bytes
public/images/c_android_4.jpg | Bin 48643 -> 40118 bytes
public/images/c_android_5.jpg | Bin 49534 -> 41197 bytes
public/images/c_android_6.jpg | Bin 66978 -> 61679 bytes
public/images/c_android_7.jpg | Bin 71600 -> 63770 bytes
public/images/c_android_8.jpg | Bin 50243 -> 41140 bytes
public/images/c_ios_1.jpg | Bin 54247 -> 48838 bytes
public/images/c_ios_2.jpg | Bin 163582 -> 139167 bytes
public/images/c_ios_3.jpg | Bin 179764 -> 160729 bytes
public/images/c_ios_4.jpg | Bin 139375 -> 124135 bytes
public/images/c_mac_1.png | Bin 20520 -> 14444 bytes
public/images/c_mac_2.png | Bin 17390 -> 14934 bytes
public/images/c_mac_3.png | Bin 25155 -> 23850 bytes
public/images/c_mac_4.png | Bin 24166 -> 24001 bytes
public/images/c_mac_5.png | Bin 16885 -> 12506 bytes
public/images/c_mac_6.png | Bin 153088 -> 96821 bytes
public/images/c_mac_7.png | Bin 30126 -> 26563 bytes
public/images/c_win_1.png | Bin 42804 -> 13487 bytes
public/images/c_win_2.png | Bin 53190 -> 17398 bytes
public/images/c_win_3.png | Bin 16280 -> 7649 bytes
public/images/c_win_4.png | Bin 80897 -> 25799 bytes
public/images/c_win_5.png | Bin 36734 -> 14710 bytes
public/images/c_win_6.png | Bin 15906 -> 6675 bytes
public/images/c_win_7.png | Bin 35334 -> 13827 bytes
public/images/c_win_8.png | Bin 46545 -> 19265 bytes
public/images/email_nrcy.jpg | Bin 224666 -> 102804 bytes
public/images/logo_white.png | Bin 0 -> 5589 bytes
public/images/node.gif | Bin 739286 -> 621636 bytes
public/images/prefix/unknown.png | Bin 4089 -> 1551 bytes
public/images/prefix/v2ray.png | Bin 6334 -> 2677 bytes
public/images/prefix/不丹.png | Bin 2964 -> 1632 bytes
public/images/prefix/东帝汶.png | Bin 2265 -> 1169 bytes
public/images/prefix/中国.png | Bin 1947 -> 834 bytes
public/images/prefix/中非.png | Bin 1376 -> 437 bytes
public/images/prefix/丹麦.png | Bin 1202 -> 298 bytes
public/images/prefix/乌克兰.png | Bin 1185 -> 307 bytes
public/images/prefix/乌兹别克斯坦.png | Bin 1540 -> 582 bytes
public/images/prefix/乌干达.png | Bin 1532 -> 549 bytes
public/images/prefix/乌拉圭.png | Bin 1568 -> 602 bytes
public/images/prefix/乍得.png | Bin 1191 -> 267 bytes
public/images/prefix/也门.png | Bin 1190 -> 312 bytes
public/images/prefix/亚美尼亚.png | Bin 1188 -> 312 bytes
public/images/prefix/以色列.png | Bin 1722 -> 645 bytes
public/images/prefix/伊拉克.png | Bin 1211 -> 327 bytes
public/images/prefix/伊朗.png | Bin 1545 -> 564 bytes
public/images/prefix/伯利兹.png | Bin 2623 -> 1042 bytes
public/images/prefix/佛得角.png | Bin 1657 -> 623 bytes
public/images/prefix/俄罗斯.png | Bin 1181 -> 312 bytes
public/images/prefix/保加利亚.png | Bin 1172 -> 311 bytes
public/images/prefix/克罗地亚.png | Bin 1812 -> 791 bytes
public/images/prefix/冈比亚.png | Bin 1197 -> 323 bytes
public/images/prefix/冰岛.png | Bin 1232 -> 316 bytes
public/images/prefix/几内亚比绍.png | Bin 1192 -> 270 bytes
public/images/prefix/列支敦士登.png | Bin 1464 -> 533 bytes
public/images/prefix/刚果.png | Bin 1404 -> 416 bytes
public/images/prefix/刚果(金).png | Bin 1821 -> 863 bytes
public/images/prefix/利比亚.png | Bin 1671 -> 666 bytes
public/images/prefix/利比里亚.png | Bin 1618 -> 670 bytes
public/images/prefix/加拿大.png | Bin 1644 -> 626 bytes
public/images/prefix/加纳.png | Bin 1417 -> 518 bytes
public/images/prefix/加蓬.png | Bin 1176 -> 312 bytes
public/images/prefix/匈牙利.png | Bin 1188 -> 311 bytes
public/images/prefix/南苏丹.png | Bin 1998 -> 943 bytes
public/images/prefix/南非洲.png | Bin 2531 -> 1293 bytes
public/images/prefix/博茨瓦纳.png | Bin 1201 -> 298 bytes
public/images/prefix/卡塔尔.png | Bin 1621 -> 619 bytes
public/images/prefix/卢旺达.png | Bin 1337 -> 383 bytes
public/images/prefix/卢森堡.png | Bin 1189 -> 312 bytes
public/images/prefix/印度.png | Bin 1550 -> 570 bytes
public/images/prefix/印度尼西亚.png | Bin 1181 -> 307 bytes
public/images/prefix/危地马拉.png | Bin 1430 -> 407 bytes
public/images/prefix/厄瓜多尔.png | Bin 1871 -> 839 bytes
public/images/prefix/厄立特里亚.png | Bin 2378 -> 1247 bytes
public/images/prefix/叙利亚.png | Bin 1528 -> 576 bytes
public/images/prefix/古巴.png | Bin 1908 -> 847 bytes
public/images/prefix/台湾.png | Bin 1488 -> 517 bytes
public/images/prefix/吉尔吉斯斯坦.png | Bin 2003 -> 737 bytes
public/images/prefix/吉布提.png | Bin 1879 -> 893 bytes
public/images/prefix/哈萨克斯坦.png | Bin 1666 -> 554 bytes
public/images/prefix/哥伦比亚.png | Bin 1181 -> 314 bytes
public/images/prefix/哥斯达黎加.png | Bin 1203 -> 295 bytes
public/images/prefix/喀麦隆.png | Bin 1473 -> 568 bytes
public/images/prefix/图瓦卢.png | Bin 2079 -> 759 bytes
public/images/prefix/土库曼斯坦.png | Bin 1904 -> 769 bytes
public/images/prefix/土耳其.png | Bin 2112 -> 983 bytes
public/images/prefix/圣卢西亚.png | Bin 2353 -> 1326 bytes
public/images/prefix/圣基茨和尼维斯.png | Bin 2824 -> 1514 bytes
public/images/prefix/圣文森特和格林纳丁斯.png | Bin 1487 -> 498 bytes
public/images/prefix/圣普.png | Bin 1928 -> 942 bytes
public/images/prefix/圣马力诺.png | Bin 3008 -> 1700 bytes
public/images/prefix/圭亚那.png | Bin 2840 -> 1626 bytes
public/images/prefix/坦桑尼亚.png | Bin 2621 -> 1539 bytes
public/images/prefix/埃及.png | Bin 1374 -> 483 bytes
public/images/prefix/埃塞俄比亚.png | Bin 2301 -> 1138 bytes
public/images/prefix/基里巴斯.png | Bin 2835 -> 1382 bytes
public/images/prefix/塔吉克斯坦.png | Bin 1616 -> 667 bytes
public/images/prefix/塞内加尔.png | Bin 1567 -> 655 bytes
public/images/prefix/塞尔维亚.png | Bin 1681 -> 763 bytes
public/images/prefix/塞拉利昂.png | Bin 1190 -> 312 bytes
public/images/prefix/塞浦路斯.png | Bin 1834 -> 800 bytes
public/images/prefix/塞舌尔.png | Bin 2465 -> 1510 bytes
public/images/prefix/墨西哥.png | Bin 1592 -> 624 bytes
public/images/prefix/多哥.png | Bin 1613 -> 669 bytes
public/images/prefix/多米尼克.png | Bin 1820 -> 607 bytes
public/images/prefix/多米尼加.png | Bin 1387 -> 453 bytes
public/images/prefix/奥地利.png | Bin 1185 -> 284 bytes
public/images/prefix/委内瑞拉.png | Bin 1653 -> 688 bytes
public/images/prefix/孟加拉国.png | Bin 1648 -> 534 bytes
public/images/prefix/安巴.png | Bin 2178 -> 1035 bytes
public/images/prefix/安道尔.png | Bin 1189 -> 268 bytes
public/images/prefix/密克罗尼西亚.png | Bin 1500 -> 484 bytes
public/images/prefix/尼加拉瓜.png | Bin 1382 -> 392 bytes
public/images/prefix/尼日利亚.png | Bin 1188 -> 289 bytes
public/images/prefix/尼日尔.png | Bin 1314 -> 378 bytes
public/images/prefix/尼泊尔.png | Bin 1746 -> 728 bytes
public/images/prefix/巴哈马.png | Bin 1733 -> 736 bytes
public/images/prefix/巴基斯坦.png | Bin 2118 -> 955 bytes
public/images/prefix/巴巴多斯.png | Bin 1618 -> 618 bytes
public/images/prefix/巴布亚新几内亚.png | Bin 2589 -> 1501 bytes
public/images/prefix/巴拉圭.png | Bin 1387 -> 419 bytes
public/images/prefix/巴拿马.png | Bin 1638 -> 737 bytes
public/images/prefix/巴林.png | Bin 1663 -> 617 bytes
public/images/prefix/巴西.png | Bin 2994 -> 1404 bytes
public/images/prefix/布基纳法索.png | Bin 1533 -> 624 bytes
public/images/prefix/布隆迪.png | Bin 3049 -> 1618 bytes
public/images/prefix/希腊.png | Bin 1257 -> 329 bytes
public/images/prefix/帕劳.png | Bin 1629 -> 517 bytes
public/images/prefix/德国.png | Bin 1188 -> 311 bytes
public/images/prefix/意大利.png | Bin 1189 -> 267 bytes
public/images/prefix/所罗门岛.png | Bin 2407 -> 1324 bytes
public/images/prefix/拉脱维亚.png | Bin 1186 -> 282 bytes
public/images/prefix/挪威.png | Bin 1242 -> 318 bytes
public/images/prefix/捷克共和国.png | Bin 1716 -> 747 bytes
public/images/prefix/摩尔多瓦.png | Bin 1385 -> 508 bytes
public/images/prefix/摩洛哥.png | Bin 1595 -> 623 bytes
public/images/prefix/摩纳哥.png | Bin 1181 -> 307 bytes
public/images/prefix/文莱.png | Bin 3103 -> 1688 bytes
public/images/prefix/斐济.png | Bin 2115 -> 837 bytes
public/images/prefix/斯威士兰.png | Bin 1805 -> 681 bytes
public/images/prefix/斯洛伐克.png | Bin 1669 -> 702 bytes
public/images/prefix/斯洛文尼亚.png | Bin 1501 -> 539 bytes
public/images/prefix/斯里兰卡.png | Bin 1209 -> 297 bytes
public/images/prefix/新加坡.png | Bin 1719 -> 738 bytes
public/images/prefix/新西兰.png | Bin 2011 -> 736 bytes
public/images/prefix/日本.png | Bin 1521 -> 471 bytes
public/images/prefix/智利.png | Bin 1443 -> 518 bytes
public/images/prefix/朝鲜.png | Bin 1662 -> 651 bytes
public/images/prefix/柬埔寨.png | Bin 1713 -> 680 bytes
public/images/prefix/格林纳达.png | Bin 2342 -> 1041 bytes
public/images/prefix/格鲁吉亚.png | Bin 1473 -> 433 bytes
public/images/prefix/梵蒂冈城.png | Bin 2169 -> 1024 bytes
public/images/prefix/比利时.png | Bin 1191 -> 269 bytes
public/images/prefix/毛里塔尼亚.png | Bin 2052 -> 932 bytes
public/images/prefix/毛里求斯.png | Bin 1196 -> 319 bytes
public/images/prefix/汤加.png | Bin 1322 -> 400 bytes
public/images/prefix/沙特阿拉伯.png | Bin 3804 -> 1852 bytes
public/images/prefix/法国.png | Bin 1189 -> 268 bytes
public/images/prefix/波兰.png | Bin 1165 -> 304 bytes
public/images/prefix/波黑.png | Bin 2451 -> 1259 bytes
public/images/prefix/泰国.png | Bin 1197 -> 297 bytes
public/images/prefix/津巴布韦.png | Bin 1814 -> 822 bytes
public/images/prefix/洪都拉斯.png | Bin 1360 -> 396 bytes
public/images/prefix/海地.png | Bin 1490 -> 471 bytes
public/images/prefix/澳大利亚.png | Bin 2236 -> 893 bytes
public/images/prefix/爱尔兰.png | Bin 1189 -> 268 bytes
public/images/prefix/爱沙尼亚.png | Bin 1187 -> 311 bytes
public/images/prefix/牙买加.png | Bin 2828 -> 1504 bytes
public/images/prefix/特多.png | Bin 2722 -> 1458 bytes
public/images/prefix/玻利维亚.png | Bin 1425 -> 449 bytes
public/images/prefix/瑙鲁.png | Bin 1561 -> 545 bytes
public/images/prefix/瑞典.png | Bin 1211 -> 298 bytes
public/images/prefix/瑞士.png | Bin 1321 -> 354 bytes
public/images/prefix/瓦努阿图.png | Bin 2260 -> 1035 bytes
public/images/prefix/白俄罗斯.png | Bin 1299 -> 372 bytes
public/images/prefix/科威特.png | Bin 1634 -> 685 bytes
public/images/prefix/科摩罗.png | Bin 2630 -> 1411 bytes
public/images/prefix/科特迪瓦.png | Bin 1189 -> 268 bytes
public/images/prefix/科索沃.png | Bin 2119 -> 958 bytes
public/images/prefix/秘鲁.png | Bin 1188 -> 289 bytes
public/images/prefix/突尼斯.png | Bin 2146 -> 925 bytes
public/images/prefix/立陶宛.png | Bin 1178 -> 312 bytes
public/images/prefix/索马里.png | Bin 1585 -> 593 bytes
public/images/prefix/约旦.png | Bin 1845 -> 830 bytes
public/images/prefix/纳米比亚.png | Bin 2780 -> 1628 bytes
public/images/prefix/缅甸.png | Bin 1827 -> 841 bytes
public/images/prefix/罗马尼亚.png | Bin 1195 -> 270 bytes
public/images/prefix/美国.png | Bin 1621 -> 652 bytes
public/images/prefix/老挝.png | Bin 1350 -> 357 bytes
public/images/prefix/肯尼亚.png | Bin 2007 -> 912 bytes
public/images/prefix/芬兰.png | Bin 1211 -> 298 bytes
public/images/prefix/苏丹.png | Bin 1738 -> 766 bytes
public/images/prefix/苏里南.png | Bin 1472 -> 522 bytes
public/images/prefix/英国.png | Bin 3653 -> 1664 bytes
public/images/prefix/荷兰.png | Bin 1189 -> 312 bytes
public/images/prefix/莫桑比克.png | Bin 1727 -> 779 bytes
public/images/prefix/莱索托.png | Bin 1344 -> 441 bytes
public/images/prefix/菲律宾.png | Bin 1812 -> 827 bytes
public/images/prefix/萨尔瓦多.png | Bin 1382 -> 392 bytes
public/images/prefix/萨摩亚.png | Bin 1586 -> 593 bytes
public/images/prefix/葡萄牙.png | Bin 1340 -> 417 bytes
public/images/prefix/蒙古.png | Bin 1343 -> 383 bytes
public/images/prefix/西班牙.png | Bin 1413 -> 459 bytes
public/images/prefix/贝宁.png | Bin 1194 -> 272 bytes
public/images/prefix/赞比亚.png | Bin 1346 -> 458 bytes
public/images/prefix/赤道几内亚.png | Bin 1756 -> 769 bytes
public/images/prefix/越南.png | Bin 1520 -> 567 bytes
public/images/prefix/阿塞拜疆.png | Bin 1639 -> 651 bytes
public/images/prefix/阿富汗.png | Bin 1915 -> 855 bytes
public/images/prefix/阿尔及利亚.png | Bin 2048 -> 1036 bytes
public/images/prefix/阿尔巴尼亚.png | Bin 2599 -> 1225 bytes
public/images/prefix/阿曼.png | Bin 1222 -> 285 bytes
public/images/prefix/阿根廷.png | Bin 1406 -> 442 bytes
public/images/prefix/阿联酋.png | Bin 1201 -> 279 bytes
public/images/prefix/韩国.png | Bin 3275 -> 1732 bytes
public/images/prefix/香港.png | Bin 2079 -> 1570 bytes
public/images/prefix/马其顿.png | Bin 2973 -> 1340 bytes
public/images/prefix/马尔代夫.png | Bin 1636 -> 624 bytes
public/images/prefix/马拉维.png | Bin 1406 -> 439 bytes
public/images/prefix/马来西亚.png | Bin 1828 -> 824 bytes
public/images/prefix/马绍尔群岛.png | Bin 3156 -> 1702 bytes
public/images/prefix/马耳他.png | Bin 1322 -> 403 bytes
public/images/prefix/马达加斯加.png | Bin 1192 -> 271 bytes
public/images/prefix/马里.png | Bin 1191 -> 268 bytes
public/images/prefix/黎巴嫩.png | Bin 1607 -> 597 bytes
public/images/prefix/黑山.png | Bin 1616 -> 677 bytes
public/images/qqpay.jpg | Bin 20281 -> 17092 bytes
public/images/weixin.jpg | Bin 13926 -> 11169 bytes
public/paolu.html | 4692 +---------------
.../material/assets/sass-project/project.scss | 43 -
.../sass-project/templates/_page-picker.scss | 158 -
.../sass-project/templates/_ui-card.scss | 33 -
.../sass-project/templates/_ui-tab.scss | 4 -
.../assets/sass/addons/_material-icons.scss | 9 -
.../material/assets/sass/addons/_waves.scss | 44 -
.../sass/addons/material-icons/_core.scss | 20 -
.../sass/addons/material-icons/_larger.scss | 23 -
.../sass/addons/material-icons/_path.scss | 11 -
.../addons/material-icons/_variables.scss | 3 -
public/theme/material/assets/sass/base.scss | 49 -
.../material/assets/sass/base/_grid.scss | 43 -
.../material/assets/sass/base/_reset.scss | 421 --
.../assets/sass/components/_avatar.scss | 59 -
.../assets/sass/components/_breadcrumb.scss | 26 -
.../assets/sass/components/_button-flat.scss | 22 -
.../assets/sass/components/_button-float.scss | 183 -
.../assets/sass/components/_button.scss | 81 -
.../assets/sass/components/_card.scss | 175 -
.../assets/sass/components/_code.scss | 53 -
.../assets/sass/components/_dropdown.scss | 95 -
.../sass/components/_form-checkbox.scss | 161 -
.../sass/components/_form-floating-label.scss | 60 -
.../assets/sass/components/_form-switch.scss | 96 -
.../sass/components/_form-textarea.scss | 4 -
.../assets/sass/components/_form.scss | 217 -
.../assets/sass/components/_label.scss | 23 -
.../assets/sass/components/_modal.scss | 164 -
.../material/assets/sass/components/_nav.scss | 53 -
.../assets/sass/components/_picker.scss | 298 -
.../sass/components/_progress-circular.scss | 169 -
.../sass/components/_progress-loadbar.scss | 97 -
.../assets/sass/components/_progress.scss | 132 -
.../assets/sass/components/_snackbar.scss | 59 -
.../material/assets/sass/components/_tab.scss | 84 -
.../assets/sass/components/_table.scss | 82 -
.../assets/sass/components/_tile.scss | 156 -
.../assets/sass/elements/_content.scss | 42 -
.../assets/sass/elements/_header.scss | 141 -
.../material/assets/sass/elements/_menu.scss | 267 -
.../material/assets/sass/mixin/_grid.scss | 78 -
.../assets/sass/mixin/_responsive.scss | 32 -
.../assets/sass/mixin/_utilities.scss | 69 -
.../assets/sass/utilities/_print.scss | 95 -
.../sass/utilities/_utilities-responsive.scss | 97 -
.../assets/sass/utilities/_utilities.scss | 393 --
.../material/assets/sass/var/_colours.scss | 336 --
.../material/assets/sass/var/_variables.scss | 78 -
public/theme/material/css/index.css | 1505 +++++
public/theme/material/css/index_base.css | 21 +
public/theme/material/css/project.min.css | 126 +
public/theme/material/css/user.css | 127 -
.../images/screenshots/material01.png | Bin 50808 -> 0 bytes
.../images/screenshots/material02.png | Bin 79459 -> 0 bytes
.../images/screenshots/material03.png | Bin 54431 -> 0 bytes
public/theme/material/js/axios.min.js | 9 +
public/theme/material/js/vue-router.min.js | 6 +
public/theme/material/js/vue.min.js | 6 +
public/theme/material/js/vuex.min.js | 6 +
public/vuedist/css/app.e22b32ba.css | 21 +
public/vuedist/favicon.ico | Bin 0 -> 1150 bytes
public/vuedist/js/app.0fc5420f.js | 2 +
public/vuedist/js/app.0fc5420f.js.map | 1 +
public/vuedist/js/chunk-vendors.0ef9ccce.js | 19 +
.../vuedist/js/chunk-vendors.0ef9ccce.js.map | 1 +
resources/conf/clash.tpl | 1160 ++--
resources/email/newuser.tpl | 182 +
resources/lang/en/auth.php | 7 -
.../material/admin/announcement/create.tpl | 21 +-
resources/views/material/admin/coupon.tpl | 87 +-
resources/views/material/admin/footer.tpl | 15 +-
resources/views/material/admin/index.tpl | 4 +-
resources/views/material/admin/main.tpl | 3 -
.../views/material/admin/node/create.tpl | 2 +
resources/views/material/admin/node/edit.tpl | 4 +-
resources/views/material/admin/user/index.tpl | 56 +-
resources/views/material/admin/yftOrder.tpl | 79 -
resources/views/material/auth/login.tpl | 2 +-
resources/views/material/crisp.tpl | 1 -
resources/views/material/footer.tpl | 13 +
resources/views/material/header.tpl | 6 +-
resources/views/material/index.tpl | 178 +-
resources/views/material/indexold.tpl | 202 +
resources/views/material/mylivechat.tpl | 12 +
resources/views/material/password/reset.tpl | 2 +-
resources/views/material/staff.tpl | 34 +-
.../views/material/user/announcement.tpl | 195 +-
resources/views/material/user/bitpay.tpl | 82 +
resources/views/material/user/chenPay.tpl | 48 +-
resources/views/material/user/code.tpl | 13 +
resources/views/material/user/edit.tpl | 84 +-
resources/views/material/user/footer.tpl | 15 +-
resources/views/material/user/header_info.tpl | 2 +
resources/views/material/user/index.tpl | 151 +-
resources/views/material/user/invite.tpl | 4 +
resources/views/material/user/main.tpl | 33 +-
resources/views/material/user/node.tpl | 51 +-
resources/views/material/user/nodeinfo.tpl | 53 +-
.../views/material/user/ticket_create.tpl | 1 +
resources/views/material/user/ticket_view.tpl | 3 +-
resources/views/material/user/trimepay.tpl | 4 +-
resources/views/material/user/tutorial.tpl | 201 +
resources/views/material/user/yft.tpl | 7 -
resources/views/material/user/yftOrder.tpl | 85 -
sql/glzjin_all.sql | 4 +-
sql/yft_order_info.sql | 35 -
storage/framework/smarty/cache/.gitignore | 2 -
storage/framework/smarty/compile/.gitignore | 2 -
storage/framework/views/.gitignore | 2 -
uim-index-dev/.editorconfig | 5 +
uim-index-dev/.gitignore | 22 +
uim-index-dev/README.md | 85 +
uim-index-dev/babel.config.js | 5 +
uim-index-dev/createIndexTpl.sh | 4 +
uim-index-dev/package.json | 68 +
uim-index-dev/public/favicon.ico | Bin 0 -> 1150 bytes
uim-index-dev/public/index.html | 62 +
uim-index-dev/src/App.vue | 276 +
uim-index-dev/src/assets/logo.png | Bin 0 -> 6849 bytes
uim-index-dev/src/components/anchor.vue | 56 +
uim-index-dev/src/components/checkbox.vue | 77 +
uim-index-dev/src/components/dropdown.vue | 146 +
uim-index-dev/src/components/messager.vue | 48 +
uim-index-dev/src/components/modal.vue | 126 +
uim-index-dev/src/components/pagenation.vue | 131 +
.../src/components/panel/UserAnnouncement.vue | 17 +
.../src/components/panel/UserCharge.vue | 109 +
.../src/components/panel/UserGuide.vue | 930 +++
.../src/components/panel/UserInvite.vue | 529 ++
.../src/components/panel/UserResourse.vue | 214 +
.../src/components/panel/UserSettings.vue | 23 +
.../src/components/panel/UserShop.vue | 286 +
uim-index-dev/src/components/payment/code.vue | 47 +
.../src/components/payment/codepay.vue | 68 +
uim-index-dev/src/components/payment/log.vue | 67 +
.../src/components/payment/trimepay.vue | 207 +
uim-index-dev/src/components/progressbar.vue | 132 +
uim-index-dev/src/components/sign.vue | 264 +
uim-index-dev/src/components/switch.vue | 87 +
uim-index-dev/src/components/table.vue | 40 +
uim-index-dev/src/components/tooltip.vue | 47 +
uim-index-dev/src/css/index.css | 1143 ++++
uim-index-dev/src/css/index_base.css | 21 +
uim-index-dev/src/directives/uimclip.js | 16 +
uim-index-dev/src/js/fetch.js | 75 +
uim-index-dev/src/main.js | 101 +
uim-index-dev/src/mixins/agentMixin.js | 168 +
uim-index-dev/src/mixins/storeAuth.js | 59 +
uim-index-dev/src/mixins/storeMap.js | 78 +
uim-index-dev/src/mixins/userMixin.js | 20 +
uim-index-dev/src/mixins/userSetMixin.js | 8 +
uim-index-dev/src/router.js | 132 +
uim-index-dev/src/store.js | 140 +
uim-index-dev/src/stores/UserStore.js | 153 +
uim-index-dev/src/views/Auth.vue | 82 +
uim-index-dev/src/views/Login.vue | 285 +
uim-index-dev/src/views/Node.vue | 184 +
uim-index-dev/src/views/Panel.vue | 515 ++
uim-index-dev/src/views/Password.vue | 13 +
uim-index-dev/src/views/Register.vue | 267 +
uim-index-dev/src/views/Reset.vue | 75 +
uim-index-dev/src/views/Root.vue | 20 +
uim-index-dev/src/views/User.vue | 13 +
uim-index-dev/vue.config.js | 4 +
626 files changed, 25730 insertions(+), 36080 deletions(-)
create mode 100644 .editorconfig
delete mode 100644 .github/ISSUE_TEMPLATE/new-issue.md
rename .github/{ISSUE_TEMPLATE/issue.md => issue_template.md} (56%)
delete mode 100644 app/Controllers/QuickPayFunction.php
create mode 100644 app/Controllers/VueController.php
delete mode 100644 app/Models/YftOrder.php
create mode 100644 app/Services/BitPayment.php
create mode 100644 app/Services/Gateway/BitPay.php
delete mode 100755 app/Services/Gateway/YftPay.php
delete mode 100644 app/Services/Gateway/YftPayConfig.php
create mode 100644 app/Utils/Discord.php
create mode 100644 composer-setup.php
delete mode 100644 composer.lock
mode change 100644 => 100755 composer.phar
rename config/{.config.php.example => .config.example.php} (81%)
mode change 100755 => 100644
delete mode 100644 public/assets/fonts/FontAwesome.otf
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/HELP-US-OUT.txt
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/css/font-awesome.css
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/css/font-awesome.min.css
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.svg
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/animated.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/bordered-pulled.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/core.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/fixed-width.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/font-awesome.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/icons.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/larger.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/list.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/mixins.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/path.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/rotated-flipped.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/screen-reader.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/stacked.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/less/variables.less
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_animated.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_bordered-pulled.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_core.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_fixed-width.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_icons.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_larger.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_list.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_mixins.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_path.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_rotated-flipped.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_screen-reader.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_stacked.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/_variables.scss
delete mode 100644 public/assets/fonts/font-awesome-4.7.0/scss/font-awesome.scss
delete mode 100644 public/assets/fonts/fontawesome-webfont.eot
delete mode 100644 public/assets/fonts/fontawesome-webfont.svg
delete mode 100644 public/assets/fonts/fontawesome-webfont.ttf
delete mode 100644 public/assets/fonts/fontawesome-webfont.woff
delete mode 100644 public/assets/fonts/fontawesome-webfont.woff2
create mode 100644 public/assets/js/fuck.js
delete mode 100644 public/assets/sass/base/_page.scss
delete mode 100644 public/assets/sass/base/_typography.scss
delete mode 100644 public/assets/sass/components/_box.scss
delete mode 100644 public/assets/sass/components/_button.scss
delete mode 100644 public/assets/sass/components/_form.scss
delete mode 100644 public/assets/sass/components/_icon.scss
delete mode 100644 public/assets/sass/components/_image.scss
delete mode 100644 public/assets/sass/components/_list.scss
delete mode 100644 public/assets/sass/components/_table.scss
delete mode 100644 public/assets/sass/ie9.scss
delete mode 100644 public/assets/sass/layout/_bg.scss
delete mode 100644 public/assets/sass/layout/_footer.scss
delete mode 100644 public/assets/sass/layout/_header.scss
delete mode 100644 public/assets/sass/layout/_main.scss
delete mode 100644 public/assets/sass/layout/_wrapper.scss
delete mode 100644 public/assets/sass/libs/_functions.scss
delete mode 100644 public/assets/sass/libs/_mixins.scss
delete mode 100644 public/assets/sass/libs/_skel.scss
delete mode 100644 public/assets/sass/libs/_vars.scss
delete mode 100644 public/assets/sass/main.scss
delete mode 100644 public/assets/sass/noscript.scss
mode change 100644 => 100755 public/favicon.ico
mode change 100644 => 100755 public/images/authlogo.jpg
mode change 100644 => 100755 public/images/c_win_1.png
mode change 100644 => 100755 public/images/c_win_2.png
mode change 100644 => 100755 public/images/c_win_3.png
mode change 100644 => 100755 public/images/c_win_4.png
mode change 100644 => 100755 public/images/c_win_5.png
mode change 100644 => 100755 public/images/c_win_6.png
mode change 100644 => 100755 public/images/c_win_7.png
mode change 100644 => 100755 public/images/c_win_8.png
mode change 100644 => 100755 public/images/email_nrcy.jpg
create mode 100755 public/images/logo_white.png
mode change 100644 => 100755 public/images/prefix/unknown.png
mode change 100644 => 100755 public/images/prefix/v2ray.png
mode change 100644 => 100755 public/images/prefix/不丹.png
mode change 100644 => 100755 public/images/prefix/东帝汶.png
mode change 100644 => 100755 public/images/prefix/中国.png
mode change 100644 => 100755 public/images/prefix/中非.png
mode change 100644 => 100755 public/images/prefix/丹麦.png
mode change 100644 => 100755 public/images/prefix/乌克兰.png
mode change 100644 => 100755 public/images/prefix/乌兹别克斯坦.png
mode change 100644 => 100755 public/images/prefix/乌干达.png
mode change 100644 => 100755 public/images/prefix/乌拉圭.png
mode change 100644 => 100755 public/images/prefix/乍得.png
mode change 100644 => 100755 public/images/prefix/也门.png
mode change 100644 => 100755 public/images/prefix/亚美尼亚.png
mode change 100644 => 100755 public/images/prefix/以色列.png
mode change 100644 => 100755 public/images/prefix/伊拉克.png
mode change 100644 => 100755 public/images/prefix/伊朗.png
mode change 100644 => 100755 public/images/prefix/伯利兹.png
mode change 100644 => 100755 public/images/prefix/佛得角.png
mode change 100644 => 100755 public/images/prefix/俄罗斯.png
mode change 100644 => 100755 public/images/prefix/保加利亚.png
mode change 100644 => 100755 public/images/prefix/克罗地亚.png
mode change 100644 => 100755 public/images/prefix/冈比亚.png
mode change 100644 => 100755 public/images/prefix/冰岛.png
mode change 100644 => 100755 public/images/prefix/几内亚比绍.png
mode change 100644 => 100755 public/images/prefix/列支敦士登.png
mode change 100644 => 100755 public/images/prefix/刚果.png
mode change 100644 => 100755 public/images/prefix/刚果(金).png
mode change 100644 => 100755 public/images/prefix/利比亚.png
mode change 100644 => 100755 public/images/prefix/利比里亚.png
mode change 100644 => 100755 public/images/prefix/加拿大.png
mode change 100644 => 100755 public/images/prefix/加纳.png
mode change 100644 => 100755 public/images/prefix/加蓬.png
mode change 100644 => 100755 public/images/prefix/匈牙利.png
mode change 100644 => 100755 public/images/prefix/南苏丹.png
mode change 100644 => 100755 public/images/prefix/南非洲.png
mode change 100644 => 100755 public/images/prefix/博茨瓦纳.png
mode change 100644 => 100755 public/images/prefix/卡塔尔.png
mode change 100644 => 100755 public/images/prefix/卢旺达.png
mode change 100644 => 100755 public/images/prefix/卢森堡.png
mode change 100644 => 100755 public/images/prefix/印度.png
mode change 100644 => 100755 public/images/prefix/印度尼西亚.png
mode change 100644 => 100755 public/images/prefix/危地马拉.png
mode change 100644 => 100755 public/images/prefix/厄瓜多尔.png
mode change 100644 => 100755 public/images/prefix/厄立特里亚.png
mode change 100644 => 100755 public/images/prefix/叙利亚.png
mode change 100644 => 100755 public/images/prefix/古巴.png
mode change 100644 => 100755 public/images/prefix/台湾.png
mode change 100644 => 100755 public/images/prefix/吉尔吉斯斯坦.png
mode change 100644 => 100755 public/images/prefix/吉布提.png
mode change 100644 => 100755 public/images/prefix/哈萨克斯坦.png
mode change 100644 => 100755 public/images/prefix/哥伦比亚.png
mode change 100644 => 100755 public/images/prefix/哥斯达黎加.png
mode change 100644 => 100755 public/images/prefix/喀麦隆.png
mode change 100644 => 100755 public/images/prefix/图瓦卢.png
mode change 100644 => 100755 public/images/prefix/土库曼斯坦.png
mode change 100644 => 100755 public/images/prefix/土耳其.png
mode change 100644 => 100755 public/images/prefix/圣卢西亚.png
mode change 100644 => 100755 public/images/prefix/圣基茨和尼维斯.png
mode change 100644 => 100755 public/images/prefix/圣文森特和格林纳丁斯.png
mode change 100644 => 100755 public/images/prefix/圣普.png
mode change 100644 => 100755 public/images/prefix/圣马力诺.png
mode change 100644 => 100755 public/images/prefix/圭亚那.png
mode change 100644 => 100755 public/images/prefix/坦桑尼亚.png
mode change 100644 => 100755 public/images/prefix/埃及.png
mode change 100644 => 100755 public/images/prefix/埃塞俄比亚.png
mode change 100644 => 100755 public/images/prefix/基里巴斯.png
mode change 100644 => 100755 public/images/prefix/塔吉克斯坦.png
mode change 100644 => 100755 public/images/prefix/塞内加尔.png
mode change 100644 => 100755 public/images/prefix/塞尔维亚.png
mode change 100644 => 100755 public/images/prefix/塞拉利昂.png
mode change 100644 => 100755 public/images/prefix/塞浦路斯.png
mode change 100644 => 100755 public/images/prefix/塞舌尔.png
mode change 100644 => 100755 public/images/prefix/墨西哥.png
mode change 100644 => 100755 public/images/prefix/多哥.png
mode change 100644 => 100755 public/images/prefix/多米尼克.png
mode change 100644 => 100755 public/images/prefix/多米尼加.png
mode change 100644 => 100755 public/images/prefix/奥地利.png
mode change 100644 => 100755 public/images/prefix/委内瑞拉.png
mode change 100644 => 100755 public/images/prefix/孟加拉国.png
mode change 100644 => 100755 public/images/prefix/安巴.png
mode change 100644 => 100755 public/images/prefix/安道尔.png
mode change 100644 => 100755 public/images/prefix/密克罗尼西亚.png
mode change 100644 => 100755 public/images/prefix/尼加拉瓜.png
mode change 100644 => 100755 public/images/prefix/尼日利亚.png
mode change 100644 => 100755 public/images/prefix/尼日尔.png
mode change 100644 => 100755 public/images/prefix/尼泊尔.png
mode change 100644 => 100755 public/images/prefix/巴哈马.png
mode change 100644 => 100755 public/images/prefix/巴基斯坦.png
mode change 100644 => 100755 public/images/prefix/巴巴多斯.png
mode change 100644 => 100755 public/images/prefix/巴布亚新几内亚.png
mode change 100644 => 100755 public/images/prefix/巴拉圭.png
mode change 100644 => 100755 public/images/prefix/巴拿马.png
mode change 100644 => 100755 public/images/prefix/巴林.png
mode change 100644 => 100755 public/images/prefix/巴西.png
mode change 100644 => 100755 public/images/prefix/布基纳法索.png
mode change 100644 => 100755 public/images/prefix/布隆迪.png
mode change 100644 => 100755 public/images/prefix/希腊.png
mode change 100644 => 100755 public/images/prefix/帕劳.png
mode change 100644 => 100755 public/images/prefix/德国.png
mode change 100644 => 100755 public/images/prefix/意大利.png
mode change 100644 => 100755 public/images/prefix/所罗门岛.png
mode change 100644 => 100755 public/images/prefix/拉脱维亚.png
mode change 100644 => 100755 public/images/prefix/挪威.png
mode change 100644 => 100755 public/images/prefix/捷克共和国.png
mode change 100644 => 100755 public/images/prefix/摩尔多瓦.png
mode change 100644 => 100755 public/images/prefix/摩洛哥.png
mode change 100644 => 100755 public/images/prefix/摩纳哥.png
mode change 100644 => 100755 public/images/prefix/文莱.png
mode change 100644 => 100755 public/images/prefix/斐济.png
mode change 100644 => 100755 public/images/prefix/斯威士兰.png
mode change 100644 => 100755 public/images/prefix/斯洛伐克.png
mode change 100644 => 100755 public/images/prefix/斯洛文尼亚.png
mode change 100644 => 100755 public/images/prefix/斯里兰卡.png
mode change 100644 => 100755 public/images/prefix/新加坡.png
mode change 100644 => 100755 public/images/prefix/新西兰.png
mode change 100644 => 100755 public/images/prefix/日本.png
mode change 100644 => 100755 public/images/prefix/智利.png
mode change 100644 => 100755 public/images/prefix/朝鲜.png
mode change 100644 => 100755 public/images/prefix/柬埔寨.png
mode change 100644 => 100755 public/images/prefix/格林纳达.png
mode change 100644 => 100755 public/images/prefix/格鲁吉亚.png
mode change 100644 => 100755 public/images/prefix/梵蒂冈城.png
mode change 100644 => 100755 public/images/prefix/比利时.png
mode change 100644 => 100755 public/images/prefix/毛里塔尼亚.png
mode change 100644 => 100755 public/images/prefix/毛里求斯.png
mode change 100644 => 100755 public/images/prefix/汤加.png
mode change 100644 => 100755 public/images/prefix/沙特阿拉伯.png
mode change 100644 => 100755 public/images/prefix/法国.png
mode change 100644 => 100755 public/images/prefix/波兰.png
mode change 100644 => 100755 public/images/prefix/波黑.png
mode change 100644 => 100755 public/images/prefix/泰国.png
mode change 100644 => 100755 public/images/prefix/津巴布韦.png
mode change 100644 => 100755 public/images/prefix/洪都拉斯.png
mode change 100644 => 100755 public/images/prefix/海地.png
mode change 100644 => 100755 public/images/prefix/澳大利亚.png
mode change 100644 => 100755 public/images/prefix/爱尔兰.png
mode change 100644 => 100755 public/images/prefix/爱沙尼亚.png
mode change 100644 => 100755 public/images/prefix/牙买加.png
mode change 100644 => 100755 public/images/prefix/特多.png
mode change 100644 => 100755 public/images/prefix/玻利维亚.png
mode change 100644 => 100755 public/images/prefix/瑙鲁.png
mode change 100644 => 100755 public/images/prefix/瑞典.png
mode change 100644 => 100755 public/images/prefix/瑞士.png
mode change 100644 => 100755 public/images/prefix/瓦努阿图.png
mode change 100644 => 100755 public/images/prefix/白俄罗斯.png
mode change 100644 => 100755 public/images/prefix/科威特.png
mode change 100644 => 100755 public/images/prefix/科摩罗.png
mode change 100644 => 100755 public/images/prefix/科特迪瓦.png
mode change 100644 => 100755 public/images/prefix/科索沃.png
mode change 100644 => 100755 public/images/prefix/秘鲁.png
mode change 100644 => 100755 public/images/prefix/突尼斯.png
mode change 100644 => 100755 public/images/prefix/立陶宛.png
mode change 100644 => 100755 public/images/prefix/索马里.png
mode change 100644 => 100755 public/images/prefix/约旦.png
mode change 100644 => 100755 public/images/prefix/纳米比亚.png
mode change 100644 => 100755 public/images/prefix/缅甸.png
mode change 100644 => 100755 public/images/prefix/罗马尼亚.png
mode change 100644 => 100755 public/images/prefix/美国.png
mode change 100644 => 100755 public/images/prefix/老挝.png
mode change 100644 => 100755 public/images/prefix/肯尼亚.png
mode change 100644 => 100755 public/images/prefix/芬兰.png
mode change 100644 => 100755 public/images/prefix/苏丹.png
mode change 100644 => 100755 public/images/prefix/苏里南.png
mode change 100644 => 100755 public/images/prefix/英国.png
mode change 100644 => 100755 public/images/prefix/荷兰.png
mode change 100644 => 100755 public/images/prefix/莫桑比克.png
mode change 100644 => 100755 public/images/prefix/莱索托.png
mode change 100644 => 100755 public/images/prefix/菲律宾.png
mode change 100644 => 100755 public/images/prefix/萨尔瓦多.png
mode change 100644 => 100755 public/images/prefix/萨摩亚.png
mode change 100644 => 100755 public/images/prefix/葡萄牙.png
mode change 100644 => 100755 public/images/prefix/蒙古.png
mode change 100644 => 100755 public/images/prefix/西班牙.png
mode change 100644 => 100755 public/images/prefix/贝宁.png
mode change 100644 => 100755 public/images/prefix/赞比亚.png
mode change 100644 => 100755 public/images/prefix/赤道几内亚.png
mode change 100644 => 100755 public/images/prefix/越南.png
mode change 100644 => 100755 public/images/prefix/阿塞拜疆.png
mode change 100644 => 100755 public/images/prefix/阿富汗.png
mode change 100644 => 100755 public/images/prefix/阿尔及利亚.png
mode change 100644 => 100755 public/images/prefix/阿尔巴尼亚.png
mode change 100644 => 100755 public/images/prefix/阿曼.png
mode change 100644 => 100755 public/images/prefix/阿根廷.png
mode change 100644 => 100755 public/images/prefix/阿联酋.png
mode change 100644 => 100755 public/images/prefix/韩国.png
mode change 100644 => 100755 public/images/prefix/香港.png
mode change 100644 => 100755 public/images/prefix/马其顿.png
mode change 100644 => 100755 public/images/prefix/马尔代夫.png
mode change 100644 => 100755 public/images/prefix/马拉维.png
mode change 100644 => 100755 public/images/prefix/马来西亚.png
mode change 100644 => 100755 public/images/prefix/马绍尔群岛.png
mode change 100644 => 100755 public/images/prefix/马耳他.png
mode change 100644 => 100755 public/images/prefix/马达加斯加.png
mode change 100644 => 100755 public/images/prefix/马里.png
mode change 100644 => 100755 public/images/prefix/黎巴嫩.png
mode change 100644 => 100755 public/images/prefix/黑山.png
delete mode 100644 public/theme/material/assets/sass-project/project.scss
delete mode 100644 public/theme/material/assets/sass-project/templates/_page-picker.scss
delete mode 100644 public/theme/material/assets/sass-project/templates/_ui-card.scss
delete mode 100644 public/theme/material/assets/sass-project/templates/_ui-tab.scss
delete mode 100644 public/theme/material/assets/sass/addons/_material-icons.scss
delete mode 100644 public/theme/material/assets/sass/addons/_waves.scss
delete mode 100644 public/theme/material/assets/sass/addons/material-icons/_core.scss
delete mode 100644 public/theme/material/assets/sass/addons/material-icons/_larger.scss
delete mode 100644 public/theme/material/assets/sass/addons/material-icons/_path.scss
delete mode 100644 public/theme/material/assets/sass/addons/material-icons/_variables.scss
delete mode 100644 public/theme/material/assets/sass/base.scss
delete mode 100644 public/theme/material/assets/sass/base/_grid.scss
delete mode 100644 public/theme/material/assets/sass/base/_reset.scss
delete mode 100644 public/theme/material/assets/sass/components/_avatar.scss
delete mode 100644 public/theme/material/assets/sass/components/_breadcrumb.scss
delete mode 100644 public/theme/material/assets/sass/components/_button-flat.scss
delete mode 100644 public/theme/material/assets/sass/components/_button-float.scss
delete mode 100644 public/theme/material/assets/sass/components/_button.scss
delete mode 100644 public/theme/material/assets/sass/components/_card.scss
delete mode 100644 public/theme/material/assets/sass/components/_code.scss
delete mode 100644 public/theme/material/assets/sass/components/_dropdown.scss
delete mode 100644 public/theme/material/assets/sass/components/_form-checkbox.scss
delete mode 100644 public/theme/material/assets/sass/components/_form-floating-label.scss
delete mode 100644 public/theme/material/assets/sass/components/_form-switch.scss
delete mode 100644 public/theme/material/assets/sass/components/_form-textarea.scss
delete mode 100644 public/theme/material/assets/sass/components/_form.scss
delete mode 100644 public/theme/material/assets/sass/components/_label.scss
delete mode 100644 public/theme/material/assets/sass/components/_modal.scss
delete mode 100644 public/theme/material/assets/sass/components/_nav.scss
delete mode 100644 public/theme/material/assets/sass/components/_picker.scss
delete mode 100644 public/theme/material/assets/sass/components/_progress-circular.scss
delete mode 100644 public/theme/material/assets/sass/components/_progress-loadbar.scss
delete mode 100644 public/theme/material/assets/sass/components/_progress.scss
delete mode 100644 public/theme/material/assets/sass/components/_snackbar.scss
delete mode 100644 public/theme/material/assets/sass/components/_tab.scss
delete mode 100644 public/theme/material/assets/sass/components/_table.scss
delete mode 100644 public/theme/material/assets/sass/components/_tile.scss
delete mode 100644 public/theme/material/assets/sass/elements/_content.scss
delete mode 100644 public/theme/material/assets/sass/elements/_header.scss
delete mode 100644 public/theme/material/assets/sass/elements/_menu.scss
delete mode 100644 public/theme/material/assets/sass/mixin/_grid.scss
delete mode 100644 public/theme/material/assets/sass/mixin/_responsive.scss
delete mode 100644 public/theme/material/assets/sass/mixin/_utilities.scss
delete mode 100644 public/theme/material/assets/sass/utilities/_print.scss
delete mode 100644 public/theme/material/assets/sass/utilities/_utilities-responsive.scss
delete mode 100644 public/theme/material/assets/sass/utilities/_utilities.scss
delete mode 100644 public/theme/material/assets/sass/var/_colours.scss
delete mode 100644 public/theme/material/assets/sass/var/_variables.scss
create mode 100755 public/theme/material/css/index.css
create mode 100644 public/theme/material/css/index_base.css
delete mode 100644 public/theme/material/images/screenshots/material01.png
delete mode 100644 public/theme/material/images/screenshots/material02.png
delete mode 100644 public/theme/material/images/screenshots/material03.png
create mode 100644 public/theme/material/js/axios.min.js
create mode 100644 public/theme/material/js/vue-router.min.js
create mode 100644 public/theme/material/js/vue.min.js
create mode 100644 public/theme/material/js/vuex.min.js
create mode 100644 public/vuedist/css/app.e22b32ba.css
create mode 100644 public/vuedist/favicon.ico
create mode 100644 public/vuedist/js/app.0fc5420f.js
create mode 100644 public/vuedist/js/app.0fc5420f.js.map
create mode 100644 public/vuedist/js/chunk-vendors.0ef9ccce.js
create mode 100644 public/vuedist/js/chunk-vendors.0ef9ccce.js.map
create mode 100644 resources/email/newuser.tpl
delete mode 100644 resources/lang/en/auth.php
delete mode 100644 resources/views/material/admin/yftOrder.tpl
delete mode 100644 resources/views/material/crisp.tpl
mode change 100644 => 100755 resources/views/material/index.tpl
create mode 100644 resources/views/material/indexold.tpl
create mode 100644 resources/views/material/mylivechat.tpl
create mode 100644 resources/views/material/user/bitpay.tpl
create mode 100644 resources/views/material/user/tutorial.tpl
delete mode 100644 resources/views/material/user/yft.tpl
delete mode 100644 resources/views/material/user/yftOrder.tpl
delete mode 100644 sql/yft_order_info.sql
delete mode 100644 storage/framework/smarty/cache/.gitignore
delete mode 100644 storage/framework/smarty/compile/.gitignore
delete mode 100644 storage/framework/views/.gitignore
create mode 100644 uim-index-dev/.editorconfig
create mode 100644 uim-index-dev/.gitignore
create mode 100644 uim-index-dev/README.md
create mode 100644 uim-index-dev/babel.config.js
create mode 100644 uim-index-dev/createIndexTpl.sh
create mode 100644 uim-index-dev/package.json
create mode 100644 uim-index-dev/public/favicon.ico
create mode 100644 uim-index-dev/public/index.html
create mode 100644 uim-index-dev/src/App.vue
create mode 100644 uim-index-dev/src/assets/logo.png
create mode 100644 uim-index-dev/src/components/anchor.vue
create mode 100644 uim-index-dev/src/components/checkbox.vue
create mode 100644 uim-index-dev/src/components/dropdown.vue
create mode 100644 uim-index-dev/src/components/messager.vue
create mode 100644 uim-index-dev/src/components/modal.vue
create mode 100644 uim-index-dev/src/components/pagenation.vue
create mode 100644 uim-index-dev/src/components/panel/UserAnnouncement.vue
create mode 100644 uim-index-dev/src/components/panel/UserCharge.vue
create mode 100644 uim-index-dev/src/components/panel/UserGuide.vue
create mode 100644 uim-index-dev/src/components/panel/UserInvite.vue
create mode 100644 uim-index-dev/src/components/panel/UserResourse.vue
create mode 100644 uim-index-dev/src/components/panel/UserSettings.vue
create mode 100644 uim-index-dev/src/components/panel/UserShop.vue
create mode 100644 uim-index-dev/src/components/payment/code.vue
create mode 100644 uim-index-dev/src/components/payment/codepay.vue
create mode 100644 uim-index-dev/src/components/payment/log.vue
create mode 100644 uim-index-dev/src/components/payment/trimepay.vue
create mode 100644 uim-index-dev/src/components/progressbar.vue
create mode 100644 uim-index-dev/src/components/sign.vue
create mode 100644 uim-index-dev/src/components/switch.vue
create mode 100644 uim-index-dev/src/components/table.vue
create mode 100644 uim-index-dev/src/components/tooltip.vue
create mode 100644 uim-index-dev/src/css/index.css
create mode 100644 uim-index-dev/src/css/index_base.css
create mode 100644 uim-index-dev/src/directives/uimclip.js
create mode 100644 uim-index-dev/src/js/fetch.js
create mode 100644 uim-index-dev/src/main.js
create mode 100644 uim-index-dev/src/mixins/agentMixin.js
create mode 100644 uim-index-dev/src/mixins/storeAuth.js
create mode 100644 uim-index-dev/src/mixins/storeMap.js
create mode 100644 uim-index-dev/src/mixins/userMixin.js
create mode 100644 uim-index-dev/src/mixins/userSetMixin.js
create mode 100644 uim-index-dev/src/router.js
create mode 100644 uim-index-dev/src/store.js
create mode 100644 uim-index-dev/src/stores/UserStore.js
create mode 100644 uim-index-dev/src/views/Auth.vue
create mode 100644 uim-index-dev/src/views/Login.vue
create mode 100644 uim-index-dev/src/views/Node.vue
create mode 100644 uim-index-dev/src/views/Panel.vue
create mode 100644 uim-index-dev/src/views/Password.vue
create mode 100644 uim-index-dev/src/views/Register.vue
create mode 100644 uim-index-dev/src/views/Reset.vue
create mode 100644 uim-index-dev/src/views/Root.vue
create mode 100644 uim-index-dev/src/views/User.vue
create mode 100644 uim-index-dev/vue.config.js
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..cf588355
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,22 @@
+# https://editorconfig.org/
+
+root = true
+
+[*]
+tab_width = 4
+
+[*.php]
+charset = utf-8
+end_of_line = lf
+indent_size = 4
+indent_style = space
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+charset = utf-8
+end_of_line = lf
+indent_style = space
+trim_trailing_whitespace = true
+insert_final_newline = true
+max_line_length = 80
diff --git a/.github/ISSUE_TEMPLATE/new-issue.md b/.github/ISSUE_TEMPLATE/new-issue.md
deleted file mode 100644
index d1d703f5..00000000
--- a/.github/ISSUE_TEMPLATE/new-issue.md
+++ /dev/null
@@ -1,47 +0,0 @@
----
-name: New Issue
-about: Issue
-
----
-
-
-
-
-
-**我确认我已经阅读了** (使用 "x" 选择)
-
-- [ ] [项目 Wiki ](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki)
-- [ ] [项目其他 issue](https://github.com/NimaQu/ss-panel-v3-mod_Uim/issues?utf8=%E2%9C%93&q=is%3Aissue)
-
-**我确认我做到了** (使用 "x" 选择)
-
-- [ ] [将项目升级到当前分支最新版本](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC)
-- [ ] 在[项目演示站](https://demo.nimaqu.com)成功复现问题
-
-**我正在申请** (使用 "x" 选择)
-
-- [ ] 反馈一个 bug
-- [ ] 申请添加新的特性或功能或者好的想法
-
-
-
-
-
-**反馈BUG**
-
-1.请在面板路径下运行`git show HEAD`,然后贴出输出内容
-
-2.如果是页面问题(500 或 Slim Application Error ),请在 config 开启 debug 模式后截图或贴出输出内容,如果是某个按钮点击没反应,请打开浏览器开发者控制台(通常为 F12 ) ,贴出 console 输出内容
-
-
-
-**申请添加新的特性或功能或者好的想法**
diff --git a/.github/ISSUE_TEMPLATE/issue.md b/.github/issue_template.md
similarity index 56%
rename from .github/ISSUE_TEMPLATE/issue.md
rename to .github/issue_template.md
index db59a512..5ec54e57 100644
--- a/.github/ISSUE_TEMPLATE/issue.md
+++ b/.github/issue_template.md
@@ -6,23 +6,28 @@ about: temlpate
**我确认我已经阅读了** (使用 "x" 选择)
-- [ ] [项目 Wiki ](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki)
-- [ ] [项目其他 issue](https://github.com/NimaQu/ss-panel-v3-mod_Uim/issues?utf8=%E2%9C%93&q=is%3Aissue)
+- [ ] [项目 Wiki ](https://github.com/Anankke/ss-panel-v3-mod_Uim/wiki)
+- [ ] [项目其他 issue](https://github.com/Anankke/ss-panel-v3-mod_Uim/issues?utf8=%E2%9C%93&q=is%3Aissue)
**我确认我做到了** (使用 "x" 选择)
-- [ ] [将项目升级到当前分支最新版本](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC)
+- [ ] [将项目升级到当前分支最新版本](https://github.com/Anankke/ss-panel-v3-mod_Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC)
- [ ] 在[项目演示站](https://demo.nimaqu.com)成功复现问题
**我正在申请** (使用 "x" 选择)
@@ -31,15 +36,14 @@ about: temlpate
- [ ] 申请添加新的特性或功能或者好的想法
-
-
+
+-->
-**申请添加新的特性或功能或者好的想法**
+
diff --git a/.gitignore b/.gitignore
index 5e460428..bdf4838f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,10 +8,9 @@ index.html
public/ssr-download/
public/images/*.*
public/theme/material/css/images/bg
-storage/trimepay_notify.log
-storage/traffic_notified/
+storage
.idea
-storage/qqwry.*
.vs/
.htaccess
-php_errors.log
\ No newline at end of file
+php_errors.log
+composer.lock
diff --git a/.travis.yml b/.travis.yml
index 805dc3fe..94c20f7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,6 @@
language: php
php:
- # - '5.4'
- # - '5.6'
- - '7.1'
+ - 7.1
sudo: enabled
dist: xenial
before_install:
@@ -14,20 +12,26 @@ before_install:
- sudo sed -i 's|http://us-central1.gce.archive.ubuntu.com|https://ubuntu.mirror.noc.one|g' /etc/apt/sources.list
- sudo sed -i 's|http://ppa.launchpad.net|https://launchpad.proxy.noc.one|g' /etc/apt/sources.list.d/*.list
- curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
- - sudo apt upgrade
+ - sudo apt clean all && sudo apt -qq -y update
- sudo apt install -y nodejs
- - composer config -g repos.packagist composer https://packagist.noc.one
install:
- sudo chmod -R 755 *
- - echo "==========================================================="
- - echo "Comoposer install"
- - echo "==========================================================="
- php composer.phar install
+ - cd uim-index-dev
+ - npm i
before_script:
- npm i -g phplint
+ - cd ..
script:
- - cp config/.config.php.example config/.config.php
+ - cp config/.config.example.php config/.config.php
- phplint '**/*.php' '!vendor/**'
- php xcat initdownload
- php xcat initQQWry
- php xcat update
+ - cd uim-index-dev
+ - npm run lint
+ - npm run build
+cache:
+ directories:
+ - uim-index-dev/node_modules
+ - $HOME/.composer/cache/files
diff --git a/README.md b/README.md
index 46ce5883..57800887 100644
--- a/README.md
+++ b/README.md
@@ -3,24 +3,26 @@
**ss-panel-v3-mod**是一款专为shadowsocks设计的web前端面板,再次感谢ss-panel-v3-mod 的制作者,修改后的功能简介:
-- **支付系统集成**:集成 支付宝当面付 易付通 码支付 TrimePay 等多种支付系统,使用方法见项目[wiki](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/)
+- **支付系统集成**:集成 支付宝当面付 易付通 码支付 TrimePay 等多种支付系统,使用方法见项目[wiki](https://github.com/Anankke/ss-panel-v3-mod_Uim/wiki/)
- **UI** :修改为 ~~援交~~ 圆角、并自定义了几个图标的显示,节点列表等級0可见等級1节点但无法看见节点详情,增加了国家图标显示
- **商店**:商品增加同时连接设备数,用户限速属性
- 从肥羊那里**抄**来的:新用户注册现金奖励|高等级节点体验|设备数量限制
- **优化**:css和js等置入本地提升加载速度
-- 增加**v2Ray** 功能,详情请看 [wiki](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/v2ray-%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B)
+- 增加**v2Ray** 功能,详情请看 wiki: [Indexyz 版](https://github.com/Anankke/ss-panel-v3-mod_Uim/wiki/v2ray---indexyz-%E7%89%88%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B) | [Rico 版](https://github.com/Anankke/ss-panel-v3-mod_Uim/wiki/v2ray---Rico-%E7%89%88%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B)
-Telegram 频道 :https://t.me/sspanel_Uim
+Telegram 频道 :https://t.me/sspanel_Uim
-演示站: [demo.nimaqu.com](https://demo.nimaqu.com) 账号和密码都是 admin 对接节点的 mukey=NimaQu
+Telegram ~~可能是个官方~~水群 :https://t.me/SSUnion
+
+演示站: [sspanel.host](https://sspanel.host) 账号和密码都是 admin 对接节点的 mukey=NimaQu
**原作者** [galaxychuck](https://github.com/galaxychuck)
-[支持开发者请点我](https://github.com/NimaQu/ss-panel-v3-mod_UIM#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
+[支持开发者请点我](https://github.com/Anankke/ss-panel-v3-mod_Uim#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
## 搭建教程
-GitHub Wiki : https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%89%8D%E7%AB%AF%E5%AE%89%E8%A3%85
+GitHub Wiki : https://github.com/Anankke/ss-panel-v3-mod_Uim/wiki/%E5%89%8D%E7%AB%AF%E5%AE%89%E8%A3%85
Wiki已经启用,欢迎为此面板维护wiki
@@ -67,8 +69,6 @@ Wiki已经启用,欢迎为此面板维护wiki
[**CGDF**](https://github.com/CGDF-GitHub)
-- 一键国旗
-- 财务报表
- xcat一键update
- 适配SSD
- 用户列表分页加载
@@ -89,11 +89,13 @@ Wiki已经启用,欢迎为此面板维护wiki
您对我们的帮助将是支持我们做下去的动力,只需您在购买部分产品或向他人推荐产品时从我们的返利链接购买,这就是对我们很大的支持了。~~没有钱了,肯定要做啊,不做没有钱用啊,打工是不可能打工的,这辈子不可能打工的~~
-##### dumplin
+##### Anankke
-- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
+- [Anankke 很可爱请给 Anankke 钱](https://t.me/anankke/5)
+##### dumplin
+- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
##### galaxychuck
@@ -101,8 +103,10 @@ Wiki已经启用,欢迎为此面板维护wiki
- [冲上云霄云主机](http://console.soar-clouds.com/aff.php?aff=94)
- [Vultr](https://www.vultr.com/?ref=7205737)
-[Nymph 的前端课程报名](t.me/kinokonominoco)
+[laurieryayoi 的前端课程报名](https://t.me/kinokonominoco)
+
+
-# 免责声明
+## 免责声明
-本程序由 MIT License 授权。**不提供任何担保**。使用本程序即表明,您知情并同意:程序开发者不对此程序导致的任何服务中断、数据损失或任何少见未列出的事故负责。
\ No newline at end of file
+本程序由 MIT License 授权。**不提供任何担保**。使用本程序即表明,您知情并同意:程序开发者不对此程序导致的任何服务中断、数据损失或任何少见未列出的事故负责。
diff --git a/app/Command/DailyMail.php b/app/Command/DailyMail.php
index ad8e76c7..fa6f7d98 100644
--- a/app/Command/DailyMail.php
+++ b/app/Command/DailyMail.php
@@ -10,6 +10,7 @@ use App\Services\Mail;
use App\Utils\Telegram;
use App\Utils\Tools;
use App\Services\Analytics;
+use Exception;
class DailyMail
{
@@ -17,46 +18,45 @@ class DailyMail
{
$users = User::all();
$logs = Ann::orderBy('id', 'desc')->get();
- $text1="";
-
+ $text1 = '';
+
foreach ($logs as $log) {
- if (strpos($log->content, "Links")===false) {
- $text1=$text1.$log->content."
";
+ if (strpos($log->content, 'Links') === false) {
+ $text1 = $text1 . $log->content . '
';
}
}
-
+
$lastday_total = 0;
-
+
foreach ($users as $user) {
- $lastday = (($user->u+$user->d)-$user->last_day_t)/1024/1024;
- $lastday_total += (($user->u+$user->d)-$user->last_day_t);
-
- if ($user->sendDailyMail==1) {
- echo "Send daily mail to user: ".$user->id;
- $subject = Config::get('appName')."-每日流量报告以及公告";
+ $lastday = (($user->u + $user->d) - $user->last_day_t) / 1024 / 1024;
+ $lastday_total += (($user->u + $user->d) - $user->last_day_t);
+
+ if ($user->sendDailyMail == 1) {
+ echo 'Send daily mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-每日流量报告以及公告';
$to = $user->email;
- $text = "下面是系统中目前的公告:
".$text1."
晚安!";
-
+ $text = '下面是系统中目前的公告:
' . $text1 . '
晚安!';
+
try {
Mail::send($to, $subject, 'news/daily-traffic-report.tpl', [
- "user" => $user,"text" => $text,"lastday"=>$lastday
+ 'user' => $user, 'text' => $text, 'lastday' => $lastday
], [
]);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
- $text="";
+ $text = '';
}
}
-
+
$sts = new Analytics();
-
- Telegram::Send("各位老爷少奶奶,我来为大家报告一下系统今天的运行状况哈~".
- PHP_EOL.
- "今日签到人数:".$sts->getTodayCheckinUser().PHP_EOL.
- "今日使用总流量:".Tools::flowAutoShow($lastday_total).PHP_EOL.
- "晚安~"
- );
+
+ Telegram::Send('各位老爷少奶奶,我来为大家报告一下系统今天的运行状况哈~' .
+ PHP_EOL .
+ '今日签到人数:' . $sts->getTodayCheckinUser() . PHP_EOL .
+ '今日使用总流量:' . Tools::flowAutoShow($lastday_total) . PHP_EOL .
+ '晚安~');
}
@@ -64,7 +64,7 @@ class DailyMail
{
$users = User::all();
foreach ($users as $user) {
- $user->last_day_t=($user->u+$user->d);
+ $user->last_day_t = ($user->u + $user->d);
$user->save();
}
}
diff --git a/app/Command/ExtMail.php b/app/Command/ExtMail.php
index a9fbd9be..1f38d3e5 100644
--- a/app/Command/ExtMail.php
+++ b/app/Command/ExtMail.php
@@ -6,6 +6,7 @@ namespace App\Command;
use App\Models\User;
use App\Services\Config;
use App\Services\Mail;
+use Exception;
class ExtMail
{
@@ -13,17 +14,17 @@ class ExtMail
{
$users = User::all();
foreach ($users as $user) {
- if ($user->t==0) {
- echo "Send daily mail to user: ".$user->id;
- $subject = Config::get('appName')."-期待您的回归";
+ if ($user->t == 0) {
+ echo 'Send daily mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-期待您的回归';
$to = $user->email;
- $text = "似乎您在".Config::get('appName')."上的流量一直是 0 呢(P.S:也可能是您没有使用 ss 而使用了其他还不能计入流量的方式....),如果您在使用上遇到了任何困难,请不要犹豫,登录到".Config::get('appName').",您就会知道如何使用了,特别是对于 iOS 用户,最近在使用的优化上大家都付出了很多的努力。期待您的回归~" ;
+ $text = '似乎您在' . Config::get('appName') . '上的流量一直是 0 呢(P.S:也可能是您没有使用 ss 而使用了其他还不能计入流量的方式....),如果您在使用上遇到了任何困难,请不要犹豫,登录到' . Config::get('appName') . ',您就会知道如何使用了,特别是对于 iOS 用户,最近在使用的优化上大家都付出了很多的努力。期待您的回归~';
try {
Mail::send($to, $subject, 'ext/back.tpl', [
- "user" => $user,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
+ 'user' => $user, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
echo $e->getMessage();
}
}
@@ -34,17 +35,17 @@ class ExtMail
{
$users = User::all();
foreach ($users as $user) {
- if ($user->t!=0&&$user->t<1451577599) {
- echo "Send daily mail to user: ".$user->id;
- $subject = Config::get('appName')."-期待您的回归";
+ if ($user->t != 0 && $user->t < 1451577599) {
+ echo 'Send daily mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-期待您的回归';
$to = $user->email;
- $text = "似乎您在 2017 年以来就没有使用过".Config::get('appName')."了呢,如果您在使用上遇到了任何困难,请不要犹豫,登录到".Config::get('appName').",您就会知道如何使用了,特别是对于 iOS 用户,最近在使用的优化上大家都付出了很多的努力。期待您的回归~" ;
+ $text = '似乎您在 2017 年以来就没有使用过' . Config::get('appName') . '了呢,如果您在使用上遇到了任何困难,请不要犹豫,登录到' . Config::get('appName') . ',您就会知道如何使用了,特别是对于 iOS 用户,最近在使用的优化上大家都付出了很多的努力。期待您的回归~';
try {
Mail::send($to, $subject, 'ext/back.tpl', [
- "user" => $user,"text" => $text
+ 'user' => $user, 'text' => $text
], [
]);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
}
diff --git a/app/Command/FinanceMail.php b/app/Command/FinanceMail.php
index 9b559152..5b842a83 100644
--- a/app/Command/FinanceMail.php
+++ b/app/Command/FinanceMail.php
@@ -4,14 +4,12 @@
namespace App\Command;
use App\Models\User;
-use App\Models\Ann;
-use App\Models\Code;
use App\Services\Config;
use App\Services\Mail;
use App\Services\Analytics;
use App\Utils\Telegram;
-use App\Utils\Tools;
+use Exception;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
@@ -19,205 +17,194 @@ class FinanceMail
{
public static function sendFinanceMail_day()
{
- $datatables = new Datatables(new DatatablesHelper());
+ $datatables = new Datatables(new DatatablesHelper());
$datatables->query(
- 'select code.number, code.userid, code.usedatetime from code
- where TO_DAYS(NOW()) - TO_DAYS(code.usedatetime) = 1 and code.type = -1 and code.isused= 1');
- $text_json=$datatables->generate();
- $text_array=json_decode($text_json,true);
- $codes=$text_array['data'];
- $text_html='| 金额 | 用户ID | 用户名 | 充值时间 | ';
- $income_count=0;
- $income_total=0.00;
- foreach($codes as $code){
- $text_html.=' ';
- $text_html.='| '.$code['number'].' | ';
- $text_html.=''.$code['userid'].' | ';
- $user=User::find($code['userid']);
- $text_html.=''.$user->user_name.' | ';
- $text_html.=''.$code['usedatetime'].' | ';
- $text_html.=' ';
- $income_count+=1;
- $income_total+=$code['number'];
- }
- //易付通的单独表
- $datatables2 = new Datatables(new DatatablesHelper());
- $datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
- $count_yft=$datatables2->generate();
- if(strpos($count_yft,'"count_yft":1')){
- $datatables2->query(
- 'select yft_order_info.price, yft_order_info.user_id, yft_order_info.create_time from yft_order_info
- where TO_DAYS(NOW()) - TO_DAYS(yft_order_info.create_time) = 1 and yft_order_info.state= 1');
- $text_json2=$datatables2->generate();
- $text_array2=json_decode($text_json2,true);
- $codes2=$text_array2['data'];
- foreach($codes2 as $code2){
- $text_html.='';
- $text_html.='| '.$code2['price'].' | ';
- $text_html.=''.$code2['user_id'].' | ';
- $user=User::find($code2['user_id']);
- $text_html.=''.$user->user_name.' | ';
- $text_html.=''.$code2['create_time'].' | ';
- $text_html.=' ';
- $income_count+=1;
- $income_total+=$code['price'];
- }
- }
- $text_html.=' ';
- $text_html.=' 昨日总收入笔数:'.$income_count.' 昨日总收入金额:'.$income_total;
+ 'select code.number, code.userid, code.usedatetime from code
+ where TO_DAYS(NOW()) - TO_DAYS(code.usedatetime) = 1 and code.type = -1 and code.isused= 1'
+ );
+ $text_json = $datatables->generate();
+ $text_array = json_decode($text_json, true);
+ $codes = $text_array['data'];
+ $text_html = '| 金额 | 用户ID | 用户名 | 充值时间 | ';
+ $income_count = 0;
+ $income_total = 0.00;
+ foreach ($codes as $code) {
+ $text_html .= ' ';
+ $text_html .= '| ' . $code['number'] . ' | ';
+ $text_html .= '' . $code['userid'] . ' | ';
+ $user = User::find($code['userid']);
+ $text_html .= '' . $user->user_name . ' | ';
+ $text_html .= '' . $code['usedatetime'] . ' | ';
+ $text_html .= ' ';
+ ++$income_count;
+ $income_total += $code['number'];
+ }
+ //易付通的单独表
+ $datatables2 = new Datatables(new DatatablesHelper());
+ $datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
+ $count_yft = $datatables2->generate();
+ if (strpos($count_yft, '"count_yft":1')) {
+ $datatables2->query(
+ 'select yft_order_info.price, yft_order_info.user_id, yft_order_info.create_time from yft_order_info
+ where TO_DAYS(NOW()) - TO_DAYS(yft_order_info.create_time) = 1 and yft_order_info.state= 1'
+ );
+ $text_json2 = $datatables2->generate();
+ $text_array2 = json_decode($text_json2, true);
+ $codes2 = $text_array2['data'];
+ foreach ($codes2 as $code2) {
+ $text_html .= '';
+ $text_html .= '| ' . $code2['price'] . ' | ';
+ $text_html .= '' . $code2['user_id'] . ' | ';
+ $user = User::find($code2['user_id']);
+ $text_html .= '' . $user->user_name . ' | ';
+ $text_html .= '' . $code2['create_time'] . ' | ';
+ $text_html .= ' ';
+ ++$income_count;
+ $income_total += $code['price'];
+ }
+ }
+ $text_html .= ' ';
+ $text_html .= ' 昨日总收入笔数:' . $income_count . ' 昨日总收入金额:' . $income_total;
- $adminUser = User::where("is_admin", "=", "1")->get();
+ $adminUser = User::where('is_admin', '=', '1')->get();
foreach ($adminUser as $user) {
- echo "Send offline mail to user: ".$user->id;
- $subject = Config::get('appName')."-财务日报";
- $to = $user->email;
- $title='财务日报';
- $text = $text_html;
- try {
- Mail::send($to, $subject, 'news/finance.tpl', [
- "user" => $user,"title"=>$title,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
- echo $e->getMessage();
- }
- }
-
- if (Config::get("finance_public")=="true") {
- $sts = new Analytics();
- Telegram::Send(
- "新鲜出炉的财务日报~".PHP_EOL.
- "昨日总收入笔数:".$income_count.PHP_EOL.
- "昨日总收入金额:".$income_total.PHP_EOL.
- "凌晨也在努力工作~"
- );
- }
+ echo 'Send offline mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-财务日报';
+ $to = $user->email;
+ $title = '财务日报';
+ $text = $text_html;
+ try {
+ Mail::send($to, $subject, 'news/finance.tpl', [
+ 'user' => $user, 'title' => $title, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
+ echo $e->getMessage();
+ }
+ }
+
+ if (Config::get('finance_public') == 'true') {
+ $sts = new Analytics();
+ Telegram::Send(
+ '新鲜出炉的财务日报~' . PHP_EOL .
+ '昨日总收入笔数:' . $income_count . PHP_EOL .
+ '昨日总收入金额:' . $income_total . PHP_EOL .
+ '凌晨也在努力工作~'
+ );
+ }
}
- public static function sendFinanceMail_week()
- {
- $datatables = new Datatables(new DatatablesHelper());
+ public static function sendFinanceMail_week()
+ {
+ $datatables = new Datatables(new DatatablesHelper());
$datatables->query(
- 'select code.number from code
- where yearweek(date_format(code.usedatetime,\'%Y-%m-%d\')) = yearweek(now())-1 and code.isused= 1');
- //每周的第一天是周日,因此统计周日~周六的七天
- $text_json=$datatables->generate();
- $text_array=json_decode($text_json,true);
- $codes=$text_array['data'];
- $text_html='';
- $income_count=0;
- $income_total=0.00;
- foreach($codes as $code){
- $income_count+=1;
- $income_total+=$code['number'];
- }
- //易付通的单独表
- $datatables2 = new Datatables(new DatatablesHelper());
- $datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
- $count_yft=$datatables2->generate();
- if(strpos($count_yft,'"count_yft":1')){
- $datatables2->query(
- 'select yft_order_info.price from yft_order_info
- where yearweek(date_format(yft_order_info.create_time,\'%Y-%m-%d\')) = yearweek(now())-1 and yft_order_info.state= 1');
- //每周的第一天是周日,因此统计周日~周六的七天
- $text_json2=$datatables2->generate();
- $text_array2=json_decode($text_json2,true);
- $codes2=$text_array2['data'];
- foreach($codes2 as $code2){
- $income_count+=1;
- $income_total+=$code2['price'];
- }
- }
+ 'SELECT code.number FROM code
+ WHERE DATEDIFF(NOW(),code.usedatetime) <=7 AND DATEDIFF(NOW(),code.usedatetime) >=1 AND code.isused = 1'
+ );
+ //每周的第一天是周日,因此统计周日~周六的七天
+ $text_json = $datatables->generate();
+ $text_array = json_decode($text_json, true);
+ $codes = $text_array['data'];
+ $text_html = '';
+ $income_count = 0;
+ $income_total = 0.00;
+ foreach ($codes as $code) {
+ ++$income_count;
+ $income_total += $code['number'];
+ }
+ //易付通的单独表
+ $datatables2 = new Datatables(new DatatablesHelper());
+ $datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
+ $count_yft = $datatables2->generate();
+ if (strpos($count_yft, '"count_yft":1')) {
+ $datatables2->query(
+ 'select yft_order_info.price from yft_order_info
+ where yearweek(date_format(yft_order_info.create_time,\'%Y-%m-%d\')) = yearweek(now())-1 and yft_order_info.state= 1'
+ );
+ //每周的第一天是周日,因此统计周日~周六的七天
+ $text_json2 = $datatables2->generate();
+ $text_array2 = json_decode($text_json2, true);
+ $codes2 = $text_array2['data'];
+ foreach ($codes2 as $code2) {
+ ++$income_count;
+ $income_total += $code2['price'];
+ }
+ }
- $text_html.=' 上周总收入笔数:'.$income_count.' 上周总收入金额:'.$income_total;
+ $text_html .= ' 上周总收入笔数:' . $income_count . ' 上周总收入金额:' . $income_total;
- $adminUser = User::where("is_admin", "=", "1")->get();
+ $adminUser = User::where('is_admin', '=', '1')->get();
foreach ($adminUser as $user) {
- echo "Send offline mail to user: ".$user->id;
- $subject = Config::get('appName').'-财务周报';
- $to = $user->email;
- $title='财务周报';
- $text = $text_html;
- try {
- Mail::send($to, $subject, 'news/finance.tpl', [
- "user" => $user,"title"=>$title,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
- echo $e->getMessage();
- }
- }
-
- if (Config::get("finance_public")=="true") {
- $sts = new Analytics();
- Telegram::Send(
- "新鲜出炉的财务周报~".PHP_EOL.
- "上周总收入笔数:".$income_count.PHP_EOL.
- "上周总收入金额:".$income_total.PHP_EOL.
- "周末也在努力工作~"
- );
- }
- }
+ echo 'Send offline mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-财务周报';
+ $to = $user->email;
+ $title = '财务周报';
+ $text = $text_html;
+ try {
+ Mail::send($to, $subject, 'news/finance.tpl', [
+ 'user' => $user, 'title' => $title, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
+ echo $e->getMessage();
+ }
+ }
+
+ if (Config::get('finance_public') == 'true') {
+ $sts = new Analytics();
+ Telegram::Send(
+ '新鲜出炉的财务周报~' . PHP_EOL .
+ '上周总收入笔数:' . $income_count . PHP_EOL .
+ '上周总收入金额:' . $income_total . PHP_EOL .
+ '周末也在努力工作~'
+ );
+ }
+ }
- public static function sendFinanceMail_month()
- {
- $datatables = new Datatables(new DatatablesHelper());
+ public static function sendFinanceMail_month()
+ {
+ $datatables = new Datatables(new DatatablesHelper());
$datatables->query(
- 'select code.number from code
- where date_format(code.usedatetime,\'%Y-%m\')=date_format(date_sub(curdate(), interval 1 month),\'%Y-%m\') and code.type = -1 and code.isused= 1');
- $text_json=$datatables->generate();
- $text_array=json_decode($text_json,true);
- $codes=$text_array['data'];
- $text_html='';
- $income_count=0;
- $income_total=0.00;
- foreach($codes as $code){
- $income_count+=1;
- $income_total+=$code['number'];
- }
- $datatables2 = new Datatables(new DatatablesHelper());
- $datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
- $count_yft=$datatables2->generate();
- if(strpos($count_yft,'"count_yft":1')){
- $datatables2->query(
- 'select yft_order_info.price from yft_order_info
- where date_format(yft_order_info.create_time,\'%Y-%m\') =date_format(date_sub(curdate(), interval 1 month),\'%Y-%m\') and yft_order_info.state= 1');
- //每周的第一天是周日,因此统计周日~周六的七天
- $text_json2=$datatables2->generate();
- $text_array2=json_decode($text_json2,true);
- $codes2=$text_array2['data'];
- foreach($codes2 as $code2){
- $income_count+=1;
- $income_total+=$code2['price'];
- }
- }
- $text_html.=' 上月总收入笔数:'.$income_count.' 上月总收入金额:'.$income_total;
+ 'select code.number from code
+ where date_format(code.usedatetime,\'%Y-%m\')=date_format(date_sub(curdate(), interval 1 month),\'%Y-%m\') and code.type = -1 and code.isused= 1'
+ );
+ $text_json = $datatables->generate();
+ $text_array = json_decode($text_json, true);
+ $codes = $text_array['data'];
+ $text_html = '';
+ $income_count = 0;
+ $income_total = 0.00;
+ foreach ($codes as $code) {
+ ++$income_count;
+ $income_total += $code['number'];
+ }
+ $text_html .= ' 上月总收入笔数:' . $income_count . ' 上月总收入金额:' . $income_total;
- $adminUser = User::where("is_admin", "=", "1")->get();
+ $adminUser = User::where('is_admin', '=', '1')->get();
foreach ($adminUser as $user) {
- echo "Send offline mail to user: ".$user->id;
- $subject = Config::get('appName').'-财务月报';
- $to = $user->email;
- $title='财务月报';
- $text = $text_html;
- try {
- Mail::send($to, $subject, 'news/finance.tpl', [
- "user" => $user,"title"=>$title,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
- echo $e->getMessage();
- }
- }
-
- if (Config::get("finance_public")=="true") {
- $sts = new Analytics();
- Telegram::Send(
- "新鲜出炉的财务月报~".PHP_EOL.
- "上月总收入笔数:".$income_count.PHP_EOL.
- "上月总收入金额:".$income_total.PHP_EOL.
- "月初也在努力工作~"
- );
- }
- }
+ echo 'Send offline mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-财务月报';
+ $to = $user->email;
+ $title = '财务月报';
+ $text = $text_html;
+ try {
+ Mail::send($to, $subject, 'news/finance.tpl', [
+ 'user' => $user, 'title' => $title, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
+ echo $e->getMessage();
+ }
+ }
+
+ if (Config::get('finance_public') == 'true') {
+ $sts = new Analytics();
+ Telegram::Send(
+ '新鲜出炉的财务月报~' . PHP_EOL .
+ '上月总收入笔数:' . $income_count . PHP_EOL .
+ '上月总收入金额:' . $income_total . PHP_EOL .
+ '月初也在努力工作~'
+ );
+ }
+ }
}
diff --git a/app/Command/Job.php b/app/Command/Job.php
index 2d812f12..6209c443 100644
--- a/app/Command/Job.php
+++ b/app/Command/Job.php
@@ -9,7 +9,6 @@ use App\Models\LoginIp;
use App\Models\Speedtest;
use App\Models\Shop;
use App\Models\Bought;
-use App\Models\Coupon;
use App\Models\Ip;
use App\Models\NodeInfoLog;
use App\Models\NodeOnlineLog;
@@ -25,9 +24,12 @@ use App\Services\Mail;
use App\Utils\QQWry;
use App\Utils\GA;
use App\Utils\Telegram;
+use ArrayObject;
use CloudXNS\Api;
use App\Models\Disconnect;
use App\Models\UnblockIp;
+use Exception;
+use RuntimeException;
class Job
{
@@ -35,54 +37,58 @@ class Job
{
$nodes = Node::all();
foreach ($nodes as $node) {
- if ($node->sort == 11) {
- $server_list = explode(";", $node->server);
- if(!Tools::is_ip($server_list[0])){
- if($node->changeNodeIp($server_list[0])){
- $node->save();
- }
- }
- } else if($node->sort == 0 || $node->sort == 1 || $node->sort == 10){
- if(!Tools::is_ip($node->server)){
- if($node->changeNodeIp($node->server)){
- $node->save();
- }
- }
- }
+ if (in_array($node->sort, array(0, 1, 10, 11, 12, 13))) {
+ $server_list = explode(';', $node->server);
+ if (!Tools::is_ip($server_list[0]) && $node->changeNodeIp($server_list[0])) {
+ $node->save();
+ }
+ if (in_array($node->sort, array(0, 10, 12))) {
+ Tools::updateRelayRuleIp($node);
+ }
+ }
}
}
- public static function backup()
+ public static function backup($full = false)
{
- $to = Config::get('auto_backup_email');
- if($to==null){
- return false;
- }
- mkdir('/tmp/ssmodbackup/');
+ $to = Config::get('auto_backup_email');
+ if ($to == null) {
+ return false;
+ }
+ if (!mkdir('/tmp/ssmodbackup/') && !is_dir('/tmp/ssmodbackup/')) {
+ throw new RuntimeException(sprintf('Directory "%s" was not created', '/tmp/ssmodbackup/'));
+ }
$db_address_array = explode(':', Config::get('db_host'));
- system('mysqldump --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' '.Config::get('db_database').' announcement auto blockip bought code coupon disconnect_ip link login_ip payback radius_ban shop speedtest ss_invite_code ss_node ss_password_reset ticket unblockip user user_token email_verify detect_list relay paylist> /tmp/ssmodbackup/mod.sql', $ret);
- system('mysqldump --opt --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' -d '.Config::get('db_database').' alive_ip ss_node_info ss_node_online_log user_traffic_log detect_log telegram_session yft_order_info >> /tmp/ssmodbackup/mod.sql', $ret);
- if (Config::get('enable_radius')=='true') {
- $db_address_array = explode(':', Config::get('radius_db_host'));
- system('mysqldump --user='.Config::get('radius_db_user').' --password='.Config::get('radius_db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').''.Config::get('radius_db_database').'> /tmp/ssmodbackup/radius.sql', $ret);
+ if ($full) {
+ system('mysqldump --user=' . Config::get('db_username') . ' --password=' . Config::get('db_password') . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' ' . Config::get('db_database') . ' > /tmp/ssmodbackup/mod.sql');
+ } else {
+ system('mysqldump --user=' . Config::get('db_username') . ' --password=' . Config::get('db_password') . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' ' . Config::get('db_database') . ' announcement auto blockip bought code coupon disconnect_ip link login_ip payback radius_ban shop speedtest ss_invite_code ss_node ss_password_reset ticket unblockip user user_token email_verify detect_list relay paylist> /tmp/ssmodbackup/mod.sql', $ret);
+ system('mysqldump --opt --user=' . Config::get('db_username') . ' --password=' . Config::get('db_password') . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' -d ' . Config::get('db_database') . ' alive_ip ss_node_info ss_node_online_log user_traffic_log detect_log telegram_session >> /tmp/ssmodbackup/mod.sql', $ret);
+ if (Config::get('enable_radius') == 'true') {
+ $db_address_array = explode(':', Config::get('radius_db_host'));
+ system('mysqldump --user=' . Config::get('radius_db_user') . ' --password=' . Config::get('radius_db_password') . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . '' . Config::get('radius_db_database') . '> /tmp/ssmodbackup/radius.sql', $ret);
+ }
}
- system("cp ".BASE_PATH."/config/.config.php /tmp/ssmodbackup/configbak.php", $ret);
+
+ system('cp ' . BASE_PATH . '/config/.config.php /tmp/ssmodbackup/configbak.php', $ret);
echo $ret;
- system("zip -r /tmp/ssmodbackup.zip /tmp/ssmodbackup/* -P ".Config::get('auto_backup_passwd'), $ret);
- $subject = Config::get('appName')."-备份成功";
- $text = "您好,系统已经为您自动备份,请查看附件,用您设定的密码解压。" ;
+ system('zip -r /tmp/ssmodbackup.zip /tmp/ssmodbackup/* -P ' . Config::get('auto_backup_passwd'), $ret);
+ $subject = Config::get('appName') . '-备份成功';
+ $text = '您好,系统已经为您自动备份,请查看附件,用您设定的密码解压。';
try {
Mail::send($to, $subject, 'news/backup.tpl', [
- "text" => $text
- ], ["/tmp/ssmodbackup.zip"
+ 'text' => $text
+ ], ['/tmp/ssmodbackup.zip'
]);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
- system("rm -rf /tmp/ssmodbackup", $ret);
- system("rm /tmp/ssmodbackup.zip", $ret);
+ system('rm -rf /tmp/ssmodbackup', $ret);
+ system('rm /tmp/ssmodbackup.zip', $ret);
- Telegram::Send("备份完毕了喵~今天又是安全祥和的一天呢。");
+ if (Config::get('backup_notify') == 'true') {
+ Telegram::Send('备份完毕了喵~今天又是安全祥和的一天呢。');
+ }
}
public static function UserGa()
@@ -92,20 +98,20 @@ class Job
$ga = new GA();
$secret = $ga->createSecret();
- $user->ga_token=$secret;
+ $user->ga_token = $secret;
$user->save();
}
- echo "ok";
+ echo 'ok';
}
public static function syncnasnode()
{
$nodes = Node::all();
foreach ($nodes as $node) {
- $rule = preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/",$node->server);
- if (!$rule && (!$node->sort || $node->sort == 10)) {
- $ip=gethostbyname($node->server);
- $node->node_ip=$ip;
+ $rule = preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $node->server);
+ if (!$rule && (!$node->sort || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
+ $ip = gethostbyname($node->server);
+ $node->node_ip = $ip;
$node->save();
Radius::AddNas($node->node_ip, $node->server);
@@ -117,119 +123,119 @@ class Job
{
$nodes = Node::all();
foreach ($nodes as $node) {
- if ($node->sort == 0 || $node->sort == 10 || $node->sort == 11) {
- if (date("d")==$node->bandwidthlimit_resetday) {
- $node->node_bandwidth=0;
+ if ($node->sort == 0 || $node->sort == 10 || $node->sort == 11 || $node->sort == 12 || $node->sort == 13) {
+ if (date('d') == $node->bandwidthlimit_resetday) {
+ $node->node_bandwidth = 0;
$node->save();
}
}
}
- NodeInfoLog::where("log_time", "<", time()-86400*3)->delete();
- NodeOnlineLog::where("log_time", "<", time()-86400*3)->delete();
- TrafficLog::where("log_time", "<", time()-86400*3)->delete();
- DetectLog::where("datetime", "<", time()-86400*3)->delete();
- Speedtest::where("datetime", "<", time()-86400*3)->delete();
- EmailVerify::where("expire_in", "<", time()-86400*3)->delete();
- system("rm ".BASE_PATH."/storage/*.png", $ret);
- Telegram::Send("姐姐姐姐,数据库被清理了,感觉身体被掏空了呢~");
+ NodeInfoLog::where('log_time', '<', time() - 86400 * 3)->delete();
+ NodeOnlineLog::where('log_time', '<', time() - 86400 * 3)->delete();
+ TrafficLog::where('log_time', '<', time() - 86400 * 3)->delete();
+ DetectLog::where('datetime', '<', time() - 86400 * 3)->delete();
+ Speedtest::where('datetime', '<', time() - 86400 * 3)->delete();
+ EmailVerify::where('expire_in', '<', time() - 86400 * 3)->delete();
+ system('rm ' . BASE_PATH . '/storage/*.png', $ret);
+ Telegram::Send('姐姐姐姐,数据库被清理了,感觉身体被掏空了呢~');
//auto reset
- $boughts=Bought::all();
+ $boughts = Bought::all();
+ $boughted_users = array();
foreach ($boughts as $bought) {
- $user=User::where("id", $bought->userid)->first();
+ $user = User::where('id', $bought->userid)->first();
if ($user == null) {
$bought->delete();
continue;
}
- $shop=Shop::where("id", $bought->shopid)->first();
+ $shop = Shop::where('id', $bought->shopid)->first();
if ($shop == null) {
$bought->delete();
continue;
}
- if($shop->reset() != 0 && $shop->reset_value() != 0 && $shop->reset_exp() != 0) {
- if(time() - $shop->reset_exp() * 86400 < $bought->datetime) {
- if(intval((time() - $bought->datetime) / 86400) % $shop->reset() == 0 && intval((time() - $bought->datetime) / 86400) != 0) {
- echo("流量重置-".$user->id."\n");
- $user->transfer_enable = Tools::toGB($shop->reset_value());
- $user->u = 0;
- $user->d = 0;
- $user->last_day_t = 0;
- $user->save();
-
- $subject = Config::get('appName')."-您的流量被重置了";
- $to = $user->email;
- $text = "您好,根据您所订购的订单 ID:".$bought->id.",流量已经被重置为".$shop->reset_value().'GB' ;
- try {
- Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
- echo $e->getMessage();
- }
+ if ($shop->reset() != 0 && $shop->reset_value() != 0 && $shop->reset_exp() != 0) {
+ $boughted_users[] = $bought->userid;
+ if ((time() - $shop->reset_exp() * 86400 < $bought->datetime) && (int)((time() - $bought->datetime) / 86400) % $shop->reset() == 0 && (int)((time() - $bought->datetime) / 86400) != 0) {
+ echo('流量重置-' . $user->id . "\n");
+ $user->transfer_enable = Tools::toGB($shop->reset_value());
+ $user->u = 0;
+ $user->d = 0;
+ $user->last_day_t = 0;
+ $user->save();
+
+ $subject = Config::get('appName') . '-您的流量被重置了';
+ $to = $user->email;
+ $text = '您好,根据您所订购的订单 ID:' . $bought->id . ',流量已经被重置为' . $shop->reset_value() . 'GB';
+ try {
+ Mail::send($to, $subject, 'news/warn.tpl', [
+ 'user' => $user, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
+ echo $e->getMessage();
+ }
}
- }
}
-
}
$users = User::all();
foreach ($users as $user) {
- $user->last_day_t=($user->u+$user->d);
+ $user->last_day_t = ($user->u + $user->d);
$user->save();
-
- if (date("d") == $user->auto_reset_day) {
+ if (in_array($user->id, $boughted_users)) {
+ continue;
+ }
+ if (date('d') == $user->auto_reset_day) {
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
- $user->transfer_enable = $user->auto_reset_bandwidth*1024*1024*1024;
+ $user->transfer_enable = $user->auto_reset_bandwidth * 1024 * 1024 * 1024;
$user->save();
- $subject = Config::get('appName')."-您的流量被重置了";
+ $subject = Config::get('appName') . '-您的流量被重置了';
$to = $user->email;
- $text = "您好,根据管理员的设置,流量已经被重置为".$user->auto_reset_bandwidth.'GB' ;
+ $text = '您好,根据管理员的设置,流量已经被重置为' . $user->auto_reset_bandwidth . 'GB';
try {
Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
+ 'user' => $user, 'text' => $text
], [
]);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
}
}
-
#https://github.com/shuax/QQWryUpdate/blob/master/update.php
- $copywrite = file_get_contents("http://update.cz88.net/ip/copywrite.rar");
+ $copywrite = file_get_contents('http://update.cz88.net/ip/copywrite.rar');
- $adminUser = User::where("is_admin", "=", "1")->get();
+ $adminUser = User::where('is_admin', '=', '1')->get();
$newmd5 = md5($copywrite);
- $oldmd5 = file_get_contents(BASE_PATH."/storage/qqwry.md5");
+ $oldmd5 = file_get_contents(BASE_PATH . '/storage/qqwry.md5');
if ($newmd5 != $oldmd5) {
- file_put_contents(BASE_PATH."/storage/qqwry.md5", $newmd5);
- $qqwry = file_get_contents("http://update.cz88.net/ip/qqwry.rar");
- if ($qqwry != "") {
- $key = unpack("V6", $copywrite)[6];
- for ($i=0; $i<0x200; $i++) {
+ file_put_contents(BASE_PATH . '/storage/qqwry.md5', $newmd5);
+ $qqwry = file_get_contents('http://update.cz88.net/ip/qqwry.rar');
+ if ($qqwry != '') {
+ $key = unpack('V6', $copywrite)[6];
+ for ($i = 0; $i < 0x200; $i++) {
$key *= 0x805;
- $key ++;
- $key = $key & 0xFF;
+ $key++;
+ $key &= 0xFF;
$qqwry[$i] = chr(ord($qqwry[$i]) ^ $key);
}
$qqwry = gzuncompress($qqwry);
- rename(BASE_PATH."/storage/qqwry.dat", BASE_PATH."/storage/qqwry.dat.bak");
- $fp = fopen(BASE_PATH."/storage/qqwry.dat", "wb");
+ rename(BASE_PATH . '/storage/qqwry.dat', BASE_PATH . '/storage/qqwry.dat.bak');
+ $fp = fopen(BASE_PATH . '/storage/qqwry.dat', 'wb');
if ($fp) {
fwrite($fp, $qqwry);
fclose($fp);
@@ -238,21 +244,21 @@ class Job
}
$iplocation = new QQWry();
- $location=$iplocation->getlocation("8.8.8.8");
+ $location = $iplocation->getlocation('8.8.8.8');
$Userlocation = $location['country'];
- if (iconv('gbk', 'utf-8//IGNORE', $Userlocation)!="美国") {
- unlink(BASE_PATH."/storage/qqwry.dat");
- rename(BASE_PATH."/storage/qqwry.dat.bak", BASE_PATH."/storage/qqwry.dat");
+ if (iconv('gbk', 'utf-8//IGNORE', $Userlocation) != '美国') {
+ unlink(BASE_PATH . '/storage/qqwry.dat');
+ rename(BASE_PATH . '/storage/qqwry.dat.bak', BASE_PATH . '/storage/qqwry.dat');
}
- Job::updatedownload();
-
+ self::updatedownload();
}
+
// 定时任务开启的情况下,每天自动检测有没有最新版的后端,github源来自Miku
- public static function updatedownload()
- {
- system('cd '.BASE_PATH."/public/ssr-download/ && git pull https://github.com/xcxnig/ssr-download.git");
- }
+ public static function updatedownload()
+ {
+ system('cd ' . BASE_PATH . '/public/ssr-download/ && git pull https://github.com/xcxnig/ssr-download.git');
+ }
public static function CheckJob()
@@ -260,33 +266,33 @@ class Job
//在线人数检测
$users = User::where('node_connector', '>', 0)->get();
- $full_alive_ips = Ip::where("datetime", ">=", time()-60)->orderBy("ip")->get();
+ $full_alive_ips = Ip::where('datetime', '>=', time() - 60)->orderBy('ip')->get();
$alive_ipset = array();
foreach ($full_alive_ips as $full_alive_ip) {
$full_alive_ip->ip = Tools::getRealIp($full_alive_ip->ip);
- $is_node = Node::where("node_ip", $full_alive_ip->ip)->first();
- if($is_node) {
+ $is_node = Node::where('node_ip', $full_alive_ip->ip)->first();
+ if ($is_node) {
continue;
}
if (!isset($alive_ipset[$full_alive_ip->userid])) {
- $alive_ipset[$full_alive_ip->userid] = new \ArrayObject();
+ $alive_ipset[$full_alive_ip->userid] = new ArrayObject();
}
$alive_ipset[$full_alive_ip->userid]->append($full_alive_ip);
}
foreach ($users as $user) {
- $alive_ips = (isset($alive_ipset[$user->id])?$alive_ipset[$user->id]:new \ArrayObject());
+ $alive_ips = ($alive_ipset[$user->id] ?? new ArrayObject());
$ips = array();
- $disconnected_ips = explode(",", $user->disconnect_ip);
+ $disconnected_ips = explode(',', $user->disconnect_ip);
foreach ($alive_ips as $alive_ip) {
if (!isset($ips[$alive_ip->ip]) && !in_array($alive_ip->ip, $disconnected_ips)) {
- $ips[$alive_ip->ip]=1;
+ $ips[$alive_ip->ip] = 1;
if ($user->node_connector < count($ips)) {
//暂时封禁
$isDisconnect = Disconnect::where('id', '=', $alive_ip->ip)->where('userid', '=', $user->id)->first();
@@ -298,10 +304,10 @@ class Job
$disconnect->datetime = time();
$disconnect->save();
- if ($user->disconnect_ip == null||$user->disconnect_ip == "") {
+ if ($user->disconnect_ip == null || $user->disconnect_ip == '') {
$user->disconnect_ip = $alive_ip->ip;
} else {
- $user->disconnect_ip .= ",".$alive_ip->ip;
+ $user->disconnect_ip .= ',' . $alive_ip->ip;
}
$user->save();
}
@@ -311,28 +317,28 @@ class Job
}
//解封
- $disconnecteds = Disconnect::where("datetime", "<", time()-300)->get();
+ $disconnecteds = Disconnect::where('datetime', '<', time() - 300)->get();
foreach ($disconnecteds as $disconnected) {
$user = User::where('id', '=', $disconnected->userid)->first();
- $ips = explode(",", $user->disconnect_ip);
- $new_ips = "";
+ $ips = explode(',', $user->disconnect_ip);
+ $new_ips = '';
$first = 1;
foreach ($ips as $ip) {
- if ($ip != $disconnected->ip && $ip != "") {
+ if ($ip != $disconnected->ip && $ip != '') {
if ($first == 1) {
$new_ips .= $ip;
$first = 0;
} else {
- $new_ips .= ",".$ip;
+ $new_ips .= ',' . $ip;
}
}
}
$user->disconnect_ip = $new_ips;
- if ($new_ips == "") {
+ if ($new_ips == '') {
$user->disconnect_ip = null;
}
@@ -342,243 +348,276 @@ class Job
}
//自动续费
- $boughts=Bought::where("renew", "<", time())->where("renew", "<>", 0)->get();
+ $boughts = Bought::where('renew', '<', time())->where('renew', '<>', 0)->get();
foreach ($boughts as $bought) {
- $user=User::where("id", $bought->userid)->first();
+ $user = User::where('id', $bought->userid)->first();
if ($user == null) {
$bought->delete();
continue;
}
- $shop=Shop::where("id", $bought->shopid)->first();
- if ($shop == null) {
+ $shop = Shop::where('id', $bought->shopid)->first();
+ if ($shop == null) {
$bought->delete();
- $subject = Config::get('appName')."-续费失败";
- $to = $user->email;
- $text = "您好,系统为您自动续费商品时,发现该商品已被下架,为能继续正常使用,建议您登录用户面板购买新的商品。" ;
- try {
- Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
- echo $e->getMessage();
- }
+ $subject = Config::get('appName') . '-续费失败';
+ $to = $user->email;
+ $text = '您好,系统为您自动续费商品时,发现该商品已被下架,为能继续正常使用,建议您登录用户面板购买新的商品。';
+ try {
+ Mail::send($to, $subject, 'news/warn.tpl', [
+ 'user' => $user, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
+ echo $e->getMessage();
+ }
continue;
}
- if ($user->money >= $shop->price) {
- $user->money=$user->money - $shop->price;
+ if ($user->money >= $shop->price) {
+ $user->money -= $shop->price;
$user->save();
$shop->buy($user, 1);
- $bought->renew=0;
+ $bought->renew = 0;
$bought->save();
- $bought_new=new Bought();
- $bought_new->userid=$user->id;
- $bought_new->shopid=$shop->id;
- $bought_new->datetime=time();
- $bought_new->renew=time()+$shop->auto_renew*86400;
- $bought_new->price=$shop->price;
- $bought_new->coupon="";
+ $bought_new = new Bought();
+ $bought_new->userid = $user->id;
+ $bought_new->shopid = $shop->id;
+ $bought_new->datetime = time();
+ $bought_new->renew = time() + $shop->auto_renew * 86400;
+ $bought_new->price = $shop->price;
+ $bought_new->coupon = '';
$bought_new->save();
- $subject = Config::get('appName')."-续费成功";
+ $subject = Config::get('appName') . '-续费成功';
$to = $user->email;
- $text = "您好,系统已经为您自动续费,商品名:".$shop->name.",金额:".$shop->price." 元。" ;
+ $text = '您好,系统已经为您自动续费,商品名:' . $shop->name . ',金额:' . $shop->price . ' 元。';
try {
Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
+ 'user' => $user, 'text' => $text
], [
]);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
- if (file_exists(BASE_PATH."/storage/".$bought->id.".renew")) {
- unlink(BASE_PATH."/storage/".$bought->id.".renew");
+ if (file_exists(BASE_PATH . '/storage/' . $bought->id . '.renew')) {
+ unlink(BASE_PATH . '/storage/' . $bought->id . '.renew');
}
- } else {
- if (!file_exists(BASE_PATH."/storage/".$bought->id.".renew")) {
- $subject = Config::get('appName')."-续费失败";
- $to = $user->email;
- $text = "您好,系统为您自动续费商品名:".$shop->name.",金额:".$shop->price." 元 时,发现您余额不足,请及时充值。充值后请稍等系统便会自动为您续费。" ;
- try {
- Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
- echo $e->getMessage();
- }
- $myfile = fopen(BASE_PATH."/storage/".$bought->id.".renew", "w+") or die("Unable to open file!");
- $txt = "1";
- fwrite($myfile, $txt);
- fclose($myfile);
+ } elseif (!file_exists(BASE_PATH . '/storage/' . $bought->id . '.renew')) {
+ $subject = Config::get('appName') . '-续费失败';
+ $to = $user->email;
+ $text = '您好,系统为您自动续费商品名:' . $shop->name . ',金额:' . $shop->price . ' 元 时,发现您余额不足,请及时充值。充值后请稍等系统便会自动为您续费。';
+ try {
+ Mail::send($to, $subject, 'news/warn.tpl', [
+ 'user' => $user, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
+ echo $e->getMessage();
}
+ $myfile = fopen(BASE_PATH . '/storage/' . $bought->id . '.renew', 'wb+') or die('Unable to open file!');
+ $txt = '1';
+ fwrite($myfile, $txt);
+ fclose($myfile);
}
}
- Ip::where("datetime", "<", time()-300)->delete();
- UnblockIp::where("datetime", "<", time()-300)->delete();
- BlockIp::where("datetime", "<", time()-86400)->delete();
- TelegramSession::where("datetime", "<", time()-900)->delete();
+ Ip::where('datetime', '<', time() - 300)->delete();
+ UnblockIp::where('datetime', '<', time() - 300)->delete();
+ BlockIp::where('datetime', '<', time() - 86400)->delete();
+ TelegramSession::where('datetime', '<', time() - 900)->delete();
- $adminUser = User::where("is_admin", "=", "1")->get();
-
- //节点掉线检测
- if (Config::get("enable_detect_offline")=="true") {
+ $adminUser = User::where('is_admin', '=', '1')->get();
+
+ //节点掉线检测
+ if (Config::get('enable_detect_offline') == 'true') {
$nodes = Node::all();
foreach ($nodes as $node) {
- if ($node->isNodeOnline() === false && !file_exists(BASE_PATH."/storage/".$node->id.".offline")) {
+ if ($node->isNodeOnline() === false && !file_exists(BASE_PATH . '/storage/' . $node->id . '.offline')) {
+ if (Config::get('useScFtqq') == 'true' && Config::get('enable_detect_offline_useScFtqq') == 'true') {
+ $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
+ $text = '管理员您好,系统发现节点 ' . $node->name . ' 掉线了,请您及时处理。';
+ $postdata = http_build_query(
+ array(
+ 'text' => Config::get('appName') . '-节点掉线了',
+ 'desp' => $text
+ )
+ );
+ $opts = array('http' =>
+ array(
+ 'method' => 'POST',
+ 'header' => 'Content-type: application/x-www-form-urlencoded',
+ 'content' => $postdata
+ ));
+ $context = stream_context_create($opts);
+ file_get_contents('https://sc.ftqq.com/' . $ScFtqq_SCKEY . '.send', false, $context);
+ }
+
foreach ($adminUser as $user) {
- echo "Send offline mail to user: ".$user->id;
- $subject = Config::get('appName')."-系统警告";
+ echo 'Send offline mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-系统警告';
$to = $user->email;
- $text = "管理员您好,系统发现节点 ".$node->name." 掉线了,请您及时处理。" ;
+ $text = '管理员您好,系统发现节点 ' . $node->name . ' 掉线了,请您及时处理。';
try {
Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
+ 'user' => $user, 'text' => $text
], [
]);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
- if (Config::get('enable_cloudxns')=='true' && ($node->sort==0 || $node->sort==10)) {
- $api=new Api();
- $api->setApiKey(Config::get("cloudxns_apikey"));//修改成自己API KEY
- $api->setSecretKey(Config::get("cloudxns_apisecret"));//修改成自己的SECERET KEY
+ if (Config::get('enable_cloudxns') == 'true' && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
+ $api = new Api();
+ $api->setApiKey(Config::get('cloudxns_apikey'));//修改成自己API KEY
+ $api->setSecretKey(Config::get('cloudxns_apisecret'));//修改成自己的SECERET KEY
$api->setProtocol(true);
- $domain_json=json_decode($api->domain->domainList());
+ $domain_json = json_decode($api->domain->domainList());
foreach ($domain_json->data as $domain) {
- if (strpos($domain->domain, Config::get('cloudxns_domain'))!==false) {
- $domain_id=$domain->id;
+ if (strpos($domain->domain, Config::get('cloudxns_domain')) !== false) {
+ $domain_id = $domain->id;
}
}
- $record_json=json_decode($api->record->recordList($domain_id, 0, 0, 2000));
+ $record_json = json_decode($api->record->recordList($domain_id, 0, 0, 2000));
foreach ($record_json->data as $record) {
- if (($record->host.".".Config::get('cloudxns_domain'))==$node->server) {
- $record_id=$record->record_id;
+ if (($record->host . '.' . Config::get('cloudxns_domain')) == $node->server) {
+ $record_id = $record->record_id;
- $Temp_node=Node::where('node_class', '<=', $node->node_class)->where(
- function ($query) use ($node) {
- $query->where("node_group", "=", $node->node_group)
- ->orWhere("node_group", "=", 0);
+ $Temp_node = Node::where('node_class', '<=', $node->node_class)->where(
+ static function ($query) use ($node) {
+ $query->where('node_group', '=', $node->node_group)
+ ->orWhere('node_group', '=', 0);
}
)->whereRaw('UNIX_TIMESTAMP()-`node_heartbeat`<300')->first();
- if ($Temp_node!=null) {
+ if ($Temp_node != null) {
$api->record->recordUpdate($domain_id, $record->host, $Temp_node->server, 'CNAME', 55, 60, 1, '', $record_id);
}
- $notice_text = "喵喵喵~ ".$node->name." 节点掉线了喵~域名解析被切换到了 ".$Temp_node->name." 上了喵~";
+ $notice_text = '喵喵喵~ ' . $node->name . ' 节点掉线了喵~域名解析被切换到了 ' . $Temp_node->name . ' 上了喵~';
}
}
} else {
- $notice_text = "喵喵喵~ ".$node->name." 节点掉线了喵~";
+ $notice_text = '喵喵喵~ ' . $node->name . ' 节点掉线了喵~';
}
}
Telegram::Send($notice_text);
- $myfile = fopen(BASE_PATH."/storage/".$node->id.".offline", "w+") or die("Unable to open file!");
- $txt = "1";
+ $myfile = fopen(BASE_PATH . '/storage/' . $node->id . '.offline', 'wb+') or die('Unable to open file!');
+ $txt = '1';
fwrite($myfile, $txt);
fclose($myfile);
- }
-
- elseif ($node->isNodeOnline() === true && file_exists(BASE_PATH."/storage/".$node->id.".offline")) {
- foreach ($adminUser as $user) {
- echo "Send offline mail to user: ".$user->id;
- $subject = Config::get('appName')."-系统提示";
- $to = $user->email;
- $text = "管理员您好,系统发现节点 ".$node->name." 恢复上线了。" ;
- try {
- Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
- ], [
- ]);
- } catch (\Exception $e) {
- echo $e->getMessage();
+ } elseif ($node->isNodeOnline() === true && file_exists(BASE_PATH . '/storage/' . $node->id . '.offline')) {
+ if (Config::get('useScFtqq') == 'true' && Config::get('enable_detect_offline_useScFtqq') == 'true') {
+ $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
+ $text = '管理员您好,系统发现节点 ' . $node->name . ' 恢复上线了。';
+ $postdata = http_build_query(
+ array(
+ 'text' => Config::get('appName') . '-节点掉线了',
+ 'desp' => $text
+ )
+ );
+
+ $opts = array('http' =>
+ array(
+ 'method' => 'POST',
+ 'header' => 'Content-type: application/x-www-form-urlencoded',
+ 'content' => $postdata
+ ));
+ $context = stream_context_create($opts);
+ file_get_contents('https://sc.ftqq.com/' . $ScFtqq_SCKEY . '.send', false, $context);
}
+ foreach ($adminUser as $user) {
+ echo 'Send offline mail to user: ' . $user->id;
+ $subject = Config::get('appName') . '-系统提示';
+ $to = $user->email;
+ $text = '管理员您好,系统发现节点 ' . $node->name . ' 恢复上线了。';
+ try {
+ Mail::send($to, $subject, 'news/warn.tpl', [
+ 'user' => $user, 'text' => $text
+ ], [
+ ]);
+ } catch (Exception $e) {
+ echo $e->getMessage();
+ }
+
+ if (Config::get('enable_cloudxns') == 'true' && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
+ $api = new Api();
+ $api->setApiKey(Config::get('cloudxns_apikey'));//修改成自己API KEY
+ $api->setSecretKey(Config::get('cloudxns_apisecret'));//修改成自己的SECERET KEY
+ $api->setProtocol(true);
+
+ $domain_json = json_decode($api->domain->domainList());
- if (Config::get('enable_cloudxns')=='true'&& ($node->sort==0 || $node->sort==10)) {
- $api=new Api();
- $api->setApiKey(Config::get("cloudxns_apikey"));//修改成自己API KEY
- $api->setSecretKey(Config::get("cloudxns_apisecret"));//修改成自己的SECERET KEY
- $api->setProtocol(true);
-
- $domain_json=json_decode($api->domain->domainList());
-
- foreach ($domain_json->data as $domain) {
- if (strpos($domain->domain, Config::get('cloudxns_domain'))!==false) {
- $domain_id=$domain->id;
+ foreach ($domain_json->data as $domain) {
+ if (strpos($domain->domain, Config::get('cloudxns_domain')) !== false) {
+ $domain_id = $domain->id;
+ }
}
- }
- $record_json=json_decode($api->record->recordList($domain_id, 0, 0, 2000));
+ $record_json = json_decode($api->record->recordList($domain_id, 0, 0, 2000));
- foreach ($record_json->data as $record) {
- if (($record->host.".".Config::get('cloudxns_domain'))==$node->server) {
- $record_id=$record->record_id;
+ foreach ($record_json->data as $record) {
+ if (($record->host . '.' . Config::get('cloudxns_domain')) == $node->server) {
+ $record_id = $record->record_id;
- $api->record->recordUpdate($domain_id, $record->host, $node->getNodeIp(), 'A', 55, 600, 1, '', $record_id);
+ $api->record->recordUpdate($domain_id, $record->host, $node->getNodeIp(), 'A', 55, 600, 1, '', $record_id);
+ }
}
- }
-
- $notice_text = "喵喵喵~ ".$node->name." 节点恢复了喵~域名解析被切换回来了喵~";
+
+ $notice_text = '喵喵喵~ ' . $node->name . ' 节点恢复了喵~域名解析被切换回来了喵~';
} else {
- $notice_text = "喵喵喵~ ".$node->name." 节点恢复了喵~";
+ $notice_text = '喵喵喵~ ' . $node->name . ' 节点恢复了喵~';
}
}
Telegram::Send($notice_text);
- unlink(BASE_PATH."/storage/".$node->id.".offline");
- }
+ unlink(BASE_PATH . '/storage/' . $node->id . '.offline');
+ }
}
}
-
//登录地检测
- if (Config::get("login_warn")=="true") {
+ if (Config::get('login_warn') == 'true') {
$iplocation = new QQWry();
- $Logs = LoginIp::where("datetime", ">", time()-60)->get();
+ $Logs = LoginIp::where('datetime', '>', time() - 60)->get();
foreach ($Logs as $log) {
- $UserLogs=LoginIp::where("userid", "=", $log->userid)->orderBy("id", "desc")->take(2)->get();
- if ($UserLogs->count()==2) {
+ $UserLogs = LoginIp::where('userid', '=', $log->userid)->orderBy('id', 'desc')->take(2)->get();
+ if ($UserLogs->count() == 2) {
$i = 0;
- $Userlocation = "";
+ $Userlocation = '';
foreach ($UserLogs as $userlog) {
if ($i == 0) {
- $location=$iplocation->getlocation($userlog->ip);
- $ip=$userlog->ip;
+ $location = $iplocation->getlocation($userlog->ip);
+ $ip = $userlog->ip;
$Userlocation = $location['country'];
$i++;
} else {
- $location=$iplocation->getlocation($userlog->ip);
- $nodes=Node::where("node_ip", "LIKE", $ip.'%')->first();
- $nodes2=Node::where("node_ip", "LIKE", $userlog->ip.'%')->first();
- if ($Userlocation!=$location['country']&&$nodes==null&&$nodes2==null) {
- $user=User::where("id", "=", $userlog->userid)->first();
- echo "Send warn mail to user: ".$user->id."-".iconv('gbk', 'utf-8//IGNORE', $Userlocation)."-".iconv('gbk', 'utf-8//IGNORE', $location['country']);
- $subject = Config::get('appName')."-系统警告";
+ $location = $iplocation->getlocation($userlog->ip);
+ $nodes = Node::where('node_ip', 'LIKE', $ip . '%')->first();
+ $nodes2 = Node::where('node_ip', 'LIKE', $userlog->ip . '%')->first();
+ if ($Userlocation != $location['country'] && $nodes == null && $nodes2 == null) {
+ $user = User::where('id', '=', $userlog->userid)->first();
+ echo 'Send warn mail to user: ' . $user->id . '-' . iconv('gbk', 'utf-8//IGNORE', $Userlocation) . '-' . iconv('gbk', 'utf-8//IGNORE', $location['country']);
+ $subject = Config::get('appName') . '-系统警告';
$to = $user->email;
- $text = "您好,系统发现您的账号在 ".iconv('gbk', 'utf-8//IGNORE', $Userlocation)." 有异常登录,请您自己自行核实登录行为。有异常请及时修改密码。" ;
+ $text = '您好,系统发现您的账号在 ' . iconv('gbk', 'utf-8//IGNORE', $Userlocation) . ' 有异常登录,请您自己自行核实登录行为。有异常请及时修改密码。';
try {
Mail::send($to, $subject, 'news/warn.tpl', [
- "user" => $user,"text" => $text
+ 'user' => $user, 'text' => $text
], [
]);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
echo $e->getMessage();
}
}
@@ -590,170 +629,165 @@ class Job
$users = User::all();
foreach ($users as $user) {
- if (($user->transfer_enable<=$user->u+$user->d||$user->enable==0||(strtotime($user->expire_in) | |