From 2abe93ba1dd18fa776c189eb2ed2f87400d4b774 Mon Sep 17 00:00:00 2001 From: mmmwhy Date: Sat, 4 Nov 2017 11:20:18 +0800 Subject: [PATCH] no message --- .gitignore | 8 + .htaccess | 1 - .idea/workspace.xml | 7177 +++++++++++++++++ README.md | 2 +- app/Command/Job.php | 11 +- app/Controllers/Admin/IpController.php | 65 +- app/Controllers/Admin/UserController.php | 1 + app/Controllers/AuthController.php | 20 +- app/Controllers/LinkController.php | 3 +- app/Controllers/Mod_Mu/UserController.php | 5 +- app/Controllers/UserController.php | 36 +- app/Models/User.php | 6 + app/Utils/TelegramProcess.php | 13 +- app/Utils/Tools.php | 7 + app/Utils/URL.php | 11 +- config/.config.php.example | 40 +- public/robots.txt | 3 +- resources/views/material/admin/ip/alive.tpl | 89 +- resources/views/material/admin/main.tpl | 1 + .../views/material/admin/node/create.tpl | 8 +- resources/views/material/admin/node/edit.tpl | 6 +- resources/views/material/admin/user/edit.tpl | 140 +- resources/views/material/admin/user/index.tpl | 2 +- resources/views/material/staff.tpl | 9 - resources/views/material/user/index.tpl | 14 +- resources/views/material/user/node.tpl | 25 - resources/views/material/user/profile.tpl | 52 +- sql/glzjin_33_opt.sql | 95 + sql/sspanel.sql | 904 --- 29 files changed, 7618 insertions(+), 1136 deletions(-) create mode 100644 .gitignore delete mode 100644 .htaccess create mode 100644 .idea/workspace.xml create mode 100644 sql/glzjin_33_opt.sql delete mode 100644 sql/sspanel.sql diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a17da4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.env +vendor/ +composer.phar +.user.ini +public/.user.ini +storage/* +config/.config.php +resources/views/material/analytics.tpl diff --git a/.htaccess b/.htaccess deleted file mode 100644 index 0519ecb..0000000 --- a/.htaccess +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..c69f269 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,7177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + P + Pay. + Pay + p + pay. + pay.p + pay.php + pay.ph + pay + 发 + f + f2fp + f2fpa + f2fpay + full_alive_ips + f2f + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1509762341939 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index b04b3c3..57ecf80 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -详情见:[https://91vps.club/2017/06/09/alipay_f2f_ss_panel_mod/](https://91vps.club/2017/06/09/alipay_f2f_ss_panel_mod/) +详情见:[https://91vps.win/2017/06/09/alipay_f2f_ss_panel_mod/](https://91vps.win/2017/06/09/alipay_f2f_ss_panel_mod/) \ No newline at end of file diff --git a/app/Command/Job.php b/app/Command/Job.php index e8d15df..29269d4 100644 --- a/app/Command/Job.php +++ b/app/Command/Job.php @@ -17,6 +17,7 @@ use App\Models\TrafficLog; use App\Models\DetectLog; use App\Models\BlockIp; use App\Models\TelegramSession; +use App\Models\EmailVerify; use App\Services\Config; use App\Utils\Radius; use App\Utils\Wecenter; @@ -139,6 +140,8 @@ class Job 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(); Telegram::Send("姐姐姐姐,数据库被清理了,感觉身体被掏空了呢~"); //auto reset @@ -273,11 +276,17 @@ class Job //在线人数检测 $users = User::where('node_connector', '>', 0)->get(); - $full_alive_ips = Ip::where("datetime", ">=", time()-60)->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) { + continue; + } + if (!isset($alive_ipset[$full_alive_ip->userid])) { $alive_ipset[$full_alive_ip->userid] = new \ArrayObject(); } diff --git a/app/Controllers/Admin/IpController.php b/app/Controllers/Admin/IpController.php index 0f2c3cc..d6de9a6 100644 --- a/app/Controllers/Admin/IpController.php +++ b/app/Controllers/Admin/IpController.php @@ -6,8 +6,10 @@ use App\Models\Ip; use App\Models\LoginIp; use App\Models\BlockIp; use App\Models\UnblockIp; +use App\Models\Node; use App\Controllers\AdminController; use App\Utils\QQWry; +use App\Utils\Tools; use App\Services\Auth; use Ozdemir\Datatables\Datatables; @@ -28,6 +30,20 @@ class IpController extends AdminController return $this->view()->assign('table_config', $table_config)->display('admin/ip/login.tpl'); } + public function alive($request, $response, $args) + { + $table_config['total_column'] = array("id" => "ID", "userid" => "用户ID", + "user_name" => "用户名", "nodeid" => "节点ID", + "node_name" => "节点名", "ip" => "IP", + "location" => "归属地", "datetime" => "时间", "is_node" => "是否为中转连接"); + $table_config['default_show_column'] = array(); + foreach ($table_config['total_column'] as $column => $value) { + array_push($table_config['default_show_column'], $column); + } + $table_config['ajax_url'] = 'alive/ajax'; + return $this->view()->assign('table_config', $table_config)->display('admin/ip/alive.tpl'); + } + public function block($request, $response, $args) { $table_config['total_column'] = array("id" => "ID", @@ -85,8 +101,9 @@ class IpController extends AdminController return date('Y-m-d H:i:s', $data['datetime']); }); - $datatables->edit('location', function ($data) { - $iplocation = new QQWry(); + $iplocation = new QQWry(); + + $datatables->edit('location', function ($data) use ($iplocation) { $location=$iplocation->getlocation($data['location']); return iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']); }); @@ -104,8 +121,9 @@ class IpController extends AdminController return date('Y-m-d H:i:s', $data['datetime']); }); - $datatables->edit('location', function ($data) { - $iplocation = new QQWry(); + $iplocation = new QQWry(); + + $datatables->edit('location', function ($data) use ($iplocation) { $location=$iplocation->getlocation($data['location']); return iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']); }); @@ -123,8 +141,9 @@ class IpController extends AdminController return date('Y-m-d H:i:s', $data['datetime']); }); - $datatables->edit('location', function ($data) { - $iplocation = new QQWry(); + + $iplocation = new QQWry(); + $datatables->edit('location', function ($data) use ($iplocation) { $location=$iplocation->getlocation($data['location']); return iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']); }); @@ -136,4 +155,38 @@ class IpController extends AdminController $body = $response->getBody(); $body->write($datatables->generate()); } + + + public function ajax_alive($request, $response, $args) + { + $datatables = new Datatables(new DatatablesHelper()); + $datatables->query('Select alive_ip.id,alive_ip.userid,user.user_name,alive_ip.nodeid,ss_node.name as node_name,alive_ip.ip,alive_ip.ip as location,alive_ip.datetime,alive_ip.id as is_node from alive_ip,user,ss_node WHERE alive_ip.userid = user.id and alive_ip.nodeid = ss_node.id and `datetime` > UNIX_TIMESTAMP() - 60'); + + $datatables->edit('datetime', function ($data) { + return date('Y-m-d H:i:s', $data['datetime']); + }); + + $iplocation = new QQWry(); + + $datatables->edit('ip', function ($data){ + return Tools::getRealIp($data['ip']); + }); + + $datatables->edit('is_node', function ($data){ + $is_node = Node::where("node_ip", Tools::getRealIp($data['ip']))->first(); + if($is_node) { + return "是"; + } else { + return "否"; + } + }); + + $datatables->edit('location', function ($data) use ($iplocation) { + $location=$iplocation->getlocation(Tools::getRealIp($data['location'])); + return iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']); + }); + + $body = $response->getBody(); + $body->write($datatables->generate()); + } } diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php index 0bb50ef..7381380 100644 --- a/app/Controllers/Admin/UserController.php +++ b/app/Controllers/Admin/UserController.php @@ -187,6 +187,7 @@ class UserController extends AdminController $user->node_group = $request->getParam('group'); $user->ref_by = $request->getParam('ref_by'); $user->remark = $request->getParam('remark'); + $user->money = $request->getParam('money'); $user->class = $request->getParam('class'); $user->class_expire = $request->getParam('class_expire'); $user->expire_in = $request->getParam('expire_in'); diff --git a/app/Controllers/AuthController.php b/app/Controllers/AuthController.php index 0f7ab45..b7330a0 100644 --- a/app/Controllers/AuthController.php +++ b/app/Controllers/AuthController.php @@ -300,7 +300,7 @@ class AuthController extends BaseController } // check pwd length - if (strlen($passwd)<8) { + if (strlen($passwd)<2) { $res['ret'] = 0; $res['msg'] = "密码太短"; return $response->getBody()->write(json_encode($res)); @@ -349,18 +349,28 @@ class AuthController extends BaseController $user->invite_num = Config::get('inviteNum'); $user->auto_reset_day = Config::get('reg_auto_reset_day'); $user->auto_reset_bandwidth = Config::get('reg_auto_reset_bandwidth'); + $user->money=0; + $user->class_expire=date("Y-m-d H:i:s", time()+Config::get('user_class_expire_default')*3600); + $user->class = Config::get('user_class_default'); + $user->node_connector=Config::get('user_conn'); + $user->node_speedlimit=Config::get('user_speedlimit'); if (Config::get('enable_invite_code')=='true') { $user->ref_by = $c->user_id; + if ($user->ref_by !=0) { + $user->money=Config::get('invite_get_money'); + $gift_user=User::where("id", "=", $user->ref_by)->first(); + $gift_user->transfer_enable=($gift_user->transfer_enable+Config::get('invite_gift')*1024*1024*1024); + $gift_user->save(); + } } else { $user->ref_by = 0; } $user->expire_in=date("Y-m-d H:i:s", time()+Config::get('user_expire_in_default')*86400); $user->reg_date=date("Y-m-d H:i:s"); $user->reg_ip=$_SERVER["REMOTE_ADDR"]; - $user->money=0; - $user->class=0; + $user->class_expire=date("Y-m-d H:i:s", time()+Config::get('user_class_expire_default')*3600); + $user->class=Config::get('user_class_default'); $user->plan='A'; - $user->node_speedlimit=0; $user->theme=Config::get('theme'); $group=Config::get('ramdom_group'); @@ -416,4 +426,4 @@ class AuthController extends BaseController return $response->getBody()->write(json_encode($res)); } } -} +} \ No newline at end of file diff --git a/app/Controllers/LinkController.php b/app/Controllers/LinkController.php index 966c51b..793cb0f 100644 --- a/app/Controllers/LinkController.php +++ b/app/Controllers/LinkController.php @@ -345,7 +345,7 @@ class LinkController extends BaseController "password"=>$item['passwd'], "tcp_over_udp"=>false, "udp_over_tcp"=>false, - "group"=>Config::get('appName'), + "group"=>$item['group'], "protocol"=>$item['protocol'], "protoparam"=>$item['protocol_param'], "obfs_udp"=>false, @@ -1740,6 +1740,7 @@ FINAL,Proxy'; $bash .= 'nvram set rt_ss_port_x'.$count.'='.$item['port']."\n"; $bash .= 'nvram set rt_ss_password_x'.$count.'="'.$item['passwd']."\"\n"; $bash .= 'nvram set rt_ss_server_x'.$count.'='.$item['address']."\n"; + $bash .= 'nvram set rt_ss_usage_x'.$count.'=""'."\n"; $bash .= 'nvram set rt_ss_method_x'.$count.'='.$item['method']."\n"; $count += 1; } diff --git a/app/Controllers/Mod_Mu/UserController.php b/app/Controllers/Mod_Mu/UserController.php index 90cc075..2c9f628 100644 --- a/app/Controllers/Mod_Mu/UserController.php +++ b/app/Controllers/Mod_Mu/UserController.php @@ -111,10 +111,9 @@ class UserController extends BaseController $user = User::find($user_id); if($user == NULL) { - continue; - + continue; } - + $user->t = time(); $user->u += $u * $node->traffic_rate; $user->d += $d * $node->traffic_rate; diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php index 24130aa..1eea21c 100644 --- a/app/Controllers/UserController.php +++ b/app/Controllers/UserController.php @@ -145,8 +145,6 @@ class UserController extends BaseController } } - - public function f2fpayget($request, $response, $args) { $time = $request->getQueryParams()["time"]; @@ -195,8 +193,7 @@ class UserController extends BaseController return $response->getBody()->write(json_encode($res)); } - - + public function alipay($request, $response, $args) { $amount = $request->getQueryParams()["amount"]; @@ -688,6 +685,10 @@ class UserController extends BaseController $iplocation = new QQWry(); + $userip=array(); + + $total = Ip::where("datetime",">=",time()-300)->where('userid', '=',$this->user->id)->get(); + $totallogin = LoginIp::where('userid', '=', $this->user->id)->where("type", "=", 0)->orderBy("datetime", "desc")->take(10)->get(); $userloginip=array(); @@ -703,9 +704,29 @@ class UserController extends BaseController } } + foreach($total as $single) + { + //if(isset($useripcount[$single->userid])) + { + $single->ip = Tools::getRealIp($single->ip); + $is_node = Node::where("node_ip", $single->ip)->first(); + if($is_node) { + continue; + } - return $this->view()->assign("userloginip", $userloginip)->assign("paybacks", $paybacks)->display('user/profile.tpl'); + if(!isset($userip[$single->ip])) + { + //$useripcount[$single->userid]=$useripcount[$single->userid]+1; + $location=$iplocation->getlocation($single->ip); + $userip[$single->ip]=iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']); + } + } + } + + + + return $this->view()->assign("userip",$userip)->assign("userloginip", $userloginip)->assign("paybacks", $paybacks)->display('user/profile.tpl'); } @@ -950,9 +971,10 @@ class UserController extends BaseController $price=$shop->price*((100-$credit)/100); $user=$this->user; - if ($user->money<$price) { + + if ((float)$user->money<(float)$price) { $res['ret'] = 0; - $res['msg'] = "余额不足"; + $res['msg'] = "余额不足,总价为".$price."元。"; return $response->getBody()->write(json_encode($res)); } diff --git a/app/Models/User.php b/app/Models/User.php index 3e258aa..fd29f86 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -225,6 +225,12 @@ class User extends Model $total = Ip::where("datetime", ">=", time()-90)->where('userid', $uid)->orderBy('userid', 'desc')->get(); $unique_ip_list = array(); foreach ($total as $single_record) { + $single_record->ip = Tools::getRealIp($single_record->ip); + $is_node = Node::where("node_ip", $single_record->ip)->first(); + if($is_node) { + continue; + } + if (!in_array($single_record->ip, $unique_ip_list)) { array_push($unique_ip_list, $single_record->ip); } diff --git a/app/Utils/TelegramProcess.php b/app/Utils/TelegramProcess.php index 7daa1fa..887ba6e 100644 --- a/app/Utils/TelegramProcess.php +++ b/app/Utils/TelegramProcess.php @@ -16,7 +16,7 @@ class TelegramProcess 今日已使用 ".$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)."% - ", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); + ", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); break; case 'checkin': if (!$user->isAbleToCheckin()) { @@ -24,10 +24,10 @@ class TelegramProcess break; } $traffic = rand(Config::get('checkinMin'), Config::get('checkinMax')); - $user->transfer_enable = $user->transfer_enable + Tools::toMB($traffic)*2; + $user->transfer_enable = $user->transfer_enable + Tools::toMB($traffic); $user->last_check_in_time = time(); $user->save(); - $bot->sendMessage($message->getChat()->getId(), "天若有情天亦老,我为长者续一秒!获得了 ".$traffic." MB 流量!因为我很喜欢你,所以多送你".$traffic." MB 流量!", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); + $bot->sendMessage($message->getChat()->getId(), "天若有情天亦老,我为长者续一秒!获得了 ".$traffic." MB 流量!", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); break; default: $bot->sendMessage($message->getChat()->getId(), "???", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); @@ -40,12 +40,11 @@ class TelegramProcess public static function telegram_process($bot, $message, $command) { - $bot->sendChatAction($message->getChat()->getId(), 'typing'); - $user = User::where('telegram_id', $message->getFrom()->getId())->first(); if ($message->getChat()->getId() > 0) { //个人 + $bot->sendChatAction($message->getChat()->getId(), 'typing'); switch ($command) { case 'ping': @@ -69,7 +68,7 @@ class TelegramProcess /help 获取帮助信息 您可以在面板里点击 资料编辑 ,滑到页面最下方,就可以看到 Telegram 绑定指示了,绑定您的账号,更多精彩功能等着您去发掘。 - "; + "; $bot->sendMessage($message->getChat()->getId(), $help_list); break; default: @@ -168,6 +167,8 @@ class TelegramProcess return; } + $bot->sendChatAction($message->getChat()->getId(), 'typing'); + switch ($command) { case 'ping': $bot->sendMessage($message->getChat()->getId(), 'Pong!这个群组的 ID 是 '.$message->getChat()->getId().'!', $parseMode = null, $disablePreview = false, $replyToMessageId = $message->getMessageId()); diff --git a/app/Utils/Tools.php b/app/Utils/Tools.php index 6e1fec5..c25c6b2 100644 --- a/app/Utils/Tools.php +++ b/app/Utils/Tools.php @@ -267,6 +267,8 @@ class Tools public static function is_protocol_relay($user) { + return true; + $relay_able_list = Config::getSupportParam('relay_able_protocol'); if (in_array($user->protocol, $relay_able_list) || Config::get('relay_insecure_mode') == 'true') { @@ -423,4 +425,9 @@ class Tools return true; } + + public static function getRealIp($rawIp) + { + return str_replace("::ffff:", "", $rawIp); + } } diff --git a/app/Utils/URL.php b/app/Utils/URL.php index b557343..bae5193 100644 --- a/app/Utils/URL.php +++ b/app/Utils/URL.php @@ -248,14 +248,14 @@ 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(Config::get('appName')); + $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); } 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']); + $ssurl .= "#".rawurlencode($item['remark']); }else{ $personal_info = $item['method'].':'.$item['passwd']; $ssurl = "ss://".Tools::base64_url_encode($personal_info)."@".$item['address'].":".$item['port']; @@ -275,7 +275,7 @@ class URL $ssurl .= "?plugin=".rawurlencode($plugin); } - $ssurl .= "#".rawurlencode(Config::get('appName')." - ".$item['remark']); + $ssurl .= "#".rawurlencode($item['remark']); } return $ssurl; } @@ -328,6 +328,7 @@ class URL * protocol_param * obfs * obfs_param + * group */ public static function getItem($user, $node, $mu_port = 0, $relay_rule_id = 0, $is_ss = 0) { @@ -380,6 +381,10 @@ class URL $return_array['protocol_param'] = $user->protocol_param; $return_array['obfs'] = $user->obfs; $return_array['obfs_param'] = $user->obfs_param; + $return_array['group'] = Config::get('appName'); + if($mu_port != 0) { + $return_array['group'] .= ' - 单端口多用户'; + } return $return_array; } diff --git a/config/.config.php.example b/config/.config.php.example index f6ec98e..4af2b97 100644 --- a/config/.config.php.example +++ b/config/.config.php.example @@ -5,8 +5,8 @@ // !!! 修改此key为随机字符串确保网站安全 !!! $System_Config['key'] = 'randomkey'; $System_Config['debug'] = 'false'; // 正式环境请确保为false -$System_Config['appName'] = '91vps.us'; //站点名称 -$System_Config['baseUrl'] = 'https://zhaojin97.cn'; // 站点地址 +$System_Config['appName'] = '91vps'; //站点名称 +$System_Config['baseUrl'] = 'https://91vps.win'; // 站点地址 $System_Config['timeZone'] = 'PRC'; // PRC 天朝时间 UTC 格林时间 $System_Config['pwdMethod'] = 'sha256'; // 密码加密 可选 md5,sha256 $System_Config['salt'] = ''; // 密码加密用,从旧版升级请留空 @@ -23,12 +23,32 @@ $System_Config['muKey'] = 'mupass'; // 邮件 $System_Config['mailDriver'] = 'mailgun'; // mailgun or smtp or sendgrid +#用户等级过期时间,在注册时设置。(小时) 此部分功能解释:https://91vps.win/2017/09/12/little_point/ +$System_Config['user_class_expire_default']='2'; + +#用户注册等级,在注册时设置。 +$System_Config['user_class_default']='9'; + +#用户注册客户端数量限制,0为不限制 +$System_Config['user_conn']='2'; + + +#用户注册速度默认限制,0为不限制 +$System_Config['user_speedlimit']='2'; + + +#邀请新用户获得流量奖励,单位G +$System_Config['invite_gift']='2'; + +#新用户通过私人邀请链接注册,获得奖励金额(鼓励消费) +$System_Config['invite_get_money']='10'; + // 用户签到设置 -$System_Config['checkinMin'] = '1989'; // 签到最少流量 单位MB -$System_Config['checkinMax'] = '8964'; // 签到最多流量 +$System_Config['checkinMin'] = '100'; // 签到最少流量 单位MB +$System_Config['checkinMax'] = '200'; // 签到最多流量 // -$System_Config['defaultTraffic'] = '100'; // 用户初始流量 单位GB +$System_Config['defaultTraffic'] = '10'; // 用户初始流量 单位GB // 注册后获得的邀请码数量 $System_Config['inviteNum'] = '5'; @@ -37,7 +57,7 @@ $System_Config['inviteNum'] = '5'; $System_Config['db_driver'] = 'mysql'; $System_Config['db_host'] = 'localhost'; $System_Config['db_database'] = 'sspanel'; -$System_Config['db_username'] = 'root'; +$System_Config['db_username'] = 'sspanel'; $System_Config['db_password'] = 'root'; $System_Config['db_charset'] = 'utf8'; $System_Config['db_collation'] = 'utf8_general_ci'; @@ -181,19 +201,19 @@ $System_Config['email_verify_iplimit']='10'; #注册时默认加密方式 -$System_Config['reg_method']='rc4-md5'; +$System_Config['reg_method']='chacha20-ietf'; #注册时默认协议 -$System_Config['reg_protocol']='origin'; +$System_Config['reg_protocol']='auth_aes128_md5'; #注册时默认协议参数 $System_Config['reg_protocol_param']=''; #注册时默认混淆方式 -$System_Config['reg_obfs']='plain'; +$System_Config['reg_obfs']='http_simple'; #注册时默认混淆参数 -$System_Config['reg_obfs_param']=''; +$System_Config['reg_obfs_param']='baidu.com'; #注册时默认禁止访问IP列表,半角英文逗号分割 $System_Config['reg_forbidden_ip']='127.0.0.0/8,::1/128'; diff --git a/public/robots.txt b/public/robots.txt index 4f9540b..77470cb 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1 +1,2 @@ -User-agent: * \ No newline at end of file +User-agent: * +Disallow: / \ No newline at end of file diff --git a/resources/views/material/admin/ip/alive.tpl b/resources/views/material/admin/ip/alive.tpl index 2440ad2..b3508cd 100644 --- a/resources/views/material/admin/ip/alive.tpl +++ b/resources/views/material/admin/ip/alive.tpl @@ -1,5 +1,3 @@ - - {include file='admin/main.tpl'} @@ -8,71 +6,42 @@ -
-
-
-

节点在线IP

-
-
-
-
-
- -
-
-
-

部分节点不支持记录。

-
-
-
- -
- {$logs->render()} - - - - - - - - - - - - {foreach $logs as $log} - {if $log->user() != NULL && $log->node() != NULL} - - - - - - - - - - {/if} - {/foreach} -
ID用户ID用户名IP归属地节点ID节点名称
#{$log->id}{$log->userid}{$log->user()->user_name}{$log->ip}{$loc[$log->ip()]}{$log->nodeid}{$log->node()->name}
- {$logs->render()} -
- - -
- - - -
-
- - +
+
+
+

在线IP

+
+
+
+
+
+
+
+
+

显示表项: {include file='table/checkbox.tpl'}

+
+
+
+
+ {include file='table/table.tpl'} +
+
+
+
+{include file='admin/footer.tpl'} + diff --git a/resources/views/material/admin/main.tpl b/resources/views/material/admin/main.tpl index 5299924..32965d8 100644 --- a/resources/views/material/admin/main.tpl +++ b/resources/views/material/admin/main.tpl @@ -93,6 +93,7 @@
  • compare_arrows 中转规则
  • loyalty 邀请与返利
  • text_fields 登录记录
  • +
  • important_devices 在线IP
  • 审计 diff --git a/resources/views/material/admin/node/create.tpl b/resources/views/material/admin/node/create.tpl index c8f9357..848bd46 100644 --- a/resources/views/material/admin/node/create.tpl +++ b/resources/views/material/admin/node/create.tpl @@ -36,9 +36,9 @@ -
    +
    @@ -46,7 +46,7 @@
    -
    + -
    + - +
    +
    @@ -131,7 +136,7 @@
    - +
    @@ -139,8 +144,8 @@
    - - + +
    @@ -148,7 +153,7 @@
    - +
    @@ -156,8 +161,8 @@
    - - + +
    @@ -165,37 +170,37 @@
    - +
    - - - + + +
    - +
    - +
    - +
    - +
    - +
    @@ -203,16 +208,16 @@
    - +
    - +
    - +
    @@ -220,12 +225,12 @@
    - - + +
    - +
    @@ -236,19 +241,19 @@
    - + {include file='dialog.tpl'}
    - - - + + +
    - - - - + + + + @@ -270,7 +275,7 @@ { var is_admin=0; } - + if(document.getElementById('enable').checked) { var enable=1; @@ -279,7 +284,7 @@ { var enable=0; } - + $.ajax({ type: "PUT", url: "/admin/user/{$edit_user->id}", @@ -287,30 +292,31 @@ data: { email: $("#email").val(), pass: $("#pass").val(), - auto_reset_day: $("#auto_reset_day").val(), + auto_reset_day: $("#auto_reset_day").val(), auto_reset_bandwidth: $("#auto_reset_bandwidth").val(), is_multi_user: $("#is_multi_user").val(), port: $("#port").val(), - group: $("#group").val(), + group: $("#group").val(), passwd: $("#passwd").val(), transfer_enable: $("#transfer_enable").val(), invite_num: $("#invite_num").val(), - node_speedlimit: $("#node_speedlimit").val(), + node_speedlimit: $("#node_speedlimit").val(), method: $("#method").val(), - remark: $("#remark").val(), + remark: $("#remark").val(), + money: $("#money").val(), enable: enable, is_admin: is_admin, ref_by: $("#ref_by").val(), forbidden_ip: $("#forbidden_ip").val(), forbidden_port: $("#forbidden_port").val(), - class: $("#class").val(), - class_expire: $("#class_expire").val(), - expire_in: $("#expire_in").val(), - node_connector: $("#node_connector").val(), - protocol: $("#protocol").val(), - protocol_param: $("#protocol_param").val(), - obfs: $("#obfs").val(), - obfs_param: $("#obfs_param").val(), + class: $("#class").val(), + class_expire: $("#class_expire").val(), + expire_in: $("#expire_in").val(), + node_connector: $("#node_connector").val(), + protocol: $("#protocol").val(), + protocol_param: $("#protocol_param").val(), + obfs: $("#obfs").val(), + obfs_param: $("#obfs_param").val(), }, success: function (data) { if (data.ret) { @@ -340,9 +346,3 @@ }) - - - - - - diff --git a/resources/views/material/admin/user/index.tpl b/resources/views/material/admin/user/index.tpl index 50072c2..ac2bb0c 100644 --- a/resources/views/material/admin/user/index.tpl +++ b/resources/views/material/admin/user/index.tpl @@ -145,7 +145,7 @@ $(document).ready(function(){ next = 1; $.getJSON("user/ajax?page=" + page, function( data ) { if (data.next == 0) { - next = 0; + next = 0; } for ( var i=0, ien=data.data.length ; i编辑' + diff --git a/resources/views/material/staff.tpl b/resources/views/material/staff.tpl index 7712fdb..929f2c1 100644 --- a/resources/views/material/staff.tpl +++ b/resources/views/material/staff.tpl @@ -138,15 +138,6 @@
    - -
    -
    -
    -

    致谢

    -

    本站使用91vps教程搭建

    -
    -
    -
    diff --git a/resources/views/material/user/index.tpl b/resources/views/material/user/index.tpl index a261a53..447dbe7 100644 --- a/resources/views/material/user/index.tpl +++ b/resources/views/material/user/index.tpl @@ -253,7 +253,17 @@ {else}
    不限速
    {/if}

    - + +

    在线设备数量
    +
    {$user->online_ip_count()}

    + +

    设备数量限制
    + {if $user->node_connector!=0} +
    {$user->node_connector}个
    + {else} +
    不限制
    + {/if}

    +

    上次使用
    {$user->lastSsTime()}

    @@ -541,4 +551,4 @@ initGeetest({ {/if} - + \ No newline at end of file diff --git a/resources/views/material/user/node.tpl b/resources/views/material/user/node.tpl index 5e305bb..f64ceeb 100644 --- a/resources/views/material/user/node.tpl +++ b/resources/views/material/user/node.tpl @@ -89,31 +89,6 @@

    {if $node->sort == 0||$node->sort==7||$node->sort==8||$node->sort==10} -

    加密方式: - {if $node->custom_method == 1} - {$user->method} - {else} - {$node->method} - {/if} -

    - - {if ($node->sort==0||$node->sort==10)&&$node->custom_rss==1} -

    协议: - {$user->protocol} -

    - -

    协议参数: - {$user->protocol_param} -

    - -

    混淆方式: - {$user->obfs} -

    - -

    混淆参数: - {$user->obfs_param} -

    - {/if}

    流量比例: diff --git a/resources/views/material/user/profile.tpl b/resources/views/material/user/profile.tpl index 29c5923..fcd5dae 100644 --- a/resources/views/material/user/profile.tpl +++ b/resources/views/material/user/profile.tpl @@ -39,8 +39,35 @@

    - - + +
    +
    +
    +

    最近五分钟使用IP

    +

    请确认都为自己的IP,如有异常请及时修改连接密码。

    +
    +
    + + + + + + + {foreach $userip as $single=>$location} + + + + + + {/foreach} +
    IP归属地
    {$single}{$location}
    +
    +
    +
    +
    +
    + +
    @@ -50,13 +77,13 @@
    - + {foreach $userloginip as $single=>$location} - + @@ -65,11 +92,11 @@ - + - - + +
    @@ -108,19 +135,16 @@
    - + - + - - - @@ -128,5 +152,7 @@ -{include file='user/footer.tpl'} + + +{include file='user/footer.tpl'} diff --git a/sql/glzjin_33_opt.sql b/sql/glzjin_33_opt.sql new file mode 100644 index 0000000..408ea2e --- /dev/null +++ b/sql/glzjin_33_opt.sql @@ -0,0 +1,95 @@ +TRUNCATE `alive_ip`; + +ALTER TABLE `alive_ip` ADD INDEX(`userid`); + + +ALTER TABLE `alive_ip` CHANGE `ip` `ip` CHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + + +TRUNCATE `user_traffic_log`; + +ALTER TABLE `telegram_session` CHANGE `session_content` `session_content` CHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + + +ALTER TABLE `speedtest` CHANGE `telecomping` `telecomping` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `telecomeupload` `telecomeupload` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `telecomedownload` `telecomedownload` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `unicomping` `unicomping` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `unicomupload` `unicomupload` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `unicomdownload` `unicomdownload` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `cmccping` `cmccping` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `cmccupload` `cmccupload` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `cmccdownload` `cmccdownload` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + +TRUNCATE `email_verify`; + +ALTER TABLE `email_verify` CHANGE `email` `email` CHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `ip` `ip` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, CHANGE `code` `code` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + +TRUNCATE `disconnect_ip`; + +ALTER TABLE `disconnect_ip` CHANGE `ip` `ip` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + +TRUNCATE `blockip`; + +ALTER TABLE `blockip` CHANGE `ip` `ip` CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + +ALTER TABLE `blockip` ADD INDEX(`ip`); + +ALTER TABLE `bought` ADD INDEX(`userid`); + +ALTER TABLE `code` ADD INDEX(`userid`); + +ALTER TABLE `detect_log` ADD INDEX(`user_id`); + +ALTER TABLE `blockip` ADD INDEX(`nodeid`); + +ALTER TABLE `email_verify` ADD INDEX(`email`); +ALTER TABLE `email_verify` ADD INDEX(`ip`); +ALTER TABLE `email_verify` ADD INDEX(`code`); + + +ALTER TABLE `link` CHANGE `token` `token` CHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + +ALTER TABLE `link` ADD INDEX(`token`); + +ALTER TABLE `login_ip` ADD INDEX(`userid`); + +ALTER TABLE `payback` ADD INDEX(`userid`); + +ALTER TABLE `radius_ban` ADD INDEX(`userid`); + +ALTER TABLE `relay` ADD INDEX( `user_id`, `source_node_id`, `dist_node_id`); + +ALTER TABLE `ss_invite_code` ADD INDEX( `code`, `user_id`); + +ALTER TABLE `ss_node` ADD INDEX( `type`, `sort`, `node_class`, `node_group`); + +TRUNCATE `ss_node_info`; + +ALTER TABLE `ss_node_info` ADD INDEX(`node_id`); + +TRUNCATE `ss_node_online_log`; + +ALTER TABLE `ss_node_online_log` ADD INDEX(`node_id`); + +ALTER TABLE `ss_password_reset` ADD INDEX(`token`); + +ALTER TABLE `telegram_session` ADD INDEX(`session_content`); + +ALTER TABLE `ticket` ADD INDEX( `rootid`, `userid`); + +ALTER TABLE `user` ADD INDEX( `email`, `telegram_id`); + +ALTER TABLE `user_token` ADD INDEX(`token`); + +ALTER TABLE `user_traffic_log` ADD INDEX( `user_id`, `node_id`); + +ALTER TABLE `user` ADD INDEX(`t`); + +ALTER TABLE `ss_node` CHANGE `node_ip` `node_ip` CHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL; + +ALTER TABLE `ss_node` ADD INDEX(`node_ip`); + +ALTER TABLE `alive_ip` ADD INDEX(`datetime`); + +ALTER TABLE `auto` ADD INDEX(`datetime`); + +ALTER TABLE `blockip` ADD INDEX(`datetime`); + +ALTER TABLE `ss_node_online_log` ADD INDEX(`log_time`); + +ALTER TABLE `ss_node_info` ADD INDEX(`log_time`); + +ALTER TABLE `user_traffic_log` ADD INDEX(`log_time`); \ No newline at end of file diff --git a/sql/sspanel.sql b/sql/sspanel.sql deleted file mode 100644 index 4a4ecbb..0000000 --- a/sql/sspanel.sql +++ /dev/null @@ -1,904 +0,0 @@ --- phpMyAdmin SQL Dump --- version 4.4.15.6 --- http://www.phpmyadmin.net --- --- Host: localhost --- Generation Time: 2017-05-26 20:29:46 --- 服务器版本: 5.5.48-log --- PHP Version: 7.0.7 - -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -SET time_zone = "+00:00"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8mb4 */; - --- --- Database: `sspanel` --- - --- -------------------------------------------------------- - --- --- 表的结构 `alive_ip` --- - -CREATE TABLE IF NOT EXISTS `alive_ip` ( - `id` bigint(20) NOT NULL, - `nodeid` int(11) NOT NULL, - `userid` int(11) NOT NULL, - `ip` text NOT NULL, - `datetime` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `announcement` --- - -CREATE TABLE IF NOT EXISTS `announcement` ( - `id` int(11) NOT NULL, - `date` datetime NOT NULL, - `content` longtext NOT NULL, - `markdown` longtext NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `auto` --- - -CREATE TABLE IF NOT EXISTS `auto` ( - `id` bigint(20) NOT NULL, - `type` int(11) NOT NULL, - `value` longtext NOT NULL, - `sign` longtext NOT NULL, - `datetime` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `blockip` --- - -CREATE TABLE IF NOT EXISTS `blockip` ( - `id` bigint(20) NOT NULL, - `nodeid` int(11) NOT NULL, - `ip` text NOT NULL, - `datetime` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `bought` --- - -CREATE TABLE IF NOT EXISTS `bought` ( - `id` bigint(20) NOT NULL, - `userid` bigint(20) NOT NULL, - `shopid` bigint(20) NOT NULL, - `datetime` bigint(20) NOT NULL, - `renew` bigint(11) NOT NULL, - `coupon` text NOT NULL, - `price` decimal(12,2) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `code` --- - -CREATE TABLE IF NOT EXISTS `code` ( - `id` bigint(20) NOT NULL, - `code` text NOT NULL, - `type` int(11) NOT NULL, - `number` decimal(11,2) NOT NULL, - `isused` int(11) NOT NULL DEFAULT '0', - `userid` bigint(20) NOT NULL, - `usedatetime` datetime NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `coupon` --- - -CREATE TABLE IF NOT EXISTS `coupon` ( - `id` bigint(20) NOT NULL, - `code` text NOT NULL, - `onetime` int(11) NOT NULL, - `expire` bigint(20) NOT NULL, - `shop` text NOT NULL, - `credit` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `detect_list` --- - -CREATE TABLE IF NOT EXISTS `detect_list` ( - `id` bigint(20) NOT NULL, - `name` longtext NOT NULL, - `text` longtext NOT NULL, - `regex` longtext NOT NULL, - `type` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `detect_log` --- - -CREATE TABLE IF NOT EXISTS `detect_log` ( - `id` bigint(20) NOT NULL, - `user_id` bigint(20) NOT NULL, - `list_id` bigint(20) NOT NULL, - `datetime` bigint(20) NOT NULL, - `node_id` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `disconnect_ip` --- - -CREATE TABLE IF NOT EXISTS `disconnect_ip` ( - `id` bigint(20) NOT NULL, - `userid` bigint(20) NOT NULL, - `ip` text NOT NULL, - `datetime` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `email_verify` --- - -CREATE TABLE IF NOT EXISTS `email_verify` ( - `id` bigint(20) NOT NULL, - `email` text NOT NULL, - `ip` text NOT NULL, - `code` text NOT NULL, - `expire_in` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `link` --- - -CREATE TABLE IF NOT EXISTS `link` ( - `id` bigint(20) NOT NULL, - `type` int(11) NOT NULL, - `address` text NOT NULL, - `port` int(11) NOT NULL, - `token` text NOT NULL, - `ios` int(11) NOT NULL DEFAULT '0', - `userid` bigint(20) NOT NULL, - `isp` text, - `geo` int(11) DEFAULT NULL, - `method` text -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - --- --- 转存表中的数据 `link` --- - -INSERT INTO `link` (`id`, `type`, `address`, `port`, `token`, `ios`, `userid`, `isp`, `geo`, `method`) VALUES -(1, -1, 'smart', 0, 'uqLssejxwrnwpMj7', 1, 1, NULL, 0, 'smart'), -(2, 9, 'smart', 0, '7d7VqbO3kDPeXyOq', 0, 1, NULL, 0, 'smart'), -(3, 10, '', 0, 'SLXNV6TKViEvIkV7', 0, 1, NULL, 0, ''), -(4, 10, '', 0, 'tyMNIMkJiSZCRwbz', 0, 1, NULL, 1, ''); - --- -------------------------------------------------------- - --- --- 表的结构 `login_ip` --- - -CREATE TABLE IF NOT EXISTS `login_ip` ( - `id` bigint(20) NOT NULL, - `userid` bigint(20) NOT NULL, - `ip` text NOT NULL, - `datetime` bigint(20) NOT NULL, - `type` int(11) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - --- --- 转存表中的数据 `login_ip` --- - -INSERT INTO `login_ip` (`id`, `userid`, `ip`, `datetime`, `type`) VALUES -(1, 1, '211.86.158.21', 1495801576, 0); - --- -------------------------------------------------------- - --- --- 表的结构 `payback` --- - -CREATE TABLE IF NOT EXISTS `payback` ( - `id` bigint(20) NOT NULL, - `total` decimal(12,2) NOT NULL, - `userid` bigint(20) NOT NULL, - `ref_by` bigint(20) NOT NULL, - `ref_get` decimal(12,2) NOT NULL, - `datetime` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `paylist` --- - -CREATE TABLE IF NOT EXISTS `paylist` ( - `id` bigint(20) NOT NULL, - `userid` bigint(20) NOT NULL, - `total` decimal(12,2) NOT NULL, - `status` int(11) NOT NULL DEFAULT '0', - `tradeno` text, - `datetime` bigint(20) NOT NULL DEFAULT '0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `radius_ban` --- - -CREATE TABLE IF NOT EXISTS `radius_ban` ( - `id` int(11) NOT NULL, - `userid` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `relay` --- - -CREATE TABLE IF NOT EXISTS `relay` ( - `id` bigint(20) NOT NULL, - `user_id` bigint(20) NOT NULL, - `source_node_id` bigint(20) NOT NULL, - `dist_node_id` bigint(20) NOT NULL, - `dist_ip` text NOT NULL, - `port` int(11) NOT NULL, - `priority` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `shop` --- - -CREATE TABLE IF NOT EXISTS `shop` ( - `id` bigint(20) NOT NULL, - `name` text NOT NULL, - `price` decimal(12,2) NOT NULL, - `content` text NOT NULL, - `auto_renew` int(11) NOT NULL, - `auto_reset_bandwidth` int(11) NOT NULL DEFAULT '0', - `status` int(11) NOT NULL DEFAULT '1' -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `speedtest` --- - -CREATE TABLE IF NOT EXISTS `speedtest` ( - `id` bigint(20) NOT NULL, - `nodeid` int(11) NOT NULL, - `datetime` bigint(20) NOT NULL, - `telecomping` text NOT NULL, - `telecomeupload` text NOT NULL, - `telecomedownload` text NOT NULL, - `unicomping` text NOT NULL, - `unicomupload` text NOT NULL, - `unicomdownload` text NOT NULL, - `cmccping` text NOT NULL, - `cmccupload` text NOT NULL, - `cmccdownload` text NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `ss_invite_code` --- - -CREATE TABLE IF NOT EXISTS `ss_invite_code` ( - `id` int(11) NOT NULL, - `code` varchar(128) NOT NULL, - `user_id` int(11) NOT NULL, - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT '2016-06-01 00:00:00' -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `ss_node` --- - -CREATE TABLE IF NOT EXISTS `ss_node` ( - `id` int(11) NOT NULL, - `name` varchar(128) NOT NULL, - `type` int(3) NOT NULL, - `server` varchar(128) NOT NULL, - `method` varchar(64) NOT NULL, - `info` varchar(128) NOT NULL, - `status` varchar(128) NOT NULL, - `sort` int(3) NOT NULL, - `custom_method` tinyint(1) NOT NULL DEFAULT '0', - `traffic_rate` float NOT NULL DEFAULT '1', - `node_class` int(11) NOT NULL DEFAULT '0', - `node_speedlimit` decimal(12,2) NOT NULL DEFAULT '0.00', - `node_connector` int(11) NOT NULL DEFAULT '0', - `node_bandwidth` bigint(20) NOT NULL DEFAULT '0', - `node_bandwidth_limit` bigint(20) NOT NULL DEFAULT '0', - `bandwidthlimit_resetday` int(11) NOT NULL DEFAULT '0', - `node_heartbeat` bigint(20) NOT NULL DEFAULT '0', - `node_ip` text, - `node_group` int(11) NOT NULL DEFAULT '0', - `custom_rss` int(11) NOT NULL DEFAULT '0', - `mu_only` int(11) DEFAULT '0' -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; - --- --- 转存表中的数据 `ss_node` --- - -INSERT INTO `ss_node` (`id`, `name`, `type`, `server`, `method`, `info`, `status`, `sort`, `custom_method`, `traffic_rate`, `node_class`, `node_speedlimit`, `node_connector`, `node_bandwidth`, `node_bandwidth_limit`, `bandwidthlimit_resetday`, `node_heartbeat`, `node_ip`, `node_group`, `custom_rss`, `mu_only`) VALUES -(1, '统一验证登陆', 0, 'zhaojin97.cn', 'radius', '统一登陆验证', '可用', 999, 0, 1, 0, '0.00', 0, 0, 0, 0, 0, '', 0, 0, 0), -(2, 'VPN 统一流量结算', 0, 'zhaojin97.cn', 'radius', 'VPN 统一流量结算', '可用', 999, 0, 1, 0, '0.00', 0, 0, 0, 0, 0, NULL, 0, 0, 0), -(3, '第一个节点', 1, '103.74.192.11', 'rc4-md5', '可用', '点击查看二维码', 0, 1, 1, 0, '0.00', 0, 0, 0, 0, 0, '103.74.192.11', 0, 1, 0); - --- -------------------------------------------------------- - --- --- 表的结构 `ss_node_info` --- - -CREATE TABLE IF NOT EXISTS `ss_node_info` ( - `id` int(11) NOT NULL, - `node_id` int(11) NOT NULL, - `uptime` float NOT NULL, - `load` varchar(32) NOT NULL, - `log_time` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `ss_node_online_log` --- - -CREATE TABLE IF NOT EXISTS `ss_node_online_log` ( - `id` int(11) NOT NULL, - `node_id` int(11) NOT NULL, - `online_user` int(11) NOT NULL, - `log_time` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `ss_password_reset` --- - -CREATE TABLE IF NOT EXISTS `ss_password_reset` ( - `id` int(11) NOT NULL, - `email` varchar(32) NOT NULL, - `token` varchar(128) NOT NULL, - `init_time` int(11) NOT NULL, - `expire_time` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- -------------------------------------------------------- - --- --- 表的结构 `telegram_session` --- - -CREATE TABLE IF NOT EXISTS `telegram_session` ( - `id` bigint(20) NOT NULL, - `user_id` bigint(20) NOT NULL, - `type` int(11) NOT NULL, - `session_content` text NOT NULL, - `datetime` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `ticket` --- - -CREATE TABLE IF NOT EXISTS `ticket` ( - `id` bigint(20) NOT NULL, - `title` longtext NOT NULL, - `content` longtext NOT NULL, - `rootid` bigint(20) NOT NULL, - `userid` bigint(20) NOT NULL, - `datetime` bigint(20) NOT NULL, - `status` int(11) NOT NULL DEFAULT '1' -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- - --- --- 表的结构 `unblockip` --- - -CREATE TABLE IF NOT EXISTS `unblockip` ( - `id` bigint(20) NOT NULL, - `ip` text NOT NULL, - `datetime` bigint(20) NOT NULL, - `userid` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `user` --- - -CREATE TABLE IF NOT EXISTS `user` ( - `id` int(11) NOT NULL, - `user_name` varchar(128) CHARACTER SET utf8mb4 NOT NULL, - `email` varchar(32) NOT NULL, - `pass` varchar(64) NOT NULL, - `passwd` varchar(16) NOT NULL, - `t` int(11) NOT NULL DEFAULT '0', - `u` bigint(20) NOT NULL, - `d` bigint(20) NOT NULL, - `plan` varchar(2) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'A', - `transfer_enable` bigint(20) NOT NULL, - `port` int(11) NOT NULL, - `switch` tinyint(4) NOT NULL DEFAULT '1', - `enable` tinyint(4) NOT NULL DEFAULT '1', - `type` tinyint(4) NOT NULL DEFAULT '1', - `last_get_gift_time` int(11) NOT NULL DEFAULT '0', - `last_check_in_time` int(11) NOT NULL DEFAULT '0', - `last_rest_pass_time` int(11) NOT NULL DEFAULT '0', - `reg_date` datetime NOT NULL, - `invite_num` int(8) NOT NULL, - `money` decimal(12,2) NOT NULL, - `ref_by` int(11) NOT NULL DEFAULT '0', - `expire_time` int(11) NOT NULL DEFAULT '0', - `method` varchar(64) NOT NULL DEFAULT 'rc4-md5', - `is_email_verify` tinyint(4) NOT NULL DEFAULT '0', - `reg_ip` varchar(128) NOT NULL DEFAULT '127.0.0.1', - `node_speedlimit` decimal(12,2) NOT NULL DEFAULT '0.00', - `node_connector` int(11) NOT NULL DEFAULT '0', - `is_admin` int(2) NOT NULL DEFAULT '0', - `im_type` int(11) DEFAULT '1', - `im_value` text, - `last_day_t` bigint(20) NOT NULL DEFAULT '0', - `sendDailyMail` int(11) NOT NULL DEFAULT '1', - `class` int(11) NOT NULL DEFAULT '0', - `class_expire` datetime NOT NULL DEFAULT '1989-06-04 00:05:00', - `expire_in` datetime NOT NULL DEFAULT '2099-06-04 00:05:00', - `theme` text NOT NULL, - `ga_token` text NOT NULL, - `ga_enable` int(11) NOT NULL DEFAULT '0', - `pac` longtext, - `remark` text, - `node_group` int(11) NOT NULL DEFAULT '0', - `auto_reset_day` int(11) NOT NULL DEFAULT '0', - `auto_reset_bandwidth` decimal(12,2) NOT NULL DEFAULT '0.00', - `protocol` varchar(128) DEFAULT 'origin', - `protocol_param` varchar(128) DEFAULT NULL, - `obfs` varchar(128) DEFAULT 'plain', - `obfs_param` varchar(128) DEFAULT NULL, - `forbidden_ip` longtext, - `forbidden_port` longtext, - `disconnect_ip` longtext, - `is_hide` int(11) NOT NULL DEFAULT '0', - `is_multi_user` int(11) NOT NULL DEFAULT '0', - `telegram_id` bigint(20) DEFAULT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - --- --- 转存表中的数据 `user` --- - -INSERT INTO `user` (`id`, `user_name`, `email`, `pass`, `passwd`, `t`, `u`, `d`, `plan`, `transfer_enable`, `port`, `switch`, `enable`, `type`, `last_get_gift_time`, `last_check_in_time`, `last_rest_pass_time`, `reg_date`, `invite_num`, `money`, `ref_by`, `expire_time`, `method`, `is_email_verify`, `reg_ip`, `node_speedlimit`, `node_connector`, `is_admin`, `im_type`, `im_value`, `last_day_t`, `sendDailyMail`, `class`, `class_expire`, `expire_in`, `theme`, `ga_token`, `ga_enable`, `pac`, `remark`, `node_group`, `auto_reset_day`, `auto_reset_bandwidth`, `protocol`, `protocol_param`, `obfs`, `obfs_param`, `forbidden_ip`, `forbidden_port`, `disconnect_ip`, `is_hide`, `is_multi_user`, `telegram_id`) VALUES -(1, 'admin', '91vps', '572b4a99cb8ba30268882e356832e1b13e4ccf3de191718b6aa2ebcc631d9cf6', 'nHHpgf', 0, 0, 0, 'A', 107374182400, 443, 1, 1, 1, 0, 0, 0, '2017-05-26 20:04:42', 0, '0.00', 0, 0, 'aes-256-cfb', 0, '127.0.0.1', '0.00', 0, 1, 1, '', 0, 1, 0, '1989-06-04 00:05:00', '2291-03-10 20:04:42', 'material', '2TFGSYHQ3FJLZSWX', 0, NULL, NULL, 0, 0, '0.00', 'origin', NULL, 'plain', NULL, NULL, NULL, NULL, 0, 0, NULL); - --- -------------------------------------------------------- - --- --- 表的结构 `user_token` --- - -CREATE TABLE IF NOT EXISTS `user_token` ( - `id` int(11) NOT NULL, - `token` varchar(256) NOT NULL, - `user_id` int(11) NOT NULL, - `create_time` int(11) NOT NULL, - `expire_time` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- 表的结构 `user_traffic_log` --- - -CREATE TABLE IF NOT EXISTS `user_traffic_log` ( - `id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `u` bigint(20) NOT NULL, - `d` bigint(20) NOT NULL, - `node_id` int(11) NOT NULL, - `rate` float NOT NULL, - `traffic` varchar(32) NOT NULL, - `log_time` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Indexes for dumped tables --- - --- --- Indexes for table `alive_ip` --- -ALTER TABLE `alive_ip` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `announcement` --- -ALTER TABLE `announcement` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `auto` --- -ALTER TABLE `auto` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `blockip` --- -ALTER TABLE `blockip` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `bought` --- -ALTER TABLE `bought` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `code` --- -ALTER TABLE `code` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `coupon` --- -ALTER TABLE `coupon` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `detect_list` --- -ALTER TABLE `detect_list` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `detect_log` --- -ALTER TABLE `detect_log` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `disconnect_ip` --- -ALTER TABLE `disconnect_ip` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `email_verify` --- -ALTER TABLE `email_verify` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `link` --- -ALTER TABLE `link` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `login_ip` --- -ALTER TABLE `login_ip` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `payback` --- -ALTER TABLE `payback` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `paylist` --- -ALTER TABLE `paylist` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `radius_ban` --- -ALTER TABLE `radius_ban` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `relay` --- -ALTER TABLE `relay` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `shop` --- -ALTER TABLE `shop` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `speedtest` --- -ALTER TABLE `speedtest` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `ss_invite_code` --- -ALTER TABLE `ss_invite_code` - ADD PRIMARY KEY (`id`), - ADD KEY `user_id` (`user_id`); - --- --- Indexes for table `ss_node` --- -ALTER TABLE `ss_node` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `ss_node_info` --- -ALTER TABLE `ss_node_info` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `ss_node_online_log` --- -ALTER TABLE `ss_node_online_log` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `ss_password_reset` --- -ALTER TABLE `ss_password_reset` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `telegram_session` --- -ALTER TABLE `telegram_session` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `ticket` --- -ALTER TABLE `ticket` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `unblockip` --- -ALTER TABLE `unblockip` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `user` --- -ALTER TABLE `user` - ADD PRIMARY KEY (`id`), - ADD KEY `user_name` (`user_name`), - ADD KEY `uid` (`id`), - ADD KEY `email` (`email`); - --- --- Indexes for table `user_token` --- -ALTER TABLE `user_token` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `user_traffic_log` --- -ALTER TABLE `user_traffic_log` - ADD PRIMARY KEY (`id`); - --- --- AUTO_INCREMENT for dumped tables --- - --- --- AUTO_INCREMENT for table `alive_ip` --- -ALTER TABLE `alive_ip` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `announcement` --- -ALTER TABLE `announcement` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `auto` --- -ALTER TABLE `auto` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `blockip` --- -ALTER TABLE `blockip` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `bought` --- -ALTER TABLE `bought` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `code` --- -ALTER TABLE `code` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `coupon` --- -ALTER TABLE `coupon` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `detect_list` --- -ALTER TABLE `detect_list` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `detect_log` --- -ALTER TABLE `detect_log` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `disconnect_ip` --- -ALTER TABLE `disconnect_ip` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `email_verify` --- -ALTER TABLE `email_verify` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `link` --- -ALTER TABLE `link` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5; --- --- AUTO_INCREMENT for table `login_ip` --- -ALTER TABLE `login_ip` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; --- --- AUTO_INCREMENT for table `payback` --- -ALTER TABLE `payback` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `paylist` --- -ALTER TABLE `paylist` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `radius_ban` --- -ALTER TABLE `radius_ban` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `relay` --- -ALTER TABLE `relay` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `shop` --- -ALTER TABLE `shop` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `speedtest` --- -ALTER TABLE `speedtest` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `ss_invite_code` --- -ALTER TABLE `ss_invite_code` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `ss_node` --- -ALTER TABLE `ss_node` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; --- --- AUTO_INCREMENT for table `ss_node_info` --- -ALTER TABLE `ss_node_info` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `ss_node_online_log` --- -ALTER TABLE `ss_node_online_log` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `ss_password_reset` --- -ALTER TABLE `ss_password_reset` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `telegram_session` --- -ALTER TABLE `telegram_session` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `ticket` --- -ALTER TABLE `ticket` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `unblockip` --- -ALTER TABLE `unblockip` - MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `user` --- -ALTER TABLE `user` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; --- --- AUTO_INCREMENT for table `user_token` --- -ALTER TABLE `user_token` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `user_traffic_log` --- -ALTER TABLE `user_traffic_log` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    IP 归属地
    {$single} {$location}