Compare commits

...

2044 Commits

Author SHA1 Message Date
StandWithYOU 8633e1cd2d
Add files via upload 6 years ago
StandWithYOU ba85e469ac
Add files via upload 6 years ago
StandWithYOU 5e6638547f
Add files via upload 6 years ago
StandWithYOU cfb13c8ef0
Update README.md 6 years ago
StandWithYOU b91b0c3e33
Update README.md 6 years ago
StandWithYOU 78d09700ea
Update README.md 6 years ago
Cadwalader 80cd95f334 更新canvasjs.js至3.2.6 GA 6 years ago
Cadwalader d14e8f8115
Update README.md 6 years ago
Cadwalader 025bbeb9d3 Add support for CFW exe file 6 years ago
Cadwalader bc49882353
Update README.md 6 years ago
Cadwalader e3eab497ae Update canvasjs.js version to 3.2 6 years ago
Cadwalader 5645bb1b1a
Update malio.js 6 years ago
Cadwalader 18ecb3723f Revert "Update README.md"
This reverts commit a822b502b2.
6 years ago
Cadwalader a822b502b2
Update README.md 6 years ago
Cadwalader af02fc0efb
Update README.md
更改 CREDIT 和 AFF
6 years ago
Cadwalader fdf582dcdf 更新CFW教程图片 6 years ago
Cadwalader 882aa266cb
Update README.md 6 years ago
Cadwalader d19cd32055
Update README.md 6 years ago
Cadwalader 62d8f8ead8
解密malio.js文件 6 years ago
Cadwalader 1f87696d86
Update README.md 6 years ago
Cadwalader e6a23af95f
Update README.md 6 years ago
Cadwalader 04d20e52f6
Update README.md 6 years ago
GeekQu 53e817431c chore(clash): update some fields 6 years ago
Malio 28213af6ba Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
Malio d7d536c79d 支持materialpay 7 years ago
Masivro 8043684bf6 Merge branch 'malio' into 'malio'
feat(js): 更正 JS 轮询逻辑问题

See merge request masivro/malio-theme-for-sspanel!48
7 years ago
孔雀 deeb5ecdac feat(js): 更正 JS 轮询逻辑问题 7 years ago
Masivro 4bb967085a Merge branch 'patch-2' into 'malio'
fix bug with af2a7d2a

See merge request masivro/malio-theme-for-sspanel!47
7 years ago
孔雀 f9fb905aa8
! fix bug 7 years ago
Masivro 8701e6ed2b Merge branch 'patch-1' into 'malio'
fix bug:修复index中迄今为止部分从i18n.php获取数据的名称错误

See merge request masivro/malio-theme-for-sspanel!36
7 years ago
Masivro 2c05cd08e3 Merge branch 'patch-3' into 'malio'
fix bug:修复Malio_Config['support_sub_type']在user/index.tpl中失效的问题,并调整了button顺序

See merge request masivro/malio-theme-for-sspanel!38
7 years ago
Masivro a05176d2b6 Merge branch 'patch-2' into 'malio'
add config custom_invite_price

See merge request masivro/malio-theme-for-sspanel!41
7 years ago
Masivro b4c7d13296 Merge branch 'patch-1' into 'malio'
修复最近72小时流量图表在单次流量记录超过1g的情况下无法正常显示的bug。

See merge request masivro/malio-theme-for-sspanel!44
7 years ago
Masivro 23014aad36 Merge branch 'patch-1' into 'malio'
修复重置周期最后一天的下次重置显示问题

See merge request masivro/malio-theme-for-sspanel!42
7 years ago
Masivro ed481f683d Merge branch 'patch-2' into 'malio'
fix quantumult

See merge request masivro/malio-theme-for-sspanel!43
7 years ago
Masivro b1aa5090f6 Merge branch 'patch-2' into 'malio'
删除 .config.example.php 中支付系统里重复的tomatopay设置

See merge request masivro/malio-theme-for-sspanel!37
7 years ago
Masivro 171c39bb87 Merge branch 'patch-1' into 'malio'
Support Trojan

See merge request masivro/malio-theme-for-sspanel!46
7 years ago
孔雀 af2a7d2a41
Support Trojan 7 years ago
Malio 493d0232aa 修改tg bot绑定方式为发送绑定码 7 years ago
Liu Yunsan 0ec4414b33 修复最近72小时流量图表在单次流量记录超过1g的情况下无法正常显示的bug。 7 years ago
MigSro df8a2b2190 fix quantumult 7 years ago
lithromantic 196a8bc151 修复重置周期最后一天的下次重置显示问题 7 years ago
matt 8a56a0ba90 add config custom_invite_price 7 years ago
Masivro 69fedbcbf3 Merge branch 'patch-1' into 'malio'
fix bug: V2RayN 格式修正

See merge request masivro/malio-theme-for-sspanel!39
7 years ago
孔雀 a3f0c7ece6 fix bug: V2RayN 格式修正 7 years ago
Sanqian ed9c1eb7bb fix bug:修复Malio_Config['support_sub_type']在user/index.tpl中失效的问题,并调整了button顺序 7 years ago
Sanqian 1ba142cd90 删除 .config.example.php 中支付系统里重复的tomatopay设置 7 years ago
Sanqian a902d4e60d fix bug:修复index中迄今为止部分从i18n.php获取数据的名称错误 7 years ago
Malio 69e4d22e4a fix bug: 任何Key均可获取用户信息 by Gtary 7 years ago
Malio e350d32b1a fix bugs 7 years ago
Malio f57ffdfb0a fix bugs 7 years ago
Malio c38ab82d42 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio
# Conflicts:
#	app/Controllers/LinkController.php
7 years ago
Malio 76517c9172 Merge remote-tracking branch 'origin/dev' into malio
# Conflicts:
#	README.md
#	app/Command/Update.php
#	app/Command/XCat.php
#	app/Controllers/AuthController.php
#	app/Controllers/HomeController.php
#	app/Controllers/Mod_Mu/UserController.php
#	app/Controllers/UserController.php
#	app/Models/User.php
#	app/Services/Gateway/TomatoPay.php
#	app/Services/Gateway/YftPayUtil.php
#	app/Services/Payment.php
#	composer.json
#	config/.config.example.php
#	config/routes.php
7 years ago
GeekQu 8924e5fd82 修复或导致 XSS 注入的问题 7 years ago
GeekQu facc66d78a
Merge pull request #66 from GeekQu/dev
修复一些问题
7 years ago
GeekQu 787e8f16be
修复或导致 XSS 注入的问题 7 years ago
GeekQu 0185572e5c
修复 ssr 节点无法订阅的问题 7 years ago
GeekQu 1c455e0b3c
Merge branch 'pr/50' into dev 7 years ago
GeekQu b547121472
Merge pull request #49 from du5/patch-1
优化判断逻辑
7 years ago
Malio 4b75975399 支持锁定只使用一种语言 7 years ago
Malio b516a11f87 着陆页支持更换语言 7 years ago
Malio d971fa429e 支持Wolfpay,修复一些bug 7 years ago
v2rayv3 aa0e40e893 1. 修复ss+ws中的path设定,一直为空的bug
2. 修复小火箭订阅ss+ws peer设定,目前逻辑如下
   1. 如果没有额外参数host=情况下,则用第一个地址,或者server=的值
   2. 如果需要中转则 且 tls,额外参数如下 relayserver=中转地址|outside_poert=中转端口|server=落地地址|host=落地地址
7 years ago
v2rayv3 79e8b40dfd 统一在tls的时候,host必须是tls的域名。 感恩 7 years ago
Gtary 516344fa7b
Update UserController.php 7 years ago
Gtary 7da5fae5eb
优化判断逻辑 7 years ago
v2rayv3 73cdeb69a9 修复php 7.3 下 undefined offset的问题 7 years ago
v2rayv3 7e0f4fc5ce Merge branch 'dev' of github.com:v2rayv3/ss-panel-v3-mod_Uim into dev
merge
7 years ago
v2rayv3 c49fe18b2f 增加小火箭peer v2plugin 设定 7 years ago
GeekQu 3de1210f39
管理页面节点列表显示节点出口地址 7 years ago
GeekQu 784c82a50d
修复 Quantumult 订阅 over-tls host 错误 7 years ago
GeekQu 360d09d94b
修复 sub=2 订阅中 ss-v2plugin 节点缺 path 7 years ago
v2rayv3 68e1a92672
Update README.md 7 years ago
Malio edbebf43fd update 7 years ago
v2rayv3 90a746a633 和quan 统一使用host 7 years ago
v2rayv3 0cb6c62614 修复quan 中转host tls请求的时候使用中转域名的问题,默认host(落地域名)的值 7 years ago
GeekQu 4dc562a41d
更改为 Regex 7 years ago
GeekQu 0c042b3aee
可配置任意未知的命令触发 /help 的回复 7 years ago
GeekQu 735cbc129b
fix (PaymentWall) 7 years ago
Malio 5c1112b3a6 据说能修复当面付 7 years ago
GeekQu 2717862e29
去除无用 (Config) 7 years ago
GeekQu fe546e5024
Merge pull request #65 from GeekQu/dev
fix  (sql)
7 years ago
GeekQu 47f3813ec2 fix (sql) 7 years ago
Malio 7abed27b75 update 7 years ago
GeekQu 27542ca725
Merge pull request #64 from GeekQu/dev
20200130
7 years ago
GeekQu 13abb867dd 修改版本 7 years ago
GeekQu 9ff825c294 清理无用 (GeekQu.md) 7 years ago
GeekQu bd4fc024b2
去除无用 (relay_port_migration) 7 years ago
Malio 533d1423ff update 7 years ago
GeekQu d47bd98773
V2RayN 客户端支持附带节点信息下载 7 years ago
GeekQu 7c817b6174
修复无法获取 VMess kcp 节点 7 years ago
GeekQu 733a11048d
修复管理后台用户编辑解封时间不正确 7 years ago
GeekQu c010a67300
调整审计封禁手动封禁流程 7 years ago
GeekQu f6a94fbdf3
审计封禁支持所有节点对接方式 7 years ago
Malio c259030c9a 修复bug 7 years ago
GeekQu 7814d7ec83
Tools 格式化 7 years ago
GeekQu 2244627804
Merge pull request #63 from GeekQu/dev
修复些许问题
7 years ago
GeekQu ac5c582b76
修复 Surge、Clash 配置可能出现 null 7 years ago
GeekQu 5838189366
优化静态文件中的判断 7 years ago
GeekQu c3daab80cb
修复私聊发送 /my 触发的回复会被自动删除的问题 7 years ago
GeekQu 5a8b03a106
修复私聊发送 /menu 找不到用户时无回复的问题 7 years ago
GeekQu b3dac73008
调整 telegram bot 绑定流程:支持手动发送绑定码绑定 7 years ago
GeekQu dd41e26a0d
修复 SS/SSR 订阅无协议无 group 7 years ago
GeekQu 01e10aeaf0
修复管理员触发的 Bot 回复和 /start & /ping 命令触发的回复不会自动删除的问题 7 years ago
GeekQu 04e4ec061b
Merge pull request #62 from GeekQu/dev
修复一些问题
7 years ago
GeekQu 6415da3819
staff 增加版本以及说明为 UIM 修改版 7 years ago
GeekQu 3f39e56b52
fix(LinkController) 7 years ago
GeekQu e28ede416b
修复群组内可从他人消息中签到 7 years ago
GeekQu 81fc72a9b5
修复 Bot 用户启用显示为数值 7 years ago
GeekQu b2d1f1d6fe
使用 $_ENV 7 years ago
GeekQu 1a99f59c6f
增加用户命令删除任务 7 years ago
GeekQu aacef2eaec
修复在群组中点击签到后出现私聊菜单 7 years ago
GeekQu e12fa43ef4
fix(job) 7 years ago
GeekQu 441a081724
fix(job) 7 years ago
GeekQu 781c41f2ae
修改 Config 默认配置,避免初始坑 7 years ago
GeekQu 38ccb7960e
修 bug 7 years ago
GeekQu 4326f52b8e
可配置将订阅中单端口的信息去除 7 years ago
GeekQu ef84384ecc
去除无用 7 years ago
GeekQu 41dab53a8c
Update index.tpl 7 years ago
GeekQu 251f4095d1
调整已生效套餐查询的位置 7 years ago
GeekQu 6d8559c78b
调整优化 7 years ago
GeekQu f59c424407
去除订阅 sub=4&5 7 years ago
GeekQu 3661829e80
Merge pull request #47 from v2rayv3/dev
增加按照后台中转配置自动增加中转配置订阅信息
7 years ago
GeekQu b2df72ef79
添加缺少的文本 7 years ago
GeekQu 6c863f745b
管理员、用户查询增加套餐信息 7 years ago
GeekQu eaea2b336e
修改群组内 /my 显示 7 years ago
GeekQu 96f7a23400
Update UserCallback.php 7 years ago
GeekQu ae330b454c
账户解绑增加提示 7 years ago
GeekQu ee4060f8ab
优化调整 7 years ago
GeekQu 56cfbfe67d
遗漏 7 years ago
GeekQu 9465a24947
更改文件结构 7 years ago
GeekQu 48100a0f98
调整用户中心获取 ssd 链接 7 years ago
GeekQu 2b97a04e8f
调整、增加 SS-Android订阅 7 years ago
GeekQu 40848af02f
调整 7 years ago
Malio d56edcf7e2 尝试修复用户余额多倍到账的问题 7 years ago
GeekQu 4313d1e428
修复合并订阅的问题、重写 SSD 订阅 7 years ago
GeekQu ae6eca628b
修复 Clash Provider 的部分问题、重新启用配置中的合并订阅选项 7 years ago
GeekQu 795bfe8af5
调整类型 7 years ago
GeekQu 66274de89c
... 7 years ago
GeekQu 4e6db25d6a
list 支持 extend 7 years ago
GeekQu 228158c84d
分离只获取节点而非整体配置的节点订阅 7 years ago
v2rayv3 134fe6cb29 增加按照后台中转配置自动增加中转配置订阅信息 7 years ago
GeekQu 7204c32e9e
订阅缓存数量限制 7 years ago
GeekQu 8e61ac1175
文档中心页面引入可获取支持的订阅链接关键词 7 years ago
GeekQu 2a6b4ba9d6
Update main.tpl 7 years ago
GeekQu 07a6120651
Bot 细节调整 7 years ago
GeekQu 9cbf3d88db
为长者续一秒 7 years ago
GeekQu 56099ff991
跟进 rico 7 years ago
GeekQu fe2fb3ae29
Merge branch 'pr/46' into dev 7 years ago
v2rayv3 05054f2910 localserver应该是add覆盖前的 7 years ago
v2rayv3 043ff80923 修复逻辑bug,应该是peer是落地的地址信息 7 years ago
v2rayv3 1514e36e44 漏了符号 7 years ago
v2rayv3 d1c0bf6d5d 小火箭添加peer设定,这里是默认是add,如果relayserver存在,方便中转,小伙伴测试可用 7 years ago
GeekQu 2ee42af5f5
api提供用户限制ip数量的配置信息 7 years ago
GeekQu 239e2fc6d2
继续替换each 7 years ago
GeekQu 157805d495
修复7.2 及其以上的bug 7 years ago
GeekQu 08eefe35e6
修复ip判断 7 years ago
GeekQu b4f7bf6e55
删除不需要的f 7 years ago
GeekQu 8fed9d184c
更新api url 7 years ago
GeekQu 1723af4419
update 7 years ago
GeekQu 7eaaf1addf
IDPAY 7 years ago
GeekQu 133918163b
修复tomataopay 7 years ago
GeekQu 3edc891722
先增加tomatopay 7 years ago
GeekQu 02fdf1e90d
Update glzjin_all.sql 7 years ago
GeekQu 049f71d913
Bot +1 7 years ago
GeekQu 478339ff4f
Update Node.php 7 years ago
GeekQu e95205d203
Update Node.php 7 years ago
GeekQu 0d2b25b4e2
修复 ssd 订阅, 7 years ago
GeekQu 4009d7d883
rico obfs 7 years ago
GeekQu 12ecd51269
Bot +1 7 years ago
GeekQu 758b4272ff
Update glzjin_all.sql 7 years ago
GeekQu f20a405c0c
Create telegram_tasks.sql 7 years ago
GeekQu 730a6e432a
定时任务增加判断 7 years ago
GeekQu 15d9462d3e
Bot +1 7 years ago
GeekQu 41a44f3c12
用户中心显示套餐已使用天数、下次流量重置时间、套餐过期时间 7 years ago
GeekQu d7d83c2b0d
单用户购买记录页 添加套餐 7 years ago
GeekQu 6b9d5800d3
单用户购买记录页 删除记录 7 years ago
GeekQu 6d6a01b3e9
Bot +1 7 years ago
Max f8b08a0bb6 修复繁体不显示文本的问题 7 years ago
GeekQu fa7933966f
单用户购买记录页 7 years ago
GeekQu 06483130dd
Bot +1 7 years ago
GeekQu efa11e17e3
Bot +1 7 years ago
GeekQu 9079c21340
Bot +1 7 years ago
GeekQu 691aef4578
修 7 years ago
GeekQu f6f1267e28
Bot +1 7 years ago
GeekQu f922d60e9d
Bot +1 7 years ago
GeekQu 5c5de895e8
Bot +1 7 years ago
GeekQu 5873a37fed
Bot +1 7 years ago
GeekQu 34569c5dc2
Bot +1 7 years ago
GeekQu df9f9009a5
Bot +1 7 years ago
GeekQu a04c1755d2
Bot +1 7 years ago
GeekQu e8be1d0a39
Bot 资料编辑菜单增加解绑账户 7 years ago
GeekQu a709cfae54
Telegram Bot +1 7 years ago
GeekQu 30b8239dd6
Bot 支持下载 Surge 2&3 配置 7 years ago
GeekQu cd20d8c37a
修改 Quantumult、支持 QuantumultX 7 years ago
GeekQu cc96e2e3b5
f 7 years ago
GeekQu 73afc143cd
分离 URI 生成 7 years ago
Max bc7e18e211 增加为不同等级给不同的签到流量的功能(定制功能) 7 years ago
Max b57e618ee3 2019 to 2020 7 years ago
Max c37c12d8a4 update 7 years ago
GeekQu 78b378b978
Telegram Bot 7 years ago
Max 5dff6c4ce1 修复首页在中文下缺失文本的bug 7 years ago
Max 4ac06220b9 修复一堆i18n造成的bug 7 years ago
Max 3cd4017f37 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio
# Conflicts:
#	config/.malio_config.example.php
#	config/routes.php
#	resources/views/malio/index.tpl
#	resources/views/malio/user/code.tpl
#	resources/views/malio/user/index.tpl
#	resources/views/malio/user/shop.tpl
7 years ago
Max 6bdc510cf2 增加多语言支持 7 years ago
Max 096228c6c7 修复试用套餐购买不了的问题 7 years ago
GeekQu 4fc6ae0db4
Telegram Bot 7 years ago
GeekQu 438b4fe3a4
Telegram Bot 7 years ago
GeekQu c0fb19dbf4
Telegram Bot 7 years ago
GeekQu b6fc28819e
Telegram Bot 7 years ago
Max 5eff0b6a01 修复可以重复试用的bug 7 years ago
GeekQu d1c3e9cf9c
Telegram Bot 7 years ago
GeekQu 7669cf7768
Telegram Bot 7 years ago
GeekQu cd529f5657
Telegram Bot 7 years ago
GeekQu 95a437f04b
Telegram Bot 7 years ago
GeekQu e76026a5d8
Telegram Bot 7 years ago
GeekQu 339dfaac21
Telegram Bot 7 years ago
GeekQu 006250ff76
Telegram Bot 7 years ago
GeekQu 487cefb418
Telegram Bot 7 years ago
GeekQu dbb3bd7751
Telegram Bot 7 years ago
GeekQu 33aeabf077
Telegram Bot 7 years ago
GeekQu fa6026c4c9 Telegram Bot 7 years ago
Max 952825b7d4 修复聚合支付的番茄云支付 7 years ago
Max e554b29711 Malio聚合支付支持Stripe 7 years ago
Max 5061561e71 admin面板增加收入情况和新用户统计功能 7 years ago
GeekQu 6ab5fcd17e
Telegram Bot 7 years ago
GeekQu 086f4c5b58 修手欠 7 years ago
GeekQu 7b78b7800c
Telegram Bot 7 years ago
GeekQu 1ad8d806ac Telegram Bot 7 years ago
GeekQu 5afc5e0ac9
Telegram Bot 7 years ago
GeekQu 609bc6ed1c
Telegram Bot 7 years ago
GeekQu 0dabf932f9
Telegram Bot 7 years ago
GeekQu 653e82f1c4
Telegram Bot 7 years ago
GeekQu ca36add3f9
修 bot setWebhook 错误提示 7 years ago
GeekQu b889f2b366
Telegram Bot 7 years ago
GeekQu 36f167c0dd
Update Message.php 7 years ago
GeekQu a797a8d2b3
Update Message.php 7 years ago
GeekQu 94d822a708
Telegram Bot 7 years ago
GeekQu 1ca33982b2
修手残 7 years ago
GeekQu b2d78c0d63
Telegram Bot 7 years ago
Max 3dc8e6001a 防止充值金额重复到账 7 years ago
GeekQu e775d9a329
Telegram Bot 7 years ago
Max 5eee24df84 修复刚写的支付回调bug 7 years ago
Max 5e7b07d256 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
Max dd532ab945 支持Clash for Android一键导入配置 7 years ago
Max 4c19b026a9 Merge branch 'patch-1' into 'malio'
fix bug with Coupon code

See merge request maxitio/malio-theme-for-sspanel!24
7 years ago
Max 9c994800cc 修复聚合支付回调失败的问题 7 years ago
孔雀 e704107a5d Update UserController.php 7 years ago
limiyun d645c8659e fix bug with Coupon code 7 years ago
Max 98d9f04c68 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
Max 1dc1d9e555 新增 Clash for Android 教程 7 years ago
Max 545c021013 Merge branch 'malio' into 'malio'
Malio 支持开启用户中心弹窗24小时只弹一次

See merge request maxitio/malio-theme-for-sspanel!23
7 years ago
Leeze 64589d8e03 Malio 支持开启用户中心弹窗24小时只弹一次 7 years ago
Max 0567e05d80 聚合支付接口支持支付宝当面付 7 years ago
Max e2773f5a2d 添加聚合支付系统的功能 7 years ago
GeekQu ff4177668b
网站侧栏显示配置 7 years ago
GeekQu a984e01afb
修复显示问题 7 years ago
Max f6f88fc19a 现在爬虫再也看不到SSPANEL字样了,Staff也看不到,只有用访问浏览器才能看到 7 years ago
Max 1fd4b4a8e3 修tg bot 7 years ago
GeekQu 90958f2aa1
修改提示 7 years ago
GeekQu 78a7c0ff14
Xcat 增加清理订阅缓存,增删改节点、增删改中转规则时清理订阅缓存 7 years ago
GeekQu 3b85685260
Update .gitignore 7 years ago
Max e89a266572 修复crisp 7 years ago
GeekQu f02d933b8f
修复手贱 7 years ago
GeekQu 3150594b86
修复上一条commit遗漏 7 years ago
GeekQu 6997a7fb0c
telegram 推送使用数据库内的配置 7 years ago
GeekQu a116d92e00
后台清理用户订阅缓存增加成功提示 7 years ago
GeekQu 513697ea18
优化订阅 token 查询 7 years ago
GeekQu d4ce819dc5
美化一下 7 years ago
Max 14c4db9be5 更新config.php 7 years ago
Max edaad4aec6 Merge branch 'dev' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio
# Conflicts:
#	README.md
#	app/Command/Update.php
#	app/Controllers/UserController.php
#	app/Middleware/Mod_Mu.php
#	app/Models/User.php
#	app/Services/Gateway/TomatoPay.php
#	app/Services/Payment.php
#	app/Utils/TelegramProcess.php
#	app/Utils/URL.php
#	config/.config.example.php
7 years ago
Rico a8f2224484 先增加tomatopay 7 years ago
maxitio 9c6a7a6bb2 修复节点列表v2节点越级显示信息的问题 7 years ago
maxitio e9df462cf6 修复节点列表复制不了vmess链接的问题 7 years ago
GeekQu 8f7c22a991
Merge branch 'dev' of https://github.com/GeekQu/ss-panel-v3-mod_Uim into dev 7 years ago
GeekQu 083826931a
后台用户编辑未开启订阅缓存时不显示清理选项 7 years ago
GeekQu 23390cd207
订阅缓存增加 header 可识别 7 years ago
maxitio 6973056f12 更新flyfoxpay的api地址 7 years ago
GeekQu 2911b9e7a7
Merge branch 'pr/60' into dev 7 years ago
GeekQu 8b004688c9
修复端口偏移 7 years ago
GeekQu 457e4277ca
用户修改连接密码、重置端口、更改加密协议混淆、重置订阅链接、以及删除账户时自动清理订阅缓存 7 years ago
GeekQu 96db900a6b
增强判断 7 years ago
GeekQu b57f817475
Merge pull request #44 from Anankke/dev
merge 20191128
7 years ago
Rico 659bc38af8 逗比了,正常的 7 years ago
Rico c210019290 添加小火箭h2订阅,暂时不允许 跳过证书验证,应为测试连不上 7 years ago
Rico 894cec5373 修复 节点显示问题 7 years ago
Rico aa1fe9be44 1.删除用户页面v2ray中转设置
2.管理员中转配置,Port是指本地监听,只能中转V2ray相关节点配置
7 years ago
Rico c2a09434b9 增加kit对tls的支持,增加kit对h2的订阅支持,clash过滤h2协议,shadowrocket过滤h2,quan 过滤h2 7 years ago
Rico 95e96d2c99 测试增加小火箭 mkcp订阅支持 7 years ago
Rico e5e244d0b4 修复 V2rayNG 教程链接 7 years ago
Rico 4cabe238f9 修复 quan的完整订阅 tgbot 7 years ago
Rico 16f003a1bb 修复 clash tag的问题 傻逼bug 7 years ago
Rico ee6f8b86db Merge branch 'no_ymq_dev' into dev 7 years ago
Rico c9b3d22040 修复 流水统计的报错 7 years ago
SakuraSa233 57de09ea4a
fix(vue-controller): default return 7 years ago
SakuraSa233 ab60f5c7c8
fix(vue): return type, logic, bad code style(incompletely) 7 years ago
laurieryayoi d68337872e fix console.log warning 7 years ago
Sukka b6135efc88
github(issue_template): add zh-CN version 7 years ago
laurieryayoi e7ac0b9562 布尔值判断去引号 & 添加nodeinfo相关代码 7 years ago
laurieryayoi d809788106 Merge branch 'dev' of https://github.com/Anankke/SSPanel-Uim into dev 7 years ago
laurieryayoi c2bf1dc952 添加nodeinfo api 7 years ago
SakuraSa233 be32a13c9b
feat(github): multi issue template 7 years ago
GeekQu 777c409031
修改 ss-v2ray-plugin 节点默认 host 为 microsoft.com 7 years ago
GeekQu e7700ee755
修复漏写 getUri()... 7 years ago
GeekQu c7d2b5f614
订阅信息缓存 7 years ago
SakuraSa233 30654b7cd2
clean(trimepay): clean template file 7 years ago
SakuraSa233 a647590326
Revert "clean(payment): remove unused paymentwall"
This reverts commit 67af63b052.
7 years ago
SakuraSa233 931eb9d1d2
refactor(controller): base slim-http native json output 7 years ago
maxitio 7c60d3fe41 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio 04c0e4d7a4 update readme.md 7 years ago
Rico d3c1ae3f20 改成布朗 7 years ago
Rico 3c84838193 明确问题 7 years ago
Rico aded91b730 增加开关是否验证node ip 7 years ago
SakuraSa233 e1127e863a
refactor(qrcode): local decode with better perf 7 years ago
SakuraSa233 9b0cd43a2e
clean(services): remove empty cache class 7 years ago
SakuraSa233 e9e59e4dcb
clean(service): remove unused "token" 7 years ago
SakuraSa233 6996425e9b
clean(auth): remove empty class 7 years ago
SakuraSa233 67af63b052
clean(payment): remove unused paymentwall 7 years ago
SakuraSa233 0449eed1fe
fix(ci): boolean config variable 7 years ago
GeekQu b8d383f8f3
可用 Xcat 执行配置新增检测 7 years ago
GeekQu f0cb4b710a
修复 7 years ago
GeekQu 4f312527ae
网站配置 7 years ago
Anankke d69fb6b1b8
Merge pull request #870 from regendsoh/patch-1
Fix: Remove preset value of $_ENV['reg_obfs_param']
7 years ago
Anankke 000abaa4d7
Merge pull request #872 from xcxnig/dev
clean(discord): remove invalid discord config
7 years ago
Miku 9dfd9e992a
Update UserController.php 7 years ago
Miku 90f11f9e50
Update config.php 7 years ago
Miku 8bfa574c7f
Update Config.php 7 years ago
Regend Soh ad160e46f7
Fix: Remove preset value of $_ENV['reg_obfs_param']
To avoid problem when setting up SSPanel for idiotic user.
防止傻逼不会弄单端口
7 years ago
TheCGDF 38283cf96d 调整:当余额高于auto_clean_min_money时,即使账户到期后也不会被删除。避免歧义 7 years ago
錢爸爸 67334f8abf
Change style 7 years ago
錢爸爸 56ebebf928
Change style 7 years ago
GeekQu 8546a43f9e
修复 7 years ago
GeekQu 895410e80f
术后修复 7 years ago
GeekQu 3c063f5b4b
Merge branch 'pr/43' into dev 7 years ago
Anankke ccac5960ff
Merge pull request #867 from xcxnig/dev
Optimize link alignment
7 years ago
Miku 9c905ff215
Optimize link alignment 7 years ago
SakuraSa233 051ffc57f9
clean(cloudxns): remove mostly unused cloudxns 7 years ago
SakuraSa233 74e5f87b84
feat(conf): un-string variable type 7 years ago
SakuraSa233 d01adce482
clean(discord): remove invalid discord bot 7 years ago
SakuraSa233 8d7e1f9293
refactor(middleware): refactor ModMu for better perf(?) 7 years ago
SakuraSa233 0fecd8600b
perf(auth): user identification cache 7 years ago
SakuraSa233 082f7c5a00
fix(middleware): correct comment 7 years ago
SakuraSa233 e40e820135
clean(utils): remove unused Helper class 7 years ago
SakuraSa233 d06ebb83c4
refactor(middleware): style refactor and optimize 7 years ago
SakuraSa233 2dbdf2a25c
clean(controller): remove prorietary ApiController 7 years ago
SakuraSa233 a98ff85079
clean(utils): remove unused utils classes 7 years ago
SakuraSa233 6be1abfaf1
fix(tmt-pay): response return 7 years ago
SakuraSa233 83db32626f
clean(services): remove unused Slim class 7 years ago
SakuraSa233 b56272fe07
clean(controller): remove prorietary client api controller 7 years ago
GeekQu 588696234e
更新说明 7 years ago
Rico cf12b34262 修改flag,看着不是很丑了 7 years ago
Rico dfa3e01157 中转tls,clash 增加skip-cert-verify=true 7 years ago
Anankke be379f66a9
Merge pull request #860 from zeva20/bugfix
fix(user) Fix missing obfs_param data
7 years ago
zeva20 accd82e754 fix(user) Fix missing obfs_param data 7 years ago
Rico ff2d944dbe 出去多余的一栏bitpay 7 years ago
錢爸爸 0a4f629226
random gravatar avatar 7 years ago
GeekQu eed442a52b
Update PortAutoChange.php 7 years ago
GeekQu 3aabb5c58a PortAutoChange 7 years ago
Rico 52b1e8ca1d 修改quan,在有relayserver和tls的前提下,允许非安全 7 years ago
GeekQu 245f584a9e 修复 IPv6 访问订阅出现的问题 7 years ago
Rico 273e6c39c2 修改小火箭,在有relayserver和tls的前提下,允许非安全 7 years ago
錢爸爸 da7ca38780
admin/user add obfs_param
就是喜歡在web直接水Commit
7 years ago
錢爸爸 30e24b24c3
admin/user add obfs_param 7 years ago
SakuraSa233 c0eee00f74
refactor(tmtpay): style refactor and code optimize 7 years ago
SakuraSa233 6d918b8c11
feat(payment): add comments for AbstractPayment function 7 years ago
SakuraSa233 1c6b49555d
fix(routes): remove Mu middleware and controller 7 years ago
SakuraSa233 04899474d3
fix(tree): remove unused files 7 years ago
SakuraSa233 c358c7ae45
fix(payment): remove invalid DoiAmPay 7 years ago
SakuraSa233 fd4aa61bb9
fix(payment): remove invalid TrimePay 7 years ago
Regend Soh 1279aea9cf Fix: MySQL 8.0 support for income calculation (#856)
* Fix: MySQL 8.0 support for income calculation

* Fix: MySQL 8.0 support for income calculation
7 years ago
Regend Soh 110229fe5a feat: 接入番茄支付平台 (#855)
这是好的
7 years ago
錢爸爸 6c2830c0db
Update README.md 7 years ago
GeekQu 30e7577b86 Create PortAutoChange.php 7 years ago
GeekQu b45874673e 修用户订阅记录页面 7 years ago
GeekQu 279826e328 修复 Quantumult 教程页导入 V2Ray 订阅链接 7 years ago
maxitio a8e24fce50 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio d0b6f0e677 支持win ssr一键导入 7 years ago
Max 26e9dcf7d0 Merge branch 'patch-1' into 'malio'
@coder_bts 提供的臨時郵箱黑名單

See merge request maxitio/malio-theme-for-sspanel!20
7 years ago
maxitio 6891c895f4 支持易付通yftpay 7 years ago
maxitio 9c5f3b0303 修复邀请码bug 7 years ago
maxitio ea69862bdb 节点列表支持自定义等级和等级名字了 7 years ago
qwq 87a191a961 @coder_bts 提供的臨時郵箱黑名單 7 years ago
Anankke 9b0005b013
Merge pull request #850 from regendsoh/patch-3
Fix bug: display last month Income
7 years ago
Regend Soh e4329a7661
Fix bug: display last month Income
Ref: https://stackoverflow.com/questions/19727274/strtotime-bug-when-using-1-month-from-january
7 years ago
maxitio 5576d97e2a fix bugs 7 years ago
Anankke 9f24cffb73
Merge pull request #849 from GeekQu/Anankke_dev
包含订阅信息的客户端下载方式
7 years ago
GeekQu 2db61fb807 包含订阅信息的客户端下载方式 7 years ago
GeekQu cf4b62966c
Merge pull request #42 from Anankke/dev
merge 20191027
7 years ago
maxitio e34671d4fd 修复一系列小bug 7 years ago
maxitio e26a94a2b3 修复工单bug 7 years ago
maxitio 51d784d52a 修复当邀请码注册为可选时会造成邀请次数为负数的bug 7 years ago
Anankke 1a8dd4d873
Merge pull request #846 from regendsoh/patch-2
Simplify if...else statement from previous commit
7 years ago
Regend Soh d217000ca2
Simplify if...else statement from previous commit
as mentioned.
7 years ago
SakuraSa233 a2e471d9f9
fix(composer): lost pagination
fix #844
7 years ago
Anankke 2782c532cc
Merge pull request #845 from regendsoh/patch-1
Fix bug for income calculation
7 years ago
Regend Soh 532f2f457f
Fix bug for income calculation
Fix bug as mentioned by @topjohncian
7 years ago
Anankke 9601dd3aa6
Merge pull request #835 from lifespy/dev
新增易付支付
7 years ago
GeekQu 7911c76057
Merge pull request #59 from GeekQu/dev
修复 Shadowrocket ss-v2ray-plugin 节点的编码错误
7 years ago
GeekQu 12ccc306d8 +1 7 years ago
GeekQu 60e82fc07f 修改客户端下载链接 7 years ago
GeekQu e9fa797b25 修复 Shadowrocket ss-v2ray-plugin 节点的编码错误 7 years ago
GeekQu b24f68098e ss && ssd 7 years ago
GeekQu 77c7f2e8c9 fix 7 years ago
TheCGDF c7140d35ad 修复签到后流量显示异常 7 years ago
GeekQu 42cf1b8749 Create README.md 7 years ago
GeekQu 31b53a0052 getPcClient 7 years ago
laurieryayoi 0e3e64b952 fix no-empty bug 7 years ago
laurieryayoi 2806ea97fa 节点列表v1 7 years ago
GeekQu f955323d3c getPcClient 7 years ago
GeekQu 0a4cda9047
Merge pull request #58 from GeekQu/dev
20191015
7 years ago
GeekQu 764b300582 修复 Surge 4 使用 Surge 2 规则的问题 7 years ago
GeekQu a8470bb0a3 修复缺失的判断 7 years ago
GeekQu 7a7ec8a192 分离 YAML2Array 7 years ago
GeekQu fea0fc9580 telegram 推送自定义设置 2 7 years ago
GeekQu 5bc4a557b7 修改 sendDiary_Msg 7 years ago
SakuraSa233 972bd1ede8
feat(git): update contribute guide 7 years ago
SakuraSa233 8082ea7bb2
feat(controller): refactor HomeController as standard 7 years ago
SakuraSa233 093dbc3d48
fix(composer): clean php dependencies 7 years ago
GeekQu 805e602d5a telegram 推送自定义设置 7 years ago
GeekQu a835ba415b Update ConfController.php 7 years ago
GeekQu ae58db22ee 术后修复 7 years ago
GeekQu 647efbecc7 Merge branch 'pr/41' into dev 7 years ago
maxitio 340ac718f6 修复chatra,并分离出汉化文件供自定义语句 7 years ago
maxitio 5c7baf7068 邮箱注册白名单和黑名单 7 years ago
Anankke 51a10a31b6
Merge pull request #838 from NS-Sp4ce/dev
修复安卓V2RayNG链接错误
7 years ago
Sp4ce 7fc7046290
修复安卓V2RayNG链接错误
修复安卓V2RayNG链接错误
7 years ago
GeekQu 44bcbbcb6f 修复 Base64_url_encode 带来的兼容问题 7 years ago
GeekQu 7a7a7d8044 2333 7 years ago
GeekQu 7516dfcf83 修复 Quantumult SS 订阅的兼容问题 7 years ago
GeekQu 87d178fd29 Update index.tpl 7 years ago
GeekQu 36799fc57b 为 Clash VMess 加入 udp 字段 7 years ago
GeekQu 9beb73c5a0 重写订阅中的用户账户到期及流量展示,现在可以在 Config 配置为订阅添加一些简短的公告了 7 years ago
GeekQu f4c1688f84 可移除 SS 节点名称中的站点名 7 years ago
lifespy c4e38e84d3 yft 7 years ago
GeekQu 53c9578796 解决 Quantumult SS 订阅提示无 group 的问题 7 years ago
maxitio b058977406 修复因为手机验证码而无法注册的bug 7 years ago
maxitio 9cc5619fbd 修复 sms_verify.sql 导入失败的问题 7 years ago
maxitio 46ab110c8b Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio c888980129 支持短信验证码功能 7 years ago
GeekQu 6dab034a26 emoji 7 years ago
GeekQu 198a29c568 修复用户中心Quantumult导入V2Ray订阅的链接 7 years ago
GeekQu 82e77f9054 修复Quantumult教程页手动导入V2Ray订阅链接 7 years ago
TheCGDF 275941191f V2rayU -> ssr-download 7 years ago
maxitio 48e06a78e4 修复chatra bug和侧边栏部分优化 7 years ago
maxitio 4d586be4a1 修复刚写的bug 7 years ago
maxitio 0890287f1f 合并 surge 托管配置按钮,增加surge4按钮 7 years ago
maxitio 13277cae81 修复会出现重复uuid的问题,增加注册时自动生成uuid的代码 7 years ago
maxitio ad88680eff 修复chatra在未登录时不显示的问题 7 years ago
maxitio 30933e9051 修复用户注册时会重复注册的问题 7 years ago
maxitio 9986c06833 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio 5d1dc6b8fc malio_config增加订阅显示等级过期日和流量信息的开关 7 years ago
Max bc9a9ca0b8 Merge branch 'dev' into 'malio'
PR 2019-10-06

See merge request maxitio/malio-theme-for-sspanel!19
7 years ago
GeekQu af6aa9f7a3
Merge pull request #57 from GeekQu/dev
20191006
7 years ago
GeekQu 4a5b63fcfa Surge 4 以及 ClashR 显示 7 years ago
maxitio dd0c0b471e Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio c85ad3a6a2 fix 7 years ago
maxitio 1b43d82320 增加登录后弹出式公告(定制) 7 years ago
GeekQu 9486df11da 支持 Surge 的新特性 7 years ago
laurieryayoi ed70ab3ed8 替换update中的System_config为_ENV 7 years ago
GeekQu 9cfa7f5c79 审计封禁可添加例外用户 7 years ago
Regend Soh d747eedadd config: update default params(#829)
避免小白继续祸害各大运营商IP
7 years ago
GeekQu 00ba947172 喜迎国庆 +1s 7 years ago
Max 003817fc9f Merge branch 'dev' into 'malio'
PR 2019-09-30

See merge request maxitio/malio-theme-for-sspanel!18
7 years ago
Max e6a6bcf333 Merge branch 'malio' into 'malio'
fix: relay/add.tpl with #77

See merge request maxitio/malio-theme-for-sspanel!17
7 years ago
iplcm 5a3016d4b8
fix: relay/add.tpl with #77 7 years ago
Rico 202fd74361 增加中转的server key 是relayserver 7 years ago
maxitio 6e9f086a87 试用套餐支持自定义价格 7 years ago
錢爸爸 576e9e5b98
Update README.md 7 years ago
錢爸爸 8d5b103234
fix:Gravatar url 7 years ago
Anankke e42e5ee3e0 refactor: 129137b773 (r35233741) 7 years ago
SukkaW e1907e3b7b refactor(gravatar): minor updates 7 years ago
maxitio 93daffbaae 我的钱包页面增加固定充值金额的功能,支持隐藏我的钱包页面 7 years ago
GeekQu 8299672362
Merge pull request #56 from GeekQu/dev
20190925
7 years ago
GeekQu 66030bbe3c 修复节点使用了端口偏移时 SSD 订阅的问题 7 years ago
GeekQu 191d1ccb57 修复资料编辑中的重置订阅链接以及切换配置 7 years ago
Regend Soh 8916041998 feat: add copy button for node SSR and SS link (#816)
* Add copy button for node SSR and SS link

* Remove unnecessary script
7 years ago
Regend Soh c92a52df64 feat: add function to display disable reason for disabled accounts (#815)
* Add disableReason Function

* Added disable reason based on 审计规则
7 years ago
錢爸爸 a7503a8207
Restore Gravatar function & Add set Avatar 7 years ago
錢爸爸 129137b773
Restore Gravatar function 7 years ago
Regend Soh 84ad7f2bf3 feat: add paid user count feature (#814)
* Add paidUserCount function

* Add display of paidUserCount
7 years ago
GeekQu cbd1c5b57f 修排版 7 years ago
GeekQu e6519b4ef1 修改默认 7 years ago
GeekQu be0cb7f93a 审计封禁 7 years ago
Regend Soh 89ea1b75d8 feat: add display income feature (#813)
* Adding income calculation function

Below functions are added:
- yesterday_income()
- today_income()
- this_month_income()
- last_month_income()
- total_income()

* Add income display on /admin/code page

Display the following information at /admin/code
- Today's income
- Yesterday's income
- This month's income
- Last month's income
- Total income

* Reformatting code style

Reformat the code, attempting to follow the standard required.

* Refactor to camel case naming

* Refactor to camel case naming

* Reformat due to spacing and tabbing issue
7 years ago
GeekQu a6df534356 fix 7 years ago
Anankke 797bd35f1b revert: "fix(init): remove default http forward header handle"
This reverts commit 040e987a
7 years ago
SakuraSa233 189bbf9026
fix(ci): sync test config file 7 years ago
SakuraSa233 91b2bf2016
feat(config): store config to $_ENV 7 years ago
SakuraSa233 fb8bd622fb
clean(services\config): unused env set function 7 years ago
SakuraSa233 040e987aa6
fix(init): remove default http forward header handle 7 years ago
Regend Soh badc98f29e feat(admin): add aff id change function
* 添加修改用户邀请者

* 添加 chginvite 路由

* 添加chgInvite function
7 years ago
Anankke 76d7d586d9
Merge pull request #807 from wewall/patch-2
fix error(user/index): rm obsolete code
7 years ago
围墙 bc05bb18ff
fix error(user/index): rm obsolete code 7 years ago
NimaQu 66f8d8bc8f
Update README.md 7 years ago
Anankke 85306ae54d
Merge pull request #803 from pang-w/dev
#801 修复暴力获取mu参数引发的错误。
7 years ago
Pw 8d5122c7b4 * 修复暴力获取mu参数引发的错误。
* 简单优化没有mu参数的逻辑。
7 years ago
GeekQu 62e229e3c6
Merge pull request #55 from GeekQu/dev
修复一些问题并且加入了用户订阅记录自动清理,可在 Config 中配置保留天数
7 years ago
maxitio 146de086b4 修复教程里v2rayng无法复制订阅链接的问题 7 years ago
maxitio aeaebe7b45 我的钱包页面和商店页面增加银联支付的选项(payssion) 7 years ago
maxitio d3fc79a23e 支持 Payssion 支付系统 7 years ago
GeekQu 2135c4c300 从 getAllItems 分离 SS V2RayPlugin 节点 7 years ago
GeekQu 8648e42477 加入用户订阅记录清理 7 years ago
GeekQu 5b3a57c5cc 优化可读性 7 years ago
GeekQu c29c14930a 修复使用 noclass 的问题 7 years ago
GeekQu 2e03e2fcba 修复使用 noclass 的问题 7 years ago
Max 0af4ca452a Merge branch 'dev' into 'malio'
Merge Request 2019-09-14

See merge request maxitio/malio-theme-for-sspanel!16
7 years ago
GeekQu 3cc41dea63
Merge pull request #54 from GeekQu/dev
订阅可通过正则筛选节点,详查 https://678765.xyz/2019/13.html
7 years ago
GeekQu db63baeb47 ??? 7 years ago
GeekQu 2373a4557a fix 7 years ago
GeekQu 6ecf279774 订阅可通过正则筛选节点 7 years ago
Max c07d971eae Merge branch 'dev' into 'malio'
Merge Request 2019-09-13

See merge request maxitio/malio-theme-for-sspanel!15
7 years ago
Max 93a20db84f Merge branch 'malio' into 'dev'
# Conflicts:
#   app/Controllers/Mod_Mu/UserController.php
#   composer.json
7 years ago
GeekQu 123fb28cb2
Merge pull request #53 from GeekQu/dev
更新
7 years ago
GeekQu 90fe6def61 ClashR 兼容性,用户手动修改订阅链接 clash=2 即可 7 years ago
GeekQu bb805d65a4 Merge branch 'pr/40' into Anankke_dev 7 years ago
GeekQu 11353c5364 Merge branch 'pr/39' into dev 7 years ago
maxitio f88e4ec68c 修复 Stripe 限制最低充值金额不生效的bug 7 years ago
maxitio f148bc9d90 修复stripe货币设置为hkd时无法使用的bug 7 years ago
GeekQu 4e6002fcd6 修复 7 years ago
GeekQu f1a7996979 现在可以配置为中转规则直接下发偏移后的端口了 7 years ago
SakuraSa233 1811fc0aaa
refactor(composer): clean composer.json 7 years ago
GeekQu 4407015e46 现在可以配置为后端直接下发偏移后的端口了 7 years ago
GeekQu ed0d9fde04 优化流量耗尽用户限速至 1Mbps 7 years ago
maxitio d5957b86c8 stripe支付支持自定义货币 7 years ago
Anankke 0619513890
fix: 修复不能识别$debug字段, 本地开发环境无法进入index的bug
py(划掉)pr
7 years ago
czn ecf3f67d04 fix: 修复不能识别$debug字段, 本地开发环境无法进入index的bug 7 years ago
maxitio ac4cba7694 修复刚写的bitpayx的bug 7 years ago
maxitio ae61a876f1 现在可以切换bitpayx的支付宝类型了,在malio_config切换 7 years ago
maxitio 4a6b2de019 修复刚刚创造的bug 7 years ago
maxitio eca2fe37d5 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio f8bcda612d 更新bitpayx 7 years ago
Max f26de621ed Merge branch 'dev' into 'malio'
Dev

See merge request maxitio/malio-theme-for-sspanel!14
7 years ago
Max adf612b328 Merge branch 'malio' into 'dev'
# Conflicts:
#   app/Controllers/LinkController.php
7 years ago
GeekQu 62453a365f
Merge pull request #52 from GeekQu/dev
修复
7 years ago
GeekQu 99c70fa767 修改默认策略组更适合新手 7 years ago
maxitio 0ac57122d0 spay居然没https 7 years ago
maxitio b4ca288073 Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio aa064e2b7c 更新Spay域名 7 years ago
Max 2b1741e001 Merge branch 'malio' into 'malio'
支持QQ邮箱用户爬取QQ头像

See merge request maxitio/malio-theme-for-sspanel!13
7 years ago
Bill Huang 46a184b289 支持QQ邮箱用户爬取QQ头像 7 years ago
GeekQu 10cc5c8764 fixed 7 years ago
Max 05218cf148 Merge branch 'dev' into 'malio'
Merge Request 2019-09-07

See merge request maxitio/malio-theme-for-sspanel!11
7 years ago
Max 84cf80dd79 Merge branch 'malio' into 'dev'
# Conflicts:
#   app/Controllers/LinkController.php
7 years ago
GeekQu a555aba078
Merge pull request #51 from GeekQu/dev
更精致的 Surge、Clash、Surfboard 策略组
7 years ago
GeekQu ec5091080f 修改 Surge、Clash、Surfboard 策略组 7 years ago
maxitio 030c2986b5 增加工单TG Bot通知 7 years ago
GeekQu e5f760e873 优化 Kitsunebi 订阅 7 years ago
maxitio 3e30834536 给 Crisp 和 Chatra 增加恢复对话的功能 7 years ago
maxitio 1777938cd9 支持 Chatra 客服系统 7 years ago
maxitio fe48719b55 用户中心增加订阅记录页面 7 years ago
maxitio 6220110fae 删除首页的keywords以及其他敏感词以减少被污染的概率 7 years ago
Max e67bc77e83 Merge branch 'dev' into 'malio'
Merge Request 2019-09-06

See merge request maxitio/malio-theme-for-sspanel!10
7 years ago
Max bc8e20ac00 Merge branch 'malio' into 'dev'
# Conflicts:
#   README.md
#   app/Command/Update.php
#   app/Controllers/UserController.php
#   app/Services/Payment.php
7 years ago
maxitio 9f15cdf088 支持 Stripe 支付接口 7 years ago
GeekQu 904ff16381
Merge pull request #50 from GeekQu/dev
merge
7 years ago
GeekQu 49fea06df7 可选用户流量耗尽后不断网 7 years ago
GeekQu 593241432b 减少因为加密协议混淆同时支持 ss & ssr 而导致 Shadowrocket 订阅出现大量重复节点 7 years ago
GeekQu ddcbd4fa0f V2Ray、Shadowsocks - V2Ray-Plugin 节点默认单端口多用户 7 years ago
GeekQu 15cdb0485d
Merge pull request #49 from GeekQu/dev
更新上游至 20190903
7 years ago
GeekQu 00eaeaf7b4
Merge branch 'dev' into dev 7 years ago
GeekQu 39d22fc924 用户订阅日志可选是否开启,开启请注意导入 user_subscribe_log.sql 7 years ago
GeekQu 175de83e40 用户可查询订阅记录 7 years ago
maxitio c764dd81cd 更新admin后台的tpl文件 7 years ago
maxitio 9fcb1efe8d Merge branch 'malio' of https://gitlab.com/maxitio/malio-theme-for-sspanel into malio 7 years ago
maxitio d8f829daf1 支持Pyajs和f2fpay_payjs混用的两种支付系统 7 years ago
GeekQu 8b7258e25a Merge branch 'pr/38' into dev 7 years ago
Rico 8fbc2c8118
Update README.md 7 years ago
Max 0e6320c352 Merge branch 'malio' into 'malio'
修复 点击 打开 App Store 显示 无法连接 App Store 问题

See merge request maxitio/malio-theme-for-sspanel!6
7 years ago
Anankke b012608093
refactor(TelegramBot): Optimization Event listener
监听更少的事件, 优化机器人响应
7 years ago
wewall f94a3ed357
refactor(TelegramBot): Optimization Event listener
监听更少的事件, 优化机器人响应
7 years ago
Anankke 3c7fb9e907
refactor(config): Use existing define 7 years ago
Anankke 519167e065 fix(#780): PayJS QRCode fix
thanks to #780

Closes #780
7 years ago
Bill Huang 993be4b442 修复 点击 打开 App Store 显示 无法连接 App Store 问题 7 years ago
Max ab53bafdee Merge branch 'dev' into 'malio'
Merge Request 2019-09-01

See merge request maxitio/malio-theme-for-sspanel!5
7 years ago
Max a1181edd3d Merge branch 'malio' into 'dev'
# Conflicts:
#   app/Controllers/LinkController.php
7 years ago
wewall f850afdc2a
refactor(config): Use existing define 7 years ago
围墙 36bd068e58 fix: Telegram webhook not refreshing IP cache (#778) 7 years ago
maxitio 8ff3ad2f0c 优化工单系统(新邮件皮肤) 7 years ago
maxitio 0128ee95d1 增加登录显示二步验证输入页面时的淡入动画 7 years ago
maxitio 6f06034dd4 忘记给login的simple样式加二步验证登录 7 years ago
maxitio 95142cdfdf 登录终于支持二步验证了 7 years ago
maxitio 281c79ccd7 修复节点设置页面端口重置不显示的问题 7 years ago
maxitio a1eb884661 更新番茄云支付文件 7 years ago
maxitio 992acb62de 修复登录页注册页极验无法验证第二次的问题 7 years ago
maxitio f18ad3820f 修复登录页数字登录无效的bug 7 years ago
maxitio e7ac894ef5 修复重置订阅链接的显示问题 7 years ago
maxitio 270fbd0f82 修复注册页登录页的bug 7 years ago
maxitio 225cb47cfb 在开启只有绑定tg的用户才能加入群组的功能时,点击加入群组的按钮会提示用户绑定tg后才能加入 7 years ago
maxitio f8bee8dba0 共享账号支持限制等级了,需要更新malio_config.php里面的账号结构,注意对比下 7 years ago
maxitio 24c8b7d49e 支持在着陆页/登录页/注册页显示Crisp 7 years ago
SukkaW 92f4889a67 merge: from remote into local 7 years ago
SukkaW 0a49ed9667 refactor: new domoain for chrome download
Blame @NimaQu
7 years ago
maxitio 56ac260b33 修复首页余额在移动端下显示不正确的bug,修复Surfboard教程无法一键导入的bug 7 years ago
maxitio 7dde4ee3f4 登录页欢迎语会根据时间显示 Good Night, Good Morning, Good Afternoon, Good Evening 7 years ago
maxitio af21872576 修复未绑定用户加入TG被加入黑名单,后面就算绑定了不能加入的bug 7 years ago
maxitio 6ab71df638 修复linux教程clash托管配置链接不正确的问题,修复重置订阅链接页面订阅url不正确的问题 7 years ago
Indexyz 25add275e7 feat: add docker support 7 years ago
SukkaW ad9fbc456a docs(tutorial): update the tutorial of adding tutorial 7 years ago
SukkaW d072da8a12 refactor: remove canvas nest effect 7 years ago
GeekQu fae633893b
Merge pull request #48 from GeekQu/dev
增加用户订阅日志,需导入 sql/user_subscribe_log.sql
7 years ago
GeekQu 0cdb8c46dc fix 7 years ago
GeekQu 2f69f5c405 用户订阅日志 7 years ago
SukkaW 1893a27f75 feat(register): bring up password strong check 7 years ago
JohnFreeman9 f21fb959f2 fix: show all nodes to admin user. (#762) 7 years ago
GeekQu a8ebbdb2ae
Merge pull request #47 from GeekQu/dev
船新的 Clash 配置、修改 Surfboard SS 节点格式、V2Ray & Kitsunebi 订阅默认带账户及流量信息
7 years ago
GeekQu 52a26e797c 调整位置 7 years ago
GeekQu 3dd7da8260 +1s 7 years ago
GeekQu 9ea2db2d26 fixed 7 years ago
GeekQu 1142c08f39 船新的 Clash 配置 7 years ago
GeekQu b6c5854ef6 Clash ProxyGroup 去除无用策略组 7 years ago
GeekQu 56f2b20f61 Update ConfController.php 7 years ago
GeekQu 6704472ebe Update LinkController.php 7 years ago
GeekQu 9ddb296a35 Kitsunebi 支持账户到期时间以及流量信息 7 years ago
GeekQu d41e7bc0ff Surfboard SS 节点格式更改 7 years ago
GeekQu 2e0e0576c0 V2Ray 订阅默认带流量信息 7 years ago
SukkaW 559f9462cf fix(markdown): ordered list style 7 years ago
SukkaW 111267bb63 fix(tutorial): markdown code block sanity 7 years ago
SukkaW 9e549c6c20 Merge branch 'dev' of https://github.com/Anankke/SSPanel-Uim into dev 7 years ago
未来 7d106aefd5 fix(tutorial): wrong el id and markdown problem (#759) 7 years ago
SukkaW cd91534f64 refactor(user/profile): update style 7 years ago
SukkaW db7748fe59 refactor(user/index): adjust everything
- Move annoucement card to first row
- Remove logo of the info cards
- Update connect info table style
7 years ago
SukkaW b7e956079a fix(#750): fail to pass param to fucntion 7 years ago
SukkaW e67d3e8d9b refactor(user/invite): reorgnize the cards 7 years ago
SukkaW 3c419aa603 refactor(user/index): mutilple components changed
- merge usage info with top cards
- merge traffic into checkin
- change row to 5/7
7 years ago
maxitio 2f3ad9bd77 修复Surfboard订阅问题 7 years ago
SukkaW 1732f5047a ci: make composer 10x faster [skip lint] 7 years ago
Sukka 0026de69d0
refactor(user/index): simplify the ui (#757) [skip lint]
* feat(tutorial): bring up markdown
* refactor(user/index): move ios to download card & remove tutorial
* refactor(user/index): move client download below quickadd
7 years ago
SukkaW 0b86230b15 fix(tutorial): tpl directory 7 years ago
maxitio fe8a812a44 修复注册页面的bug 7 years ago
maxitio 8fc614700b update URL.php 7 years ago
Max 3ba85bff3c Merge branch 'dev' into 'malio'
Merge Dev

See merge request maxitio/malio-theme-for-sspanel!4
7 years ago
Max d1909d1f77 Merge branch 'malio' into 'dev'
# Conflicts:
#   config/.config.example.php
7 years ago
GeekQu b531d16b6d
Merge pull request #46 from GeekQu/dev
接小火箭的锅
7 years ago
GeekQu 7a30b477ab Update LinkController.php 7 years ago
GeekQu 88dc5d283b
Merge pull request #45 from GeekQu/dev
修复小火箭订阅
7 years ago
GeekQu 106a5e8075 CFW 一件导入以及 SSR 订阅默认带流量信息 7 years ago
GeekQu 65d7b0cfa9 修复小火箭订阅 7 years ago
Sukka 4f8eaee948
refactor: migrate tutorial to markdown (#756)
* refactor(tutorial): remove all current content
* style: remove margin of collapse active
* feat(tutorial): bring up template
* feat(tutorial): bring up new tutorial
* style: minor style fix
* feat: add a tutorial for how to add tutorial
7 years ago
SukkaW 00a5298cba chore: remove useless files 7 years ago
SukkaW 9858846e43 refactor(user/index): add sub btn to connect info 7 years ago
SukkaW 2d03f441a5 refactor(user/index): use table io show connect info 7 years ago
SukkaW 5b3702a7e2 feat(user/index): add sstap download to client card 7 years ago
SukkaW 5940b1b259 feat(user/index): add client download card 7 years ago
Sukka ae99bee5a4
docs(README): a brand new readme (#754)
* docs(README): a brand new readme
* docs(README): update some typo
7 years ago
maxitio 5216e0ad7b 优化商店购买页面,sendgrid现在支持显示发送人 7 years ago
SukkaW 600efed7c0 refactor: update robots.txt 7 years ago
SukkaW 9fbf458308 fix: missing analytics for paolu.html 7 years ago
SukkaW 5c7a10c9d8 refactor(dailyjob): download qqwry.dat directly 7 years ago
SukkaW 1ce85858e2 merge: from remote into local 7 years ago
SukkaW 58a0ae155c refactor(xcat): minor updates
- Fix QQWry download info output
- Add git gc for initdownload
7 years ago
Anankke 996eb575ab perf: fix isNodeOnline() 7 years ago
maxitio 4bbdd5a001 优化netch教程 7 years ago
maxitio bef9829e21 修复陈年bug 7 years ago
maxitio c46c504881 增加windows netch教程 7 years ago
maxitio b3059febfe legacy模式优惠码优化 7 years ago
maxitio 5f8cdaccd6 增加单独的共享账号页面、优化商店legacy模式优惠码 7 years ago
maxitio ab1e3c25ea TG bot新功能:未绑定网站的用户加群会被踢出 7 years ago
maxitio de3aff84f4 优化商店优惠码功能 7 years ago
maxitio 69857e4995 删除卡机狂魔js库canvas-nest 7 years ago
SukkaW f253335ba0 fix(#695): resolve all vulnerabilities [skip lint] 7 years ago
SukkaW 52145881e3 ci: upgrade npm to resolve vulnerabilities 7 years ago
SukkaW 0d2d95db06 fix(#748): remove lwl12 hikoto from indexold 7 years ago
SukkaW 0f278e6a46 fix(#747): a syntax error in relay/edit
close #747
7 years ago
maxitio b30c38d61d 修复注册页面的问题 7 years ago
SukkaW c1462619a9 docs(README): update
Change wiki url
7 years ago
maxitio aece4427f7 修复邮件模板bug 7 years ago
maxitio 352e78c09d 修复注册时不能发送邮件的问题 7 years ago
maxitio 6158bb240a 适配邮件模板(如果收到没适配的邮件,请通知我) 7 years ago
maxitio a9ea4330ce 登录和注册支持reCAPTCHA 7 years ago
maxitio 12ad7255b2 当节点设置为仅启用单端口时,节点列表的详细信息不显示普通端口的Tab 7 years ago
maxitio 42fcce8f8b malio_config 增加 “首页是否一直显示进入教程的横幅 ” 的选项 7 years ago
maxitio c0c5a8a1ae 优化工单系统的显示效果 7 years ago
maxitio 45baaa4a21 支持中转规则 7 years ago
maxitio b7a1424eb8 注册页面增加邮箱后缀限制 7 years ago
maxitio 73c29bc682 在malio_config禁用plan_2 plan_3后,不显示节点等级标题 7 years ago
maxitio 8bac50f8d2 修复刚刚创造的bug 7 years ago
maxitio abcff60744 可使用client-download文件夹内的download.sh自动下载部分客户端,优化教程显示页面 7 years ago
maxitio e9db469f3f 修复审计规则列表移动端显示问题 7 years ago
maxitio c60ed58350 增加tos页面 7 years ago
maxitio 9adda201f2 着陆页优化及bug修复,压缩图片 7 years ago
maxitio d1eb011b87 修复首页共享账号密码无法复制的问题 7 years ago
maxitio 8d556c8c0b 修复教程页面无法打开mac ssr教程的问题 7 years ago
TheCGDF 91f64376d0 mini修复:点击复制ios账户会提示“已拷贝订阅链接” 7 years ago
maxitio e95932a590 修复侧边栏在缩小状态下logo溢出的问题 7 years ago
maxitio 304a2ddf91 修复codepay 7 years ago
maxitio b6153578ca 全面支持clash的一键导入,需要更新malio.js 7 years ago
maxitio 0c635bd0ff 修复刚写的bug 7 years ago
maxitio 435d5e7f3d fix bug 7 years ago
maxitio b9c15a9bd8 修复我的钱包页面的列表在移动端显示不正常的bug 7 years ago
maxitio 2557020f02 商店的试用套餐仅在用户等级为-1时显示 7 years ago
maxitio 59401305f9 修复bitpay支付返回后出现500的bug 7 years ago
SukkaW 5ff9ec151e merge: from remote to local 7 years ago
SukkaW 4f6b4c92ed fix(ticket_view): make avatar align in center 7 years ago
King 160e978db4 fix(user/index-dev): minor changes (#729)
- Add ssr url of Android in user guide
- Change `Ios` to `iOS`
7 years ago
maxitio 146c3b67d3 优化节点列表的国旗显示方式,修复节点列表显示的问题 7 years ago
SukkaW b96873308c refactor(console): use console.table to show performance 7 years ago
SukkaW f4af6091cc fix(ticket/view): datetime container padding 7 years ago
maxitio 83425b7793 修复 “关闭webapi ip验证” 无法生效的bug 7 years ago
GeekQu f6d909a7d4 添加 ClashX 一键导入 7 years ago
GeekQu 073fb840e7
Merge pull request #44 from GeekQu/dev
修复 用户中心-资料编辑 的排版
7 years ago
GeekQu 6226e7f25d 修复 用户中心-资料编辑 的排版 7 years ago
SukkaW 64f32a9dba refactor: minor fixes & changes of ui 7 years ago
SukkaW a797ef7ea6 ci: fix npm-audit.log directory [skip lint] 7 years ago
SukkaW 038bd2e3a9 feat/refactor: minor change related to ticket
- Move editormd css to the head
- Stop user from post reply to closed ticket
7 years ago
SukkaW c060cc65b7 fix(style): admin/ticket_view & user/index 7 years ago
SukkaW 5f7ce30a33 ci: a lot of minor changes
- Use biinari/smart-lint
- Put npm-audit.log output to the end
- Make apt-get less noisy
- Remove divider between routes test
7 years ago
SukkaW 70f6bda903 refactor: remove useless alt attr 7 years ago
SukkaW 689c18275d refactor(ticket_view): avatar style optimized 7 years ago
SukkaW abeb384174 merge: from remote to local 7 years ago
SukkaW 5217669097 fix(user/ticket_view): change btn style 7 years ago
maxitio d5af7bd77c 添加ClashX一键导入 7 years ago
maxitio d68c31f668 fix bug 7 years ago
maxitio 9e10b4f63a fix bug 7 years ago
maxitio 18eb83dca8 修复教程quan和小火箭无法导入的bug 7 years ago
imjonat 3dfcf13da2 fix: to fix server酱 恢复上线标题有误 (#736) 7 years ago
maxitio c70fa2da0f 修复番茄云支付在商店不弹窗的问题 7 years ago
micll 4125b1cb4c fix Zxing_local (#728) 7 years ago
maxitio dc9ce5934a 修复首页ssr复制订阅按钮不复制的问题 7 years ago
SukkaW 6a9a608013 merge: from remote into local 7 years ago
SukkaW e9c545051e refactor(user/index): change cols & cards order 7 years ago
maxitio e828e87a1a 解决首页在会员永久的情况下显示负数很大的问题 7 years ago
maxitio 0cb00205d6 update README.md 7 years ago
Max 2eef980fe5 Merge branch 'dev' into 'malio'
Merge dev to malio

See merge request maxitio/malio-theme-for-sspanel!3
7 years ago
Max 247897eb5a Merge branch 'malio' into 'dev'
# Conflicts:
#   .gitignore
#   app/Middleware/Mod_Mu.php
#   app/Services/Payment.php
#   config/.config.example.php
7 years ago
maxitio 21a0be745d 教程页面的其他客户端按钮可以隐藏 7 years ago
maxitio 61791e58b6 注册页面支持极验 7 years ago
maxitio 71564e4171 修复登录页面simple模式,优化首页流量不足提示 7 years ago
maxitio 4d76a7af0c 订阅链接按钮优化,修复商店当面付不显示二维码的问题 7 years ago
maxitio 3dd1136d71 client-download目录增加apps.txt文件供各位参考客户端文件名 7 years ago
maxitio 988583b9a3 我的钱包页面支持关闭自动续费 7 years ago
maxitio 48fc064d46 修复首页在流量大于1T的情况下显示流量不足的bug 7 years ago
maxitio eabe7dbfa8 修复商店使用优惠码无效的bug 7 years ago
maxitio cb244fb171 我的钱包页面支持充值码充值 7 years ago
maxitio d45e7eb915 一大波更新 7 years ago
Srotiy 48b0b66966 fix: bot does not respond. (#732)
* fix: bot does not respond.

Different variable parameters in the same function.

* add notify for RSS in group chat

add notify for RSS in group chat
7 years ago
imjonat 1e572b460c fix(codepay): update to new codepay gateway (#733)
https://codepay.fateqq.com/apiword/r1YwqrOte.html
7 years ago
maxitio 2058c1f099 禁止用户在微信内打开,若在微信内打开会引导用户跳转至浏览器 7 years ago
maxitio 7428b2320d malio_config.php添加malio.js版本字段 7 years ago
GeekQu 24f796250b
Merge pull request #43 from GeekQu/dev
更新上游至 20190725 以及修复端口偏移的 bug
7 years ago
GeekQu b03cd3fb6e
Merge pull request #37 from Anankke/dev
Merge Anankke 0725
7 years ago
GeekQu 2bb31ec0da fix 7 years ago
GeekQu 4cb7770c58 Update URL.php 7 years ago
GeekQu 41c37ee92c Merge branch 'pr/37' into dev 7 years ago
maxitio 9b4ec018a5 修复支付方式为f2fpay时钱包页面500错误的bug 7 years ago
maxitio 2dde4b75a5 修复邀请码选填不显示的bug 7 years ago
maxitio 668acbb59a 修复单端口多用户在节点列表显示地址为一样的bug 7 years ago
SukkaW 73ee6ab6f8 ci: use apt-get to replace apt
apt is not suitable for non-interactive
enviroment as its unstable interface
7 years ago
SukkaW bab171d777 fix(#707/#730): literal for es6 template string 7 years ago
maxitio d8dfb8bfce 忘记写分号 7 years ago
maxitio 270836e631 现在可以在网站目录下执行 php xcat update 更新了 (暂未测试过) 7 years ago
maxitio 2cb97a0829 Merge branch 'master' of https://gitlab.com/maxitio/malio-theme-for-sspanel 7 years ago
maxitio 3b0766832f 注册页面邀请码加上选填字样 7 years ago
Max 60b036fc29 Merge branch 'patch-1' into 'master'
未匹配到國家的情況下采用UN 聯合國的圖標

See merge request maxitio/malio-theme-for-sspanel!2
7 years ago
qwq 02c09d1b9a 未匹配到國家的情況下采用UN 聯合國的圖標 7 years ago
GeekQu 043bf5c0c3
Merge pull request #42 from GeekQu/dev
部分修改以及增加对 NAT 节点端口偏移支持
7 years ago
GeekQu 06595e2abd
Merge branch 'dev' into dev 7 years ago
maxitio b1c2ee643d 首页订阅按钮增加对齐选项 7 years ago
maxitio 989c06fb0c 下载和教程页面按钮美化+1 7 years ago
maxitio 53fd369ec9 首页加上一键导入和复制订阅的地方 7 years ago
maxitio d37e860d45 节点列表支持单端口多用户 7 years ago
GeekQu d4cb600d0e 再次 7 years ago
GeekQu a9104e94e4 修复233 7 years ago
maxitio 810e328691 节点列表增加澳大利亚国旗 7 years ago
GeekQu 7666bc7a09 +1s 7 years ago
maxitio b02d8ac294 节点列表英国国旗从uk.svg改为gb.svg 7 years ago
maxitio 1283d01d45 增加了一堆国旗 7 years ago
Tony Zou 4f0a4ac912 Update .config.example.php 7 years ago
Yanshuai 8438d4ef19 Update payjs.tpl
add Wechat Pay for payjs
7 years ago
Yanshuai 028357a0d6 add Wechat Pay For Payjs
add new payments method
7 years ago
Yanshuai 6dea9519be add Wechat Pay for Payjs
add new payments method
7 years ago
Yanshuai 4e9cb83b1c add Payjs Payments
add Wechat Pay For Payjs payment
7 years ago
Yanshuai 8e533e760b add Wechat Pay For Payjs payment
Added new payment method
7 years ago
GeekQu 158c3f679f 端口偏移名称修改 7 years ago
maxitio b1361722bd 修复刚刚造出来的bug 7 years ago
maxitio 122eb42ac4 Merge branch 'master' of https://gitlab.com/maxitio/malio-theme-for-sspanel 7 years ago
maxitio 5217aa2031 节点列表增加国旗 7 years ago
Max b48391982c Merge branch 'patch-1' into 'master'
使統計可控

See merge request maxitio/malio-theme-for-sspanel!1
7 years ago
qwq fcd1e83a32 使統計可控 7 years ago
GeekQu 026b7a8d26 修复缺失的判断 7 years ago
King b9ab1dbbab fix(index): unavailable button on the register, login, reset (#727)
This commit changes the `login/register` button to `home` when at those pages,
7 years ago
GeekQu 69959ba023 端口偏移 7 years ago
maxitio 6ceb83d7b8 解决节点列表二维码不显示的bug 7 years ago
maxitio a561a10c95 登录页面支持极验 7 years ago
maxitio 075ddc9464 $Malio_Config['index_promotion_txet'] 里面的txet改成text 7 years ago
maxitio b683962395 登录页面完善Telegram登录功能 7 years ago
maxitio 8b306c2943 增加注册时邀请码可选的功能(AFF),需要更新.malio_config.php 7 years ago
maxitio 30e4a77638 侧边栏增加“返回管理员身份”,修了一些bug 7 years ago
maxitio d5e0bb0ac3 fix bugs 7 years ago
maxitio 345275681c 连接设置页面显示当前订阅链接 7 years ago
maxitio 7a7b1e04a7 着陆页支持定制,定制选项请看.mario_config.php,需要更新.mario_config.php 7 years ago
maxitio d369d4b130 商店legacy模式忘记加js代码了 7 years ago
maxitio 4459d7748a 节点列表增加免费节点,适配国旗为节点名字前两位,需要更新.mario_config.php 7 years ago
maxitio 6ba1ed871a 增加商店页面legacy选项,原版sspanel的样式,需要更新.malio_config.php 7 years ago
maxitio 670a94b6db 删除bitpayx.tpl 7 years ago
maxitio cd3be13aca 教程新增iOS Kitsunebi 7 years ago
maxitio 2538228244 修复连接设置重置端口在价格为0时依旧显示的bug,修复邀请链接无法重置的bug 7 years ago
maxitio b9fc433d63 fix bugs 7 years ago
maxitio 66d33f50d8 update README.md 7 years ago
maxitio 65c3d46942 fix bugs 7 years ago
maxitio 1318ccd530 add README.md 7 years ago
maxitio ccc0ed1d46 马里奥来了 7 years ago
GeekQu cf1c00b592 +1s 7 years ago
GeekQu a9ed6a5461 Update Tools.php 7 years ago
BitPay Dev - 数字货币支付 ee5adecfbf refactor(bitpay): remove duplicated js (#718) 7 years ago
GeekQu 0cce58cb49 Update ConfController.php 7 years ago
SukkaW 6452f68662 chore/ci(#695): use latest nodejs
Close #695
7 years ago
GeekQu 9762516919 Update LinkController.php 7 years ago
BitPay Dev - 数字货币支付 4969d0f495 fix(#717): conflict func name between f2f & bitpay 7 years ago
GeekQu 6da23df18e 修改 Clash DNS 7 years ago
围墙 fddf8897bf
Optimize code
优化节点 `heartbeat` 获取方式,
7 years ago
围墙 f7ba8d6c82
Remove ref
删除昏睡中添加的引用
7 years ago
围墙 b908af8df7
Optimize performance for node
优化 node 页面加载, 尽可能少的查询 sql, 为大机场优化
7 years ago
Sukka 0e7f7fb8e1
merge(#715): from feat/user/edit into dev
[BREAKING CHANGES] Filter for SS/SSR in user/edit pages
7 years ago
laurieryayoi 47e00446df 坑死我了 7 years ago
Rico b5689528fa 取消去掉中止套餐 7 years ago
SukkaW 5ac653c63e feat(user/edit): bring up filter function 7 years ago
SukkaW d4d36d1af2 feat(user/edit): add class for list item 7 years ago
SukkaW e8340fd039 feat(user/edit): bring up btn ui 7 years ago
SukkaW bfd0fe93a8 refactor: merge connect info into one card 7 years ago
SukkaW 89e8611f51 refactor(user/edit): move some cards to second row 7 years ago
SukkaW 53835fb793 fix(user/edit): wrong el ID 7 years ago
SukkaW a034138945 refactor(tpl): simplify the code
Use $$getValue instead of document.getElementById(id).value
7 years ago
SukkaW 768ff6cb60 merge: from remote into local 7 years ago
SukkaW 771e0ccbd4 refactor: simplify the code 7 years ago
Rico 08484f9aac 排除已经中止的套餐 7 years ago
Rico ea9e0fcc57 排除已经中止的套餐 7 years ago
SukkaW d60958961a feat(user/edit): force random sspwd 7 years ago
SukkaW 848a3dbbd1 merge: from remote into local 7 years ago
SukkaW 67d05bfc48 fix(user/edit): wrong element ID in selector 7 years ago
围墙 96abe52c37
fix detail 7 years ago
SukkaW 6f9dc1300d feat(job): add 'git gc' to updatedownload 7 years ago
SukkaW 6f0a2b4626 feat/ci: speed up [skip lint]
- remove duplicate apt update as it has
  already been done when setting up
  nodejs
- disable npm audit when exec npm i
  ci will do it later
- do not build uim-index-dev when skip-
  lint
7 years ago
Sukka 10adbf3608 feat/ci: add cookie in route test (#709) 7 years ago
SukkaW 043a31d976 fix/ci: chmod permission & result output 7 years ago
SukkaW 2a2e7968b1 merge: from remote into local 7 years ago
SukkaW 93a4dffc34 ci: add route tesh.sh 7 years ago
Anankke 21fbef0a9e fix(ui): register not sending
坏 sukka
7 years ago
Anankke e61333e1bf fix(#707): literal
Closes #707
7 years ago
錢爸爸 2cd0972b2e
購買紀錄居然沒有購買時間?
添加購買時間,取消套餐ID註釋
7 years ago
Anankke 25aff097f2 fix(ui): user ticket not submitting 7 years ago
Anankke f024919ab1 fix(ui): user ticket view not loading
要死吖
7 years ago
Anankke 19874cadeb fix(ui): user ticket view not loading 7 years ago
GeekQu c02568371b 文档中心增加 YAML 代码高亮 7 years ago
GeekQu 3f2e38eb75
Merge pull request #41 from GeekQu/dev
例行更新
7 years ago
SukkaW eb0c3583ed revert: "ci: divide into muilt scripts"
This reverts commit ec916ad28a.
7 years ago
SukkaW ec916ad28a ci: divide into muilt scripts 7 years ago
Sukka 2c688870d5 fix/ci: nginx 404 error (#706)
nginx & php-fpm are running at `www-data` user but default user is `travis`
Solution: ref: https://github.com/Nebo15/gandalf.api/blob/master/.travis.yml#L32
7 years ago
Anankke f24d2a9a05 fix(ui): literal 7 years ago
Anankke 246138e794 fix(ui): user/edit literal 7 years ago
Anankke 85558cbb72 fix(ui): unwanted space 7 years ago
GeekQu c4788c969e fix......
Clash SS 节点加入 UDP 字段

修复小火箭订阅信息

自定义 Clash 配置的规则也可从一个完整配置中获取
7 years ago
SukkaW aa7f93e02b fix(#701): syntax error
Close #701
7 years ago
SukkaW dc33fb2fb3 fix: literal 7 years ago
SukkaW 5da7f8a727 refacor/fix: use literal instead of break templae string 7 years ago
Anankke 039144d540 chore(ui): lint 7 years ago
Anankke bfd8d4befe fix(ui): literal 7 years ago
Sukka 8ffea2c0ff
merge(#700): from refactor/es6 into dev
refactor: remove jquery dom api usage & use es6
7 years ago
SukkaW 8441957325 fix: syntax error 7 years ago
SukkaW cee6099691 refactor: remove jquery && use es6 7 years ago
SukkaW f694045a9f refactor: remove the jquery & use es6 7 years ago
SukkaW 6961f5edf3 style: format the tpl 7 years ago
SukkaW 177e323d4c refactor: remove jquery & use es6 7 years ago
SukkaW f41299d112 refactor: remove jquery & use es6 7 years ago
Sukka b4f46f7018
style: format the tpl (#697) 7 years ago
GeekQu 7411225038 修复一个因拷贝引起的问题 7 years ago
GeekQu 8276ac627b 修复逻辑错误 7 years ago
SukkaW 0bb3ad5bd9 fix(staff): some minor changes
- remove kotomei as "she" has already finish "her" college entrance examination
- remove a useless link tag
- add SSPanel UIM Dev Team to copyright
7 years ago
SukkaW d17ba653aa fix(#695): add npm lock file back to repo 7 years ago
Sukka 7ddbb1a063
merge(#696): from feat/ci/smarty-lint into dev 7 years ago
SukkaW 455ddc1d94 fix/ci(npm): small trick to ignore errors
Ref: https://medium.com/@linzhao/npm-audit-with-travis-ci-d7acc3e2195a
7 years ago
SukkaW 4ae360899b feat/ci: add npm audit to ci check 7 years ago
SukkaW c56872162b fix/ci: command typo & syntax error 7 years ago
SukkaW 0a0a861f37 ci: bring up lintTpl.sh 7 years ago
SukkaW 83188d564c feat/ci: add smarty-lint to ci [skip lint] 7 years ago
Sukka f16dfd7a89
merge(#692) from chore/ci into dev
- Add [skip lint] option to speed up build
  When commit msg have [skip lint], the build will skip lint
- Bring up MySQL & Nginx for further test
7 years ago
GeekQu a91ce6190b 更新规则 7 years ago
GeekQu 3567c49626 fix 7 years ago
GeekQu 4f1650e574 fix 7 years ago
GeekQu a7fde8d67f fix 7 years ago
GeekQu 419a0dd7f3 +1s 7 years ago
GeekQu 0d45487c3e +1s 8 years ago
GeekQu 24e4cbdd5e
Merge pull request #36 from Anankke/dev
Merge dev 20190628
8 years ago
Anankke c5e0f9dc3d fix: memory exhausted in backup 8 years ago
GeekQu aeae454acb
Merge pull request #40 from GeekQu/dev
修复文档中心
8 years ago
GeekQu 96896839d6 修复文档中心 8 years ago
Anankke 73bb24539b feat: append trade number as identifier to paylist 8 years ago
Anankke f6805b514e perf: telegram daily usage output
note to Anankke: 使用 git blame 锁定击杀目标
8 years ago
Anankke 95840d0833 fix: memory exhausted in cli
给带机场的修复,daily job 有问题的请升级
8 years ago
Anankke 8943237c86 chore: lint 8 years ago
GeekQu 0a350999ad
Merge pull request #39 from GeekQu/dev
兼容 Android 以及 iOS 的 Kitsunebi 独立订阅
8 years ago
GeekQu 2b05de1963 +1s 8 years ago
GeekQu a17223aed7 +1s 8 years ago
GeekQu b9cd64341c fix 8 years ago
GeekQu 0f1ea0698b 优化以及 Kitsunebi 订阅 8 years ago
Rico 7041de630b add bitpayx wechat 8 years ago
GeekQu e234bf56a5
Merge pull request #38 from GeekQu/dev
TCP;TLS;
8 years ago
GeekQu 626576e0e2 fix 8 years ago
GeekQu 2fda57b291 fix 8 years ago
GeekQu c19ffcf57b tcp;tls; v2ray 8 years ago
Anankke b5429b5dfa fix: lost functions 8 years ago
Anankke 1a7045f2a4 refractor: rearrange search to top for further use 8 years ago
Anankke cd05448cbc feat: node autoconfig
server side api
8 years ago
Anankke 824a96e458 perf: refactor helper 8 years ago
Anankke 79291c3c38 chore: add .php_cs.cache to .gitignore 8 years ago
GeekQu 87c76ab575 fix 8 years ago
Rico f5b8887457
Merge pull request #37 from GeekQu/dev
兼容后端改变以及小火箭的独立订阅
8 years ago
GeekQu e4bb1d905b +1s 8 years ago
GeekQu f902f21d74 对小火箭不输出 v2ray kcp 节点 8 years ago
GeekQu d4259c747d fix 8 years ago
GeekQu 56efadeab9 兼容后端修改,小火箭独立订阅地址 8 years ago
GeekQu 7dba302403 clash 配置兼容后端改变 8 years ago
GeekQu 3af14b7e45 Kitsunebi 订阅不输出 ss v2ray-plugin 节点 8 years ago
GeekQu 1413c3ea99
Merge pull request #36 from GeekQu/dev
更新上游代码;支持 Shadowrocket 的自定义信息展示
8 years ago
rico93 b70b06919e add bitpayx 8 years ago
rico93 ccba1508e4 add bitpayx 8 years ago
GeekQu c2c1ba9923 +1s 8 years ago
Rico 0ef22cd766 mergeMerge branch 'dev' of github.com:rico93/ss-panel-v3-mod_Uim into dev 8 years ago
Rico c82b4ddd43 设定clash skip-cert-verify=true 8 years ago
GeekQu 26dcd1fadc Merge branch 'pr/35' into dev 8 years ago
GeekQu 4ccc344d41 支持 Shadowrocket 的自定义信息展示,以及将访问 V2RayNG 订阅的 Quantumult 转到 Quantumult 的 V2Ray 专属订阅 8 years ago
GeekQu 6620b0bf51
Merge pull request #35 from GeekQu/dev
修复 Quantumult 无法跳转
8 years ago
GeekQu d36e1fdf00 修复 Quantumult 无法跳转 8 years ago
GeekQu bf2be4034c Merge branch 'pr/34' into dev 8 years ago
Anankke 7e55cc37ff fix: an intended merge implementation
which might bring unwanted return in
certain circumstances
8 years ago
Anankke 25109792f7 ui: remove obsolete marquee tag
amend
8 years ago
Anankke 74204b516d ui: remove obsolete marquee tag
the worst thing to your visitors
8 years ago
Anankke d7ee66c094 fix: callback URL to be "" making it completely unfunctional
recommend immediate update

Closes #683
8 years ago
GeekQu 75caeab0df 增加修改记录 8 years ago
GeekQu 4d1bc0447d Update clash.tpl 8 years ago
GeekQu 37dba52f5d Clash 配置换回官方推荐端口 8 years ago
SukkaW 9e1affd1ff fix(icon): back to use fonts.googleapis.com 8 years ago
SukkaW b22c544b42 fix(icon): update material icons 8 years ago
Anankke b7857ab9ce refactor(controller/admin): remove enforced email check when quickCreate 8 years ago
Rico fbe3df0bcf fix: 修复Clash完整订阅中Auto覆盖第一个代理的bug (#681)
* 修复端口设置为0,本地监听时候,订阅端口不切成0的bug
* 修复第一个代理被Auto覆盖的问题
8 years ago
Rico f872f414ab 修复格式问题 8 years ago
Rico 4bd67f0218 修复第一个代理被Auto覆盖的问题 8 years ago
Anankke 32535c6d17 feat(xcat): add getCookie method for testing purposes
example: php xcat getCookie 1
return  $key $expiretime
8 years ago
GeekQu 7b30b6da59 fixed bug 8 years ago
Anankke baaf7333f3 feat(xcat): expand createAdmin for testing purposes
example: php xcat createAdmin 114514@1919.com 810
8 years ago
SukkaW cb6083bbce Refactor: remove roboto fonts directly 8 years ago
SukkaW 9f54828c15 Refactor: move material design icons to jsDelivr 8 years ago
Rico 4e2443c394 fix: 修复端口设置为0,本地监听时候,订阅端口不切成0的bug (#680) 8 years ago
Rico 4aef671252 修复端口设置为0 或者空的时候 不切443 8 years ago
Anankke 864a741051 perf: improve URL utility performance
修复围墙的迷惑行为
这里还有巨大多优化可以做
头疼
今天杀围墙
8 years ago
laurieryayoi 4fc6d144b0 语法不严谨 8 years ago
Anankke e054129f9f perf: fix wired trim implementation 8 years ago
Anankke 97ef92a668 fix: smarty literal
after lint
8 years ago
laurieryayoi 2750d59a89 修复订阅链接显示不正确 8 years ago
Anankke e8878546b7 refactor: lint template files
you can keep local changes by coping this directory and changing theme config option
8 years ago
Anankke 92d0fdb20b fix: admin main page tag
on 246ab2f392/resources/views/material/admin/main.tpl (L132)
and lint
8 years ago
Anankke 24da59adc1 feat: add customizable f2f url option
add "$System_Config['f2fNotifyUrl']" in your config file to enable this feature
8 years ago
yaozeye 42ff7025ca chore: update license
NimaQu: 我不做机场头子啦!
8 years ago
GeekQu 17c359ffdb Update LinkController.php 8 years ago
Anankke 1b22dde2d8 chore: fix disordered branches 8 years ago
GeekQu 08fa92de9d
Merge pull request #33 from GeekQu/dev
20190604
8 years ago
Anankke 9df6563c4b chore: remove composer files on master 8 years ago
Anankke ef49d4b7d4 fix: 6/4 bug fix
- fix: smarty tags
- fix: path_search template box width
- fix: missing storage directory and subdirectories
8 years ago
GeekQu 59db2c4d24 Merge branch 'pr/34' into dev 8 years ago
GeekQu 7ec059d0d5 Update HomeController.php 8 years ago
GeekQu ac20d3c515 Merge branch 'pr/34' into dev 8 years ago
Anankke b049d90ef3 chore: remove composer dependency & update php env to 7.2 8 years ago
Anankke 7976ed2ec1 refactor: keep the default index as before 8 years ago
Anankke 3ec21e4687 revert: "修改默认的index"
This reverts commit db4d243f70.
We should not change the files but the routes
8 years ago
Anankke 1423812524 fix: missing storage directory and subdirectories 8 years ago
Anankke 0e4557c49b chore: remove composer files
composer install code shouldn't be redistributed
8 years ago
GeekQu e3bade965f 更改文档中心控制,可选不允许未登录用户查看文档 8 years ago
Anankke 620e9851ed fix: path_search template box width
why repeat yourself?
8 years ago
Anankke 05224fc1ad fix: smarty tags
path_search tag fix
8 years ago
GeekQu 97140bf279 fixed bug 8 years ago
GeekQu dae12ba7b2 切换协议配置可选关闭 8 years ago
GeekQu e645d1de71 将重置订阅下移,减少不明所以然用户的误操作 8 years ago
GeekQu f3fbd0bc24 允许用户修改主题 8 years ago
GeekQu 840c6c331f 优化 +1 8 years ago
GeekQu f016cb66d2 文档中心控制
- 开启或关闭文档中心
- 可选从本地加载文档
- php xcat 新增下载使用文档至本地,请执行 php xcat initdocuments
8 years ago
Rico 0f5f4920ca
Merge pull request #32 from GeekQu/dev
Dev
8 years ago
GeekQu 29823b794f 去除不必要的设置 8 years ago
GeekQu 51ab3689d9 优化 +1 8 years ago
Anankke 848065d8cd
Update README.md 8 years ago
SakuraSa233 188729cf50
feat: add contribute instruction 8 years ago
Anankke 73451d7f37 更新 gitignore 8 years ago
Anankke c0fc24dab4 更新链接 8 years ago
laurieryayoi db4d243f70 修改默认的index
- 如果想体验vue构建的新版页面请把resources/views/material/中的indexvue.tpl改为index.tpl,index.tpl改为indexold.tpl
8 years ago
Anankke 246ab2f392
儿童节更新 (#668)
Master 儿童节更新

注意加入新的 config 选项
8 years ago
Anankke 9463b97c2c 优化默认加密速度 8 years ago
Anankke 863f261e2e
Merge branch 'master' into dev 8 years ago
GeekQu d011bbdb2a Surge 自定义远程配置从 json 改为 yaml 格式 8 years ago
Anankke 076073f808 Update gitignore 8 years ago
Anankke 3fde99fe68 PSR 12 8 years ago
Colinwood11 a8f2a0f3d2 修复无脑CTRL+V (#667) 8 years ago
Anankke 98368c63f4 小场面 8 years ago
Anankke 963cfc5b75 Utils 优化 8 years ago
Anankke c0b1c4929a Service 部分优化 8 years ago
Anankke 88eae4a408 Middleware\Models 优化 8 years ago
Anankke 3c0907281c Command 部分优化 8 years ago
Anankke 2443a0f392 Controller 优化&&修复 8 years ago
GeekQu 49d3a1607e 优化+1 8 years ago
GeekQu 880c9d3d1e 修正 Clash ss 节点异常输出 obfs-host (#665)
* 修正 Clash ss 节点异常输出 obfs-host

* +1
8 years ago
GeekQu 0a94ae0778 +1 8 years ago
GeekQu f201f3f2d1 优化+1 8 years ago
GeekQu c9b0573f43 修正 Clash ss 节点异常输出 obfs-host 8 years ago
GeekQu 7b1e789cd0 Merge branch 'pr/32' into dev 8 years ago
Anankke bf903bba8c 补充内容 8 years ago
Anankke 7845d50f58 修链接 8 years ago
Anankke ffc1fe3fe5 优化(? 8 years ago
GeekQu 7219d6a2db 修正 Clash -> ss 节点异常输出 obfs 配置 8 years ago
Anankke 6bcfb322ff 做个人叭awsl 8 years ago
BitPay Dev - 数字货币支付 a89943644b 增加数字货币支付BitPay - 支持多种支付 (#663)
* 增加数字货币支付BitPay - 兼容模式

* remove logs and fix empty check

* format Bitpay new codes and make it consistent

* apply PSR12 styles with symplify/easy-coding-standard

* remove unnessary routes for bitpay
8 years ago
GeekQu 390de49768 fixed bug 8 years ago
GeekQu 957d0a5a39 fixed bug 8 years ago
GeekQu a7ce812f8a fixed bug 8 years ago
GeekQu 59a5fbfdbc 初步支持自定义 Clash 配置 8 years ago
Anankke 7b0b30ce0a
Merge pull request #657 from SukkaW/dev
Refactor: perfops & compress images
8 years ago
SukkaW 4e87da9a77 Refactor: change perfops js src 8 years ago
SakuraSa233 f81b1cde33
fix: undifined view() (\\\\\) 8 years ago
SakuraSa233 8989958f7d
fix: lost Auth use 8 years ago
SakuraSa233 418e622063
fix: class call issue (#656) 8 years ago
SakuraSa233 897aa5ed28
revert: some extreme changes 8 years ago
SakuraSa233 b7704e6dbf
fix: construct error 8 years ago
SakuraSa233 38904d91d2
feat: init php-view renderer 8 years ago
SakuraSa233 e33a862ce5
feat: import slim php-view 8 years ago
SakuraSa233 df06991108
rm: composer lock file 8 years ago
SakuraSa233 bd017965a3
rm: unused language file 8 years ago
SakuraSa233 7a9be73a38
feat: rename ".config.php.example" to ".config.example.php" 8 years ago
SakuraSa233 e9e99c37e3
refactor: routes 8 years ago
Anankke 7648c7c863 ん? 8 years ago
SukkaW 0496cc38b8 Refactor: compress image 8 years ago
Anankke f85f3c79ef
Merge pull request #654 from SukkaW/dev
Refactor: a new simple paolu.html
8 years ago
SukkaW bd41774562 Refactor: a new simple paolu.html 8 years ago
Anankke b18c44705f
Merge pull request #653 from SukkaW/dev
Enable perfops for analytics program
8 years ago
SukkaW 72176279f5 Feat: enable perfops for analytics program 8 years ago
Sukka 306a1a1637
Merge from upstream 8 years ago
Anankke 7956597953 remove tmt 8 years ago
Anankke 68c11d279c
Merge pull request #651 from topjohncian/dev
增加节点掉线后推送至Server酱
8 years ago
Anankke d19dc0b5a2 remove yft 8 years ago
topjohncian 90eefe0c16
更新Job
增加节点掉线推送到Server酱
8 years ago
topjohncian 1bd51bf4a0
添加配置
添加enable_detect_offline_useScFtqq配置项
内容为
离线检测是否推送到Server酱 请配置好上文的Server配置
8 years ago
GeekQu 7f1dc71403 fixed bug 8 years ago
Anankke efc5dbc7b6
Merge pull request #647 from regendsoh/dev
增加延长等级期限功能
8 years ago
Regend Soh 88ad84d7ed
Update Shop.php 8 years ago
Regend Soh e0ad5c7586
Update .config.php.example 8 years ago
Anankke 99564cf93e chenPay.tpl qr修正 8 years ago
Anankke e6ea9a9624
Merge pull request #645 from ithg/patch-1
TG数字验证码
8 years ago
Ti 40fc9eb6e9
TG数字验证码 8 years ago
GeekQu 3aaf83cbd4 远程配置中 Proxy 改为可选 8 years ago
GeekQu b8b6d8b823 应对可能发生的错误 8 years ago
GeekQu e2db566240 错误提示以及规则 8 years ago
Anankke 00053217ab update,,, 8 years ago
GeekQu 1f508548ca Update ConfController.php 8 years ago
GeekQu 91f0653b1c 兼容性 8 years ago
GeekQu 75286ec582 再次修复 8 years ago
GeekQu 325ca64c14 修复手误 8 years ago
GeekQu 8f94685a46 初步支持自定义 Surge 配置 8 years ago
GeekQu 45ed0a8fd5 Merge branch 'pr/31' into dev 8 years ago
NimaQu e40ff3f6b8
Update staff.tpl
我傻逼了
8 years ago
NimaQu ca894d6d34
Update staff.tpl 8 years ago
GeekQu b4e926560f 修正手贱 8 years ago
GeekQu 3e4102d3ef 判断使用新旧首页 8 years ago
GeekQu 36670677cb
新旧首页使用选项 8 years ago
Anankke 499d682f41 add editorconfig 8 years ago
Anankke af7ce96e78 修缩进 8 years ago
Anankke 111c8eaf74 修缩进 8 years ago
Anankke 6e76f09661
Merge pull request #631 from Colinwood11/dev
没错,是我又在填之前写BUG了
8 years ago
Colin Huang a6398a346e 修复PushBear关闭时,导致公告无法添加的BUG 8 years ago
Colinwood11 502cde4bb4
Merge pull request #1 from Anankke/dev
同步过来
8 years ago
GeekQu ed46405017
Merge pull request #31 from GeekQu/dev
20190501
8 years ago
GeekQu 57786798e2 iOS 账户显示 8 years ago
GeekQu e23072d3d8 Merge branch 'pr/30' into dev 8 years ago
Anankke 1628b1740e
Merge pull request #628 from tomatofishball/dev
新增番茄云支付网关
8 years ago
laurieryayoi 06b5329f38 修复firefox下剪贴板操作无效 8 years ago
Anankke 8e754b9893
Merge pull request #630 from Colinwood11/dev
屏蔽空工单回复提醒,修复我之前加的功能为摆设的问题(Markdown不提交,后端不接收)。
8 years ago
Colin Huang 83c1142634 屏蔽空工单回复提醒,修复我之前加的功能为摆设的问题(Markdown不提交,后端不接收)。 8 years ago
tomatofishball a6ffff58e7
添加番茄云支付设置
添加番茄云支付设置
8 years ago
tomatofishball 1306e5fae8
把番茄云支付设置移到config
把番茄云支付设置移到config
8 years ago
tomatofishball 03b47a4a2f
Update TomatoPay.php 8 years ago
Anankke 3c83044154
Merge pull request #629 from Colinwood11/dev
一些手残和BUG修正
8 years ago
Colin Huang eac0f88a0a 手残+1 8 years ago
Colin Huang 7b2ddc3a2c 修复手残的字符 8 years ago
tomatofishball 3acb02a07f
新增番茄云支付配置
新增番茄云支付配置
8 years ago
Colin Huang bf1855f38c 我又在写BUG了 8 years ago
tomatofishball c5de287a7d
新增番茄云支付配置
新增番茄云支付配置
8 years ago
tomatofishball 9716b8c1c5
新增番茄云支付配置
新增番茄云支付配置
8 years ago
tomatofishball 3f76f02b52
新增番茄云支付配置
新增番茄云支付配置
8 years ago
tomatofishball 1d83dc6f6a
添加番茄云支付
添加番茄云支付
8 years ago
tomatofishball 9cc6980394 添加番茄云支付
添加番茄云支付
8 years ago
tomatofishball 90a39ba618
错误的
错误的
8 years ago
tomatofishball 7505457449
番茄云支付网关
番茄云支付网关
8 years ago
Colin Huang 47c6f1276a 用户新建/回复/重新开启工单用Server酱推送微信
新建/回复/重新开启工单邮件推送的开关
8 years ago
tomatofishball 4bed5873bb
添加番茄云支付回调路由
添加番茄云支付回调路由
8 years ago
tomatofishball 5f3ec9f27f
Update .config.php.example 8 years ago
tomatofishball 56ebf759ef
新增番茄云支付
新增番茄云支付
8 years ago
tomatofishball fc8319b9db 新增番茄云支付网关,最终版
新增番茄云支付网关,最终版
8 years ago
Colin Huang fb90616008 修复PushBear无效的问题,配置文件排序 8 years ago
Colin Huang e0e2fbfd28 使用PushBea 默认改为关闭 8 years ago
Anankke 29937a6fa2
Merge pull request #627 from Colinwood11/dev
添加新公告中支持PushBear推送
8 years ago
Colin Huang 09a89a5082 添加新公告中支持PushBear推送 8 years ago
laurieryayoi a17d8c3f32 避免移动端剪贴板操作跳到页面底部 8 years ago
Indexyz 92f8c085ba
fix: fix optTime and connection manager 8 years ago
Indexyz 163a810fc6
fix: fix error 8 years ago
Indexyz d20d177aba
fix: fix error service namespace 8 years ago
Indexyz 9a4e22d554
feat: add database query count to console 8 years ago
Anankke 43e1900004 lint 8 years ago
Anankke 292fe88e95 fix switch user 8 years ago
laurieryayoi a07a32bfd1 删除土豆丝下载链接 8 years ago
Anankke 3b349c7485 fix bcrypt and add argon2id 8 years ago
Anankke 79de3aaeca Fool proof fix: using latast reset link 8 years ago
Anankke 42a3dac858 fix static hash 8 years ago
Anankke a2c155ef58 彻底修复小可爱“漏洞” 8 years ago
Anankke e54fab249f minor fix 8 years ago
laurieryayoi 7432fc3bc9 添加二步验证 8 years ago
GeekQu 3c2a0700f1 修正 SSR 订阅中有多余字符 8 years ago
GeekQu f57dff8ec6 适配 Quantumult 的自定义订阅头 8 years ago
laurieryayoi 19d3b84d71 fix bug 8 years ago
laurieryayoi d8c632e8f9 减少不必要的ajax请求 8 years ago
CGDF 6d2d2add03 discord config增加(未完成)提示 8 years ago
Anankke 88fbe80f76
Merge pull request #611 from GeekQu/Anankke_dev
bug fixes
8 years ago
GeekQu 9ab4b96c06 修正 v2 节点有使用 outside_port 的情况 8 years ago
GeekQu a3a2d00793 修正节点列表 sort 13 节点可能出现地址与订阅不符的情况 8 years ago
GeekQu 3a154a395f 添加修改 ss 连接密码会变更 V2Ray UUID 的提示 8 years ago
GeekQu 966fd462fc bug fixes 8 years ago
GeekQu 177e2f41cb 更新 Clash 规则
修正 Clash 托管中中文被转为 Unicode 字符、Proxy 策略组中的 Auto 挪到最前面、去除 Clash for Windows 中已经内置的 cfw-bypass 规则
8 years ago
GeekQu d15850302d 去除 Clash for Windows 中已经内置的 cfw-bypass 规则 8 years ago
GeekQu 8f5c6d9d6f Clash 托管 Proxy 策略组将 Auto 挪到最前方 8 years ago
GeekQu 83028efd22 修正中转节点含有 outside_port 的情况 8 years ago
GeekQu 039934513b Update ClientApiController.php 8 years ago
GeekQu 67b8c487de Merge branch 'pr/28' into dev 8 years ago
GeekQu e6e67d8b97 修正节点列表中的节点地址可能出现错误的情况 8 years ago
GeekQu e93a180a48 修正 Clash 托管中中文被转为 UNICODE 字符 8 years ago
GeekQu c57c1be6c2 修正 V2Ray 托管订阅会错误的输出节点 8 years ago
GeekQu 15739f4057 再次 8 years ago
GeekQu 18b0e97c08 优化用户中心展示 8 years ago
GeekQu 7b922d791c 添加修改 ss 连接密码会变更 V2Ray UUID 的提示 8 years ago
Rico d8c5160a61 继续修复 8 years ago
Rico 311a4d46c3 继续修复 8 years ago
Anankke fb3ddbbb4b
Merge pull request #609 from rico93/A-dev
修复端口为0或者空造成的中转问题
8 years ago
Rico 8c49a0cbcc 继续修复 8 years ago
Rico 5ffed40afe 继续修复 8 years ago
Rico 24c741f404 Merge branch 'A-dev' into dev 8 years ago
Rico 88f7585822 修复端口为0或者空造成的中转问题 8 years ago
Rico 64c15cbf9c 修复端口为0或者空造成的中转问题 8 years ago
GeekQu b5137f1f46 加密协议混淆多方案切换 8 years ago
laurieryayoi 5ec4fab607 部分dropdown添加箭头 8 years ago
laurieryayoi 10511a42aa dropdowm添加箭头选项 8 years ago
CGDF 3cadf03f4e 小可爱补丁bug。。。 8 years ago
CGDF d0f7a1ee87 简要修复小可爱漏洞 8 years ago
GeekQu ba1f4dff04 更新鸡肋功能支持VMess 8 years ago
GeekQu 88c15f87bc Merge branch 'pr/27' into dev 8 years ago
Anankke d3d84c1a00 添加升级时默认时间未配置导致的登录过期 8 years ago
Anankke da1b107b23
Merge pull request #604 from wxlost/dev
临时修复spay支付
8 years ago
wxlost e8d7c49e5e
临时修复spay
临时修复spay
8 years ago
wxlost ead40d42f9
临时修复spay支付
临时修复spay支付
8 years ago
laurieryayoi 2e5a57a1c6 修一下s呸 8 years ago
Anankke 4f6b9e7803 modified: app/Controllers/AuthController.php
modified:   config/.config.php.example
8 years ago
laurieryayoi 008c1640d1 更新预编译文件 8 years ago
laurieryayoi b3642bff04 Merge branch 'payment' into dev 8 years ago
laurieryayoi 6a4670e341 fix bug of codepay&fix lint error 8 years ago
laurieryayoi 0e96db0ec0 Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi cbe290e21a 添加payment 8 years ago
laurieryayoi 1f8e04041d 添加codepay 8 years ago
laurieryayoi cb5ad90281 添加payment 8 years ago
laurieryayoi ad70bdd832 Merge branch 'dev' into payment 8 years ago
Anankke 9790b99942
Merge pull request #602 from rico93/A-dev
删去对节点地址格式判断造成兼容性的问题
8 years ago
Rico d07acea7b4 删去对节点地址格式判断造成兼容性的问题 8 years ago
Anankke e413e0e814
Merge pull request #601 from rico93/A-dev
修改if判断代码风格
8 years ago
Rico 96fe200f13 修改if判断代码风格 8 years ago
Rico 0180a58892 修改if判断代码风格 8 years ago
Anankke e55f6f00d1
Merge pull request #600 from rico93/A-dev
A dev
8 years ago
Rico b8ae004f8f 修改判断位置 8 years ago
Rico 19d2d617ba 修改判断位置 8 years ago
Rico 2f9cbdc47e 在自定义重置日期的时候,过滤掉现在已经有套餐在身的用户(被坑了/(ㄒoㄒ)/~~ ) 8 years ago
Rico 3d086d3679 对每日数据重置用户做过滤,过滤掉有套餐在身的用户 8 years ago
Rico c5c28bbb15 Merge branch 'A-dev' into dev 8 years ago
laurieryayoi 20be8af0b8 快速创建用户 8 years ago
laurieryayoi d78523a64d Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi dfcbc88860 节点列表基础样式 8 years ago
laurieryayoi 11e0e317b0 节点列表基础样式 8 years ago
Anankke e4b0117078
Merge pull request #598 from rico93/A-dev
增加管理员添加用户和添加套餐的post api
8 years ago
Rico 93fa0b5ec9 增加管理员添加用户和添加套餐的post api 8 years ago
Rico eed5502427 增加管理员添加用户和添加套餐的post api 8 years ago
NimaQu f153d8c981
Merge pull request #591 from abc1763613206/patch-1
docs: fix links
8 years ago
abc1763613206 ee7a397231
docs: fix links 8 years ago
CGDF 522ae69431 优化发信附件name 8 years ago
CGDF eb24a832e4 再再次修复mailgub。。。 8 years ago
CGDF 80e3368b75 继续修复mailgun。。。 8 years ago
Anankke 1afa771c51
Update README.md 8 years ago
CGDF a090b9ce6b 修复mailgun附件 8 years ago
CGDF 8ff8cd7323
Merge pull request #588 from rico93/A-dev
修复 if tag没有关闭的问题
8 years ago
Rico db6e416bae 修复 if tag没有关闭的问题 8 years ago
Rico 9dd7121318 修复tag错误 8 years ago
GeekQu 03bd9d77d6 Merge branch 'pr/26' into dev 8 years ago
Rico 8b1cd924b7
Merge pull request #30 from Anankke/dev
update
8 years ago
laurieryayoi c75b57bb73 Merge branch 'dev' into payment 8 years ago
laurieryayoi bfacb6626b nodedemo 8 years ago
CGDF 2ca54f5826 修复update BUG 8 years ago
CGDF b590ada9ae
Merge pull request #587 from GeekQu/patch-1
修正误写
8 years ago
GeekQu bc652297cf
修正误写 8 years ago
GeekQu 1dcbbf54e9 Merge branch 'pr/29' into dev 8 years ago
CGDF 4ac418785b 初步对接discord bot(debug) 8 years ago
CGDF 8a9f41d0f8 联络方式新增Discord 8 years ago
CGDF 98c8d1cb67 修复今日流量排序bug 8 years ago
CGDF be76e27d90 新增19个搜索字段支持 8 years ago
CGDF 8503c45b2f 解禁用户列表【已用流量、总流量、今日流量】排序 8 years ago
Rico f9839183ec 修复ws;tls;的写法造成的 配置文件出错 8 years ago
Anankke 7f6bcc6857
Merge pull request #581 from GeekQu/Anankke_dev
添加对 rico 后端 ss-v2ray-plugin 类型节点的支持
8 years ago
GeekQu 4f23361365 更新
- 支持添加 rico 后端 ss-v2ray-plugin 类型节点
- 更新 clash 配置,以及配置支持 ss
- 添加 ssd 订阅支持 ss-v2ray-plugin 类型节点
- 更新节点列表 v2ray 节点的信息展示
8 years ago
GeekQu d88b0c7951
Merge pull request #25 from Anankke/dev
Merge Anankke_dev
8 years ago
GeekQu 394d7d87e7 修正历史错误 8 years ago
laurieryayoi 0d11af9093 Merge branch 'dev' into payment 8 years ago
laurieryayoi 1da3a7acfd 修复ci 8 years ago
GeekQu ce09980d19 Update LinkController.php 8 years ago
Anankke 0e999814b6 Merge branch 'dev' of github.com:Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
Anankke 5c3b8ed5f2 fix argon2i/update config template 8 years ago
Anankke c0b62b7458
Merge pull request #578 from sun00108/dev
修复了在.config.php中更改订阅链接域名之后使用api获取订阅链接仍为baseUrl的问题
8 years ago
sun00108 4e4aea5930
修复了在.config.php中更改订阅链接域名之后使用api获取订阅链接仍为baseUrl的问题 8 years ago
Anankke d002ca73de Add bcrypt/clean up 8 years ago
GeekQu 7df036ab24 遗漏tcp+tls... 8 years ago
GeekQu 64b239ee86 修正错误 8 years ago
GeekQu 9022899efc 修正sort13的展示,更新v2节点的信息展示 8 years ago
GeekQu 2878c0a16f 修正 Clash v2 节点判断 8 years ago
Rico 7535eba114 修复clash配置问题 8 years ago
Rico 23c27c1ed9 增加节点状态展示,TODO节点配置展示 8 years ago
Rico a48ec0290a Merge branch 'GeekQu-dev' into dev
t push origin dev
8 years ago
Rico 973bed49fb Merge branch 'dev' of git://github.com/GeekQu/ss-panel-v3-mod_Uim into GeekQu-dev
增加v2ray ss+ws配置
# Conflicts:
#	app/Command/Job.php
#	app/Command/XCat.php
#	app/Controllers/RelayController.php
#	app/Controllers/UserController.php
#	resources/views/material/user/edit.tpl
8 years ago
GeekQu 99beccef07 修正 Quantumult、Surge 可以错误得到 ss-v2ray-plugin 节点 8 years ago
GeekQu 8fb7d952b1 修正判断错误 8 years ago
GeekQu e8a45491a1 修正Shadowsocks V2Ray-Plugin节点地址的格式,添加ssd订阅对v2ray-plugin的支持 8 years ago
CGDF db2d4fb458 tgbot mini fix 8 years ago
GeekQu 1e95468860 修正上一个提交的逻辑错误 8 years ago
GeekQu 959ce76021 修复v2ray节点协议层使用tls时节点地址可以为IP 8 years ago
CGDF 794af5c05f 清理tgbot代码 8 years ago
CGDF ace3ca997f 重构tgbot 8 years ago
GeekQu 1ab551c81d 去除无用 8 years ago
GeekQu 628aa4ee24 Merge branch 'pr/23' into dev 8 years ago
GeekQu 3036497f0f 支持 ss-v2ray-plugin 类型节点
域名;端口;ws;tls;路径;额外参数
8 years ago
CGDF b98c2be11c
Merge pull request #574 from rico93/A-dev
修复中转端口判断的bug
8 years ago
Rico 81b6e15132 修复中转端口判断的bug 8 years ago
Rico 050ea4c784 修复中转端口判断的bug 8 years ago
CGDF 7c1d3b410c 调整tgbot文案 8 years ago
GeekQu 640c73f9f5 更新 SurfBoard 策略组 8 years ago
laurieryayoi c14e08123c Merge branch 'dev' into payment 8 years ago
laurieryayoi b89a3b58aa 修复工单页pagenation样式 8 years ago
laurieryayoi c6332fdead Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 74514fed57
Merge pull request #573 from rico93/A-dev
增加对Rico的V2ray后端中转和Caddy监听的适配
8 years ago
Rico 17ff8dfe22 增加对Rico的V2ray后端中转和Caddy监听的适配 8 years ago
Rico 54710c60ac 修复bug 8 years ago
laurieryayoi b1f0f78860 添加节点ajax路由 8 years ago
Rico df9bdfb56c Merge branch 'dev' of github.com:rico93/ss-panel-v3-mod_Uim into dev
merge
8 years ago
Rico f01405182b Merge branch 'Anankke-dev' into dev
merge
8 years ago
Rico 4295dead69 Merge branch 'dev' of git://github.com/Anankke/ss-panel-v3-mod_Uim into Anankke-dev
# Conflicts:
#	resources/views/material/user/edit.tpl
#	resources/views/material/user/index.tpl
更新上游,并修复v2ray 中转节点有些信息不更新或者显示的问题
8 years ago
CGDF eaa3cdbd02 修复v2ray节点的ip解析 8 years ago
laurieryayoi 74630c3f69 节点列表demo 8 years ago
GeekQu c20b63c571
Merge pull request #26 from GeekQu/dev
更新
8 years ago
GeekQu 6931a05b7f 订阅链接兼容从上游面板切换到此面板 8 years ago
laurieryayoi 5bd3476c4d Merge branch 'dev' into payment 8 years ago
GeekQu 97203afb4d 修复 V2Ray 的节点地址可以被错误提交 8 years ago
laurieryayoi 48d58be637 登录超时token 8 years ago
laurieryayoi 6e33b4da7d Merge branch 'dev' into payment 8 years ago
laurieryayoi d50400b126 Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi 1a8b6d4cea 更新预编译文件 8 years ago
laurieryayoi 6c73665e15 补充登录验证 8 years ago
laurieryayoi 5a6bcdd4d0 Merge branch 'dev' into payment 8 years ago
laurieryayoi 805d234c76 登录验证 8 years ago
CGDF f177813f85 修正下载链接 8 years ago
CGDF 51be96f638 补充ssr-electron linux教程 8 years ago
Tony Zou 4fa99252b9
update
avoid being arrested.
8 years ago
GeekQu dcd09b9607
Merge pull request #22 from rico93/dev
Merge Rico
8 years ago
GeekQu b21ca25501 修复 Clash 配置中会输出 kcp 协议节点 8 years ago
Rico 191e3d19d8 修复如果端口设置成0的情况 8 years ago
laurieryayoi 5e881d47a7 Merge branch 'dev' into payment 8 years ago
Rico e2029b055e 修复TGbot quan的订阅问题 8 years ago
CGDF fbdf96d087 绑定tg文字微调 8 years ago
Rico 156cbcbf4e Merge branch 'GeekQu-dev' into dev
merge
8 years ago
Rico d4a790b44d Merge branch 'dev' of git://github.com/GeekQu/ss-panel-v3-mod_Uim into GeekQu-dev
merge
8 years ago
CGDF f71759d99e
Merge pull request #567 from SukkaW/fix/user/indexold
Fix: typo, clashX & Clash for Windows
8 years ago
SukkaW 860dd97d01 Fix: typo, clashX & Clash for Windows 8 years ago
GeekQu feff60fbc7 修复Clash YAML配置中多余的空格以及当没有回国节点时导致的配置文件错误 8 years ago
GeekQu a6e39a784e 跟进 Clash 节点配置字段 8 years ago
GeekQu 67fb5512f3 Merge branch 'pr/21' into dev 8 years ago
CGDF 12940ab53e ios账户共享新增累计充值门槛 8 years ago
Rico 9654c419ea Merge branch 'dev' of github.com:rico93/ss-panel-v3-mod_Uim into dev
merge
8 years ago
Rico 899597011e Merge branch 'Anankke-dev' into dev
# Conflicts:
#	resources/views/material/user/index.tpl
8 years ago
CGDF 0563382835
Merge pull request #561 from iv8/patch-1
删除冗余,提高可读性
8 years ago
iv8 24b557728d
删除冗余,提高可读性 8 years ago
laurieryayoi 447272a566 Merge branch 'dev' into payment 8 years ago
laurieryayoi 065efecdb2 更新index模板,删除多余import 8 years ago
laurieryayoi c44cc6e17e Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 968cefb6ed 修复累计充值显示异常 8 years ago
CGDF 3d8177b3e1 调整节点配置链接 8 years ago
CGDF 77e28cf3bc 调整文字教程。user新增“统计总充值”函数 8 years ago
GeekQu 205076f62f Merge branch 'pr/20' into dev 8 years ago
Rico a75f665923
Merge pull request #23 from Anankke/dev
update
8 years ago
Rico 68686ef31f 修改提示语 8 years ago
Rico 7654c4f428 删掉update的rule 限制判断 8 years ago
GeekQu 9d3790d705 Merge branch 'pr/19' into dev 8 years ago
GeekQu 85c17b606d 更新 8 years ago
Rico dee3e5a94f 继续增加提示 8 years ago
laurieryayoi 6e7a04f396 修复合并订阅时windows点击复制链接 8 years ago
Rico f630e40305 添加提示 8 years ago
Rico 3584d95d2a 增加v2ray中转字样,TODO replay的rule回复 8 years ago
laurieryayoi 532b6c0ea8 Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi fe96e20c69 完善trimepay逻辑 8 years ago
CGDF abe8359ecb 修复内网中转bug 8 years ago
laurieryayoi 8c9b7642f9 添加支付图标 8 years ago
laurieryayoi d70d68d19e 添加支付图标 8 years ago
laurieryayoi 31b9927d75 完善trimepay样式 8 years ago
laurieryayoi d0f49d0b9a 修改fetch wrapper 8 years ago
laurieryayoi e14dcf9153 添加trimepay 8 years ago
laurieryayoi a4dff69547 修改fetch wrapper 8 years ago
laurieryayoi e79f0e43d0 修复service&充值记录表格初始化渲染 8 years ago
laurieryayoi 093d63a5f5 Merge branch 'master' into dev 8 years ago
laurieryayoi c0f827cf28 删除眼花多加的代码 8 years ago
laurieryayoi b3b7f7b142 merge master to dev 8 years ago
laurieryayoi 78fe23fcc0 fix bug 8 years ago
laurieryayoi e600317ddf Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi 704ce85673 更新编译文件 8 years ago
laurieryayoi d75eeb43e8 充值码充值&充值记录 8 years ago
NimaQu c3e83839b6 Merge branch 'master' into dev
# Conflicts:
#	resources/views/material/user/chenPay.tpl
8 years ago
Tony Zou 98638f1745 fix: payment error for wechat jsapi
update: shorter url for trimepay wepay_jspi.

update: implement query on payment success page.

remove: using get params instead of querying using api.
8 years ago
Sukka 282f335e91 Feat: add sspanelAnalysis (#553) 8 years ago
laurieryayoi ed1cc891dc 添加充值中心组件 8 years ago
Nymph a9d1a30376
Merge pull request #550 from SukkaW/ci-npm-cache
Feat: speed up CI
8 years ago
Nymph 1dfd70ef4e
Merge pull request #549 from SukkaW/remove-useless-file
Remove useless scss, fonts. images
8 years ago
laurieryayoi 1c4fbd1570 更新编译文件 8 years ago
laurieryayoi 26055a0e7f 优化商店显示 8 years ago
laurieryayoi a749473b05 完善配置指南样式 8 years ago
laurieryayoi b83c0e8105 使用fontawesome5.7.2 8 years ago
laurieryayoi 20d99f8e2b 样式微调 8 years ago
SukkaW aaff0a849b Feat: speed up CI
- Cache composer and node_modules
- Remove useless apt update
- Remove log output
8 years ago
SukkaW e8271082d3 Refactor: remove useless images 8 years ago
SukkaW 65f5d8c3b4 Refactor: remove useless scss files 8 years ago
SukkaW 389970f543 Refactor: remove font-awesome files
Come on, we are using jsDelivr right now
8 years ago
SukkaW 3017e2f129 Refactor: remove useless scss files
Nobody will complie it, right?
8 years ago
Suicidal Cat 8000cb147d 更新canvasjs版本 (#548)
* 更新canvasjs版本
8 years ago
NimaQu 5fb848fc07 闭合标签 8 years ago
laurieryayoi 4a70268273 更新构建版本 8 years ago
laurieryayoi b48b2ae0f5 加入fuck.js 8 years ago
laurieryayoi 96246f614a 非移动端响应式布局 8 years ago
NimaQu 538e04afdb fix fuck.js 8 years ago
CGDF 5fbd2f1304
Merge pull request #546 from rico93/Anankke-dev
增加v2ray节点的在线人数,测速信息展示
8 years ago
Rico d3c7c85985 目前我的v2ray后端,已经适配了测速,负载,在线人数。所以可以增加v2节点负载信息显示了 8 years ago
Rico b9ace12177 增加v2节点负载信息显示 8 years ago
Rico 5ff854ed1d Merge branch 'Anankke-dev' into dev
merge upstream
8 years ago
Rico b6962cb8a0 Merge branch 'dev' of git://github.com/Anankke/ss-panel-v3-mod_Uim into Anankke-dev
# Conflicts:
#	app/Command/XCat.php
#	resources/views/material/user/index.tpl
8 years ago
GeekQu 5765cad5de Merge branch 'pr/18' into dev 8 years ago
GeekQu 0b63054d60 fix bug 8 years ago
GeekQu 98eced52fd 增加一些URL传参
增加一些URL传参

## Clash

- dns,1=开启、0=关闭,默认0
- secret,默认 MixsChina,如有设置将覆盖此值,请urlencode
- log-level,默认 silent,如有设置将覆盖此值
8 years ago
Rico 4392715a2f 暂时取消Load—Balance,Windows那还没跟进 8 years ago
laurieryayoi 9a2e3ff1fa 避免eslint undefined错误 8 years ago
Nymph f4da861786
Merge pull request #538 from SukkaW/dev
Feat/CI: Add support for testing uim-index-dev
8 years ago
Sukka 43c399d4d5
Feat/CI: Add support for testing uim-index-dev 8 years ago
Nymph 15b9950ccc
Merge pull request #537 from SukkaW/dev
Feat: Using pre decoded QQWry.Dat
8 years ago
Sukka b23a440e9a
Fix: remove useless code 8 years ago
Sukka 34f0d906dc
Feat: using pre decoded qqwry.dat 8 years ago
Sukka e100f3e16f
Merge from Anankke/dev 8 years ago
laurieryayoi 16c62f0015 修复spay 8 years ago
CGDF 83d941ab66 xcat update不再调用npmbuild 8 years ago
laurieryayoi f8a1478f23 重传预编译文件 8 years ago
Rico eb87a162f3 Quan 增加回国配置,将带有回国,CHINA字眼的节点,放入了Domestic中 8 years ago
Rico 3d03d1b5f8 Clash 增加回国设置, 默认节点带回国或者CHINA 则会放入回国的代理中。 如果在海外可以选择将China_media的代理选择成Back_China_proxy. 8 years ago
Rico c35a42d11c 尝试增加Load-Balance 8 years ago
GeekQu 49efc532cb Update main.tpl 8 years ago
Tony Zou 5235664748 remove: using get params instead of querying using api. 8 years ago
Tony Zou ab753c3e55 update: implement query on payment success page. 8 years ago
GeekQu 8266caf023 首页的订阅链接修改 8 years ago
GeekQu 2ce018b32b fix bug 8 years ago
GeekQu a705e50003 Merge branch 'pr/17' into dev 8 years ago
GeekQu d65905ceeb mergeSub 去除的遗留问题 8 years ago
CGDF 1b06604af4 修复购买记录排序bug 8 years ago
laurieryayoi 546d70ec30 修改客服系统 8 years ago
CGDF 248d607837 使用mylivechat取代crisp 8 years ago
laurieryayoi f95c5ee25c 邀请/购买移动端布局 8 years ago
CGDF b0d905bf35 用户列表新增【累计充值】项 8 years ago
CGDF 3a002f7ddf 全量备份选项 8 years ago
CGDF dcff49155a xcat update包含构建index 8 years ago
CGDF f23d6f3e1e xcat nmpbuild 8 years ago
CGDF 855574cca9 优化合并订阅 8 years ago
CGDF 877d02f127
Merge pull request #531 from iv8/dev
fix bug with #407
8 years ago
iv8 67b9daf4dc
fix bug with #407 8 years ago
CGDF 9117c929f2
Merge pull request #530 from iv8/patch-1
更正逻辑
8 years ago
iv8 70e2f7acde
更正逻辑 8 years ago
GeekQu 0c060eebc4 加回 ss & ssd 的全部 url 8 years ago
GeekQu 1b7096811b Merge branch 'pr/16' into dev 8 years ago
GeekQu 0d0884a2c2 Update HomeController.php 8 years ago
Rico 1233712f7b 增加nat 端口配置, 通过指定outside_port over write port设定 8 years ago
laurieryayoi 52f17396ca 调教eslint 8 years ago
Rico 2de6520bcb Merge branch 'GeekQu-dev' into dev
合并代码
8 years ago
Rico e45cd77666 fix bug 8 years ago
Rico e779438ba1 fix bug 8 years ago
Rico 8f686a71a6 修改订阅链接 8 years ago
Rico 44a97c2d2d Merge branch 'dev' of git://github.com/GeekQu/ss-panel-v3-mod_Uim into GeekQu-dev
merge upstream
8 years ago
laurieryayoi 9e88aafcb1 配置指南移动端布局 8 years ago
laurieryayoi 88e5d53ae3 商店移动端布局 8 years ago
laurieryayoi ceefd30f43 签到 8 years ago
laurieryayoi 903af25d21 Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF c668d906d2 SSD subUrl 8 years ago
GeekQu 40352a78b1 统一代码 8 years ago
GeekQu 66da172baf fix bug 8 years ago
GeekQu 99cfe349b3 一键切换 SS/SSR 8 years ago
laurieryayoi 17bd16775a 完善分页组件 8 years ago
laurieryayoi 4fb00565a8 分页 8 years ago
laurieryayoi b328fcb71d 返利记录 8 years ago
GeekQu 5a9e298a1f Merge branch 'pr/15' into dev 8 years ago
laurieryayoi 3eba9fdb01 发布 一个构建 版本 8 years ago
laurieryayoi 50f4818979 完善userguide 8 years ago
CGDF 244cf3ea26 move issue 8 years ago
CGDF 3d4aa98d6e
Merge pull request #516 from iv8/patch-1
Delete redundant
8 years ago
laurieryayoi d3d23722bb 配置指南列表过渡 8 years ago
CGDF ae5e143f26 充值tips 8 years ago
Rico 7254567432
Merge pull request #20 from Anankke/dev
update
8 years ago
NimaQu 160157e63c base64 alipay & wepay logo 8 years ago
CGDF e4ccf6e7dc
Merge pull request #514 from luiyezheng/patch-1
API获取节点排序
8 years ago
CGDF 4bf5a262f1 重写生成优惠码 8 years ago
CGDF 6f72fd43d3
'false' == true 8 years ago
NimaQu 9f0d7d2440 fix 合并订阅 copy button test 8 years ago
GeekQu 8d0396c0f7
Merge pull request #14 from Anankke/dev
Merge
8 years ago
laurieryayoi 8ecc89066b 配置指南骨架 8 years ago
laurieryayoi 883d2ce770 优化代码 8 years ago
laurieryayoi 48bc53b3e0 更新index模板 8 years ago
laurieryayoi be3826e609 Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi a9412ff67a 忘记上传html模板 8 years ago
laurieryayoi b174549a40 userguide组件&readme说明完善 8 years ago
laurieryayoi 967253dfc8 Merge branch 'dev' of https://github.com/Anankke/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi 57efe1ab75 更新index构建readme 8 years ago
Tony Zou 4dbd4eaacd update: shorter url for trimepay wepay_jspi. 8 years ago
laurieryayoi a0f087973e 构建脚本 8 years ago
laurieryayoi c52cd965e9 小组件样式迁移到单文件内 8 years ago
laurieryayoi 2158821e9c vue-cli build debug 8 years ago
laurieryayoi 7db2586a66 配置vue-cli 8 years ago
Rico 6358b2a624
Merge pull request #19 from Anankke/dev
merge
8 years ago
Rico a4ab934aeb
增加如果是127.0.0.1,的再一步查询 8 years ago
Rico 48b8b7b55d
增加127.0.0.1的处理,使用Google dns over https 8 years ago
Rico 4e243f6ec7
增加127.0.0.1的问题处理使用dns over https google 8 years ago
Rico 9041ef8a8a
忘记后缀了 8 years ago
Rico 400e416cb1
add php-dns example 8 years ago
Rico 45c6cc86ca
add php-dns 8 years ago
laurieryayoi 585939041a vue-cli工程init 8 years ago
Rico 7d0f7f9329
add php-dns 8 years ago
Rico cab77cff36
add php-dns 8 years ago
Rico 0469e56fe4 test all 8 years ago
Rico b49f996731 test all 8 years ago
Rico 8a0331248f debug ip 增加一个iptest 8 years ago
Rico b9ba2c4214 debug ip 增加一个iptest 8 years ago
iv8 12814bb7e3
Update .travis.yml 8 years ago
iv8 881c83c449
update .travis.yml 8 years ago
iv8 3eb7a2c19b
Delete redundant 8 years ago
laurieryayoi 2e8b499d90 升级vue.js到2.5.22¥升级vuex到3.1.0 8 years ago
Rico 5ff6dca03a
Merge pull request #18 from Anankke/dev
merge
8 years ago
laurieryayoi 7d6937ccc7 点击链接复制到剪贴板 8 years ago
laurieryayoi db4b90783c 数据刷新按钮 8 years ago
laurieryayoi e1bcf2085d 流量进度条 8 years ago
Rico b48eb0c9e9
Merge pull request #17 from Anankke/dev
merge
8 years ago
laurieryayoi 543f8ae2f2 进度条组件 8 years ago
laurieryayoi da1b0258b1 优化移动端排版 8 years ago
laurieryayoi de22b67f54 购买套餐时可用资源更新 8 years ago
laurieryayoi 30c2eeb2be 修改脑子不清醒写的傻逼代码 8 years ago
laurieryayoi 3d6a6942f7 完善auth失败反馈 8 years ago
laurieryayoi 693640a924 修复geetest注册报错 8 years ago
GeekQu d914a4c6dc
Merge pull request #13 from Anankke/dev
Merge
8 years ago
Rico 9ddfa1ac5f
Merge pull request #16 from Anankke/dev
merge
8 years ago
laurieryayoi c550f61d9e 可用资源初始化 8 years ago
billphillip22 06e89c2bf5
API获取节点排序 8 years ago
laurieryayoi 89265497fe 先注释,想屏蔽的自己删注释 8 years ago
laurieryayoi 41e91771c2 Merge branch 'dev' into dev 8 years ago
laurieryayoi ed92b8ddc7 优化Vuex相关代码 8 years ago
NimaQu e3fd536d82
Merge pull request #510 from SukkaW/dev
Feat: block unsafe browser
8 years ago
laurieryayoi d8e47d99c4 锚点翻页 8 years ago
Rico 6ea6493a2b
Merge pull request #15 from Anankke/dev
merge
8 years ago
GeekQu 75f72c8f9d
Merge pull request #12 from Anankke/dev
Merge
8 years ago
laurieryayoi 18eae18366 邀请链接购买&定制模块 8 years ago
laurieryayoi 2bde5ee534 邀请链接购买&细节更新 8 years ago
laurieryayoi 4285a63fec 邀请链接重置 8 years ago
GeekQu 00fc041dd5 Merge branch 'pr/11' into dev 8 years ago
laurieryayoi cd2d4cb2f5 优化键盘操作 8 years ago
laurieryayoi 501167f292 重置订阅模块 8 years ago
Rico 55df0719bf
Merge pull request #14 from Anankke/dev
merge
8 years ago
laurieryayoi 8285d0d6ff 购买模块 8 years ago
laurieryayoi 6d44af18b3 modal组件&购买模块 8 years ago
GeekQu 06874d03aa 订阅链接汇总 8 years ago
laurieryayoi 2ce7b69054 修复messager 8 years ago
laurieryayoi 9801aace65 商店模块&post附带cookie 8 years ago
SukkaW 9ec21194e3 Fix: avoid fuck.js can't read <body> tag issue 8 years ago
SukkaW 93d79ad920 Feat: support block 360 browser 8 years ago
Sukka 8a1bf1a0d3
Merge commits from diffrent branch 8 years ago
SukkaW 9633a7ffde Refactor: replace unpkg with jsdelivr 8 years ago
SukkaW d86a9d5a5e Feat: add fuck.js
- Block Mobile QQ Browser
- Block QQ Browser
- Block WeChat
- Block UC Browser
- Block MIUI Browser
8 years ago
Sukka eb9ebeb04b
Merge from Upstream: Anankke/dev 8 years ago
Rico 7e8cb79859
Merge pull request #13 from Anankke/dev
merg upstream
8 years ago
laurieryayoi ebb2d73c88 较低版本webkit浏览器支持 8 years ago
laurieryayoi b003ca70e8 邀请链接基础组件 8 years ago
GeekQu 8c80679383 订阅内的账户及流量信息改为可选,默认关闭 8 years ago
laurieryayoi 43927d305b 整理api位置 8 years ago
GeekQu a325e3a021 Update index.tpl 8 years ago
GeekQu d63163cfac Update index.tpl 8 years ago
laurieryayoi 979b187dd4 对未实现promise的浏览器跳转indexold 8 years ago
laurieryayoi 0c2c84e1b7 不支持Vuex的浏览器跳转indexold 8 years ago
GeekQu 32212752a3 去除多余的代码 8 years ago
laurieryayoi 5d847a8e19 订阅链接 8 years ago
laurieryayoi d91bcf53b9 快速配置骨架 8 years ago
GeekQu b1784ed021 Merge branch 'pr/10' into dev 8 years ago
GeekQu 7b959de95a 合并订阅 8 years ago
GeekQu 31ca966f2c fix bug , merge mu 8 years ago
Rico 677f29ef05
Merge pull request #12 from Anankke/dev
merge upstream
8 years ago
laurieryayoi bc25ecbdfa 栏目切换相关组件&修复公告为空时无法进去usercenter 8 years ago
Tony Zou 93447bae9e
fix: payment error for wechat jsapi 8 years ago
GeekQu 5668c17b6a Clash 减少代码复写并支持 ss_obfs 8 years ago
laurieryayoi 846a18412f usercenter数据集成1 8 years ago
Rico 46b29a5b65
Merge pull request #11 from Anankke/dev
merge upstream
8 years ago
CGDF c00e02277a 向引号低头 8 years ago
laurieryayoi a3e2393ea9 usercenter骨架 8 years ago
Rico 7999ae0129
Merge pull request #10 from Anankke/dev
merge upstream
8 years ago
GeekQu aed740d56e 去除增加的v2函数 8 years ago
GeekQu dcd6d5dfd1 Merge branch 'pr/9' into dev 8 years ago
laurieryayoi 95853f0d7d fix bug 8 years ago
laurieryayoi b48928de98 fix bug 8 years ago
laurieryayoi a6d9fcbf79 解决合并冲突 8 years ago
laurieryayoi 17597ca28b 修改title 8 years ago
Nymph 47b6c9427c
Merge pull request #501 from SukkaW/Refactor/Fetch
Refctor: replace axios with fetch
8 years ago
Rico d3c023000d
Merge pull request #9 from Anankke/dev
merge upstream
8 years ago
SukkaW 50d60173e6 Fix: typo of Fetch Wrapper descr 8 years ago
Sukka 60e4c5736c
Merge branch 'dev' into Refactor/Fetch 8 years ago
SukkaW 6906896644 Refctor: replace axios with fetch
- Also some fixes about code style
8 years ago
laurieryayoi ef7d058adb 添加crisp 8 years ago
GeekQu 4f958270e9 修复 Clash 策略组 Proxy 内无 Auto 8 years ago
laurieryayoi 6dcb70e5b0 Merge others' change into dev 8 years ago
laurieryayoi 8434f1ff42 修复注册邮箱验证码无效&用户中心load 8 years ago
CGDF deb3a2fd85
Merge pull request #498 from SukkaW/dev
Add jsDelivr support for Vue Vendor
8 years ago
CGDF 259bed9772 修复合并链接 8 years ago
CGDF 745e59664b config引号 8 years ago
SukkaW 8b905d7d0e Add jsDelivr support for Vue Vendor 8 years ago
Sukka 29364223f4
Merge pull request from Anankke/dev 8 years ago
laurieryayoi 00c85b6ee9 密码重置页&细节更新 8 years ago
GeekQu 6fd4e6e7f5 修复 Surge 分流规则重复以及局域网规则缺失 8 years ago
laurieryayoi 359a295ed5 user编辑页面联络方式展示优化 8 years ago
Rico bab87fd422
Merge pull request #8 from Anankke/dev
merge upstream
8 years ago
laurieryayoi 5bb9f75a56 添加TG二维码验证 8 years ago
laurieryayoi 57aba1dbac 添加TG登录功能 8 years ago
CGDF e0587f99c3 统一微教程文案 8 years ago
GeekQu be74ec1f79 fix 8 years ago
NimaQu 2d87ccba41
test 8 years ago
CGDF 9fde31ba60
Update README.md 8 years ago
GeekQu f6d381685f Merge branch 'pr/8' into dev 8 years ago
GeekQu 67070bf176 Merge branch 'pr/7' into dev 8 years ago
GeekQu 387641637d Update index.tpl 8 years ago
Rico 8ff7cb11f7 Merge branch 'nimaqu_dev' into dev 8 years ago
Rico 7007f49db5 更新clash 配置文件 8 years ago
laurieryayoi 2c9a493a66 添加首页的checkbox及passwd页面 8 years ago
laurieryayoi 95e64cfc4e Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 8e6313dd1b 修复每次都会出现的赠品。。。 8 years ago
CGDF 40cfcaa07d 恢复用户公告列表 8 years ago
GeekQu 63ba85ae3a fix bug 8 years ago
laurieryayoi 04568215dd Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
GeekQu 26e770d7d7 fix bug 8 years ago
laurieryayoi 8eb95e7ac5 CSS细化 8 years ago
GeekQu 85364bda0f
Merge pull request #6 from NimaQu/dev
Merge
8 years ago
GeekQu 98c9f36b82 增加 sublink 返回信息 8 years ago
CGDF bb39517332
Merge pull request #491 from rico93/nimaqu_dev
增加tg bot 重置订阅链接功能
8 years ago
laurieryayoi 15f4703d3e 添加loading画面 8 years ago
laurieryayoi 7d4b370be0 替换掉竟然有200K的favicon 8 years ago
Rico 8d6f506282 Merge branch 'nimaqu_dev' into dev 8 years ago
Rico 7df1fff97a 增加重置订阅链接功能 8 years ago
Rico b0b5df3013 删除生成的订阅文件 8 years ago
laurieryayoi bbc5ecc5d3 修复获取code时query undefined导致的函数运行中断 8 years ago
laurieryayoi 730e825d3c index邀请码完善 8 years ago
laurieryayoi ebbaba5d55 fix bug 8 years ago
laurieryayoi 88a2cb7364 今日诗词&完善前端路由 8 years ago
laurieryayoi 5ee1a12cb8 修复geetest未验证报错 8 years ago
laurieryayoi ddbe7a8d7e 添加关闭验证码时判断 8 years ago
laurieryayoi e6ab15c44b index页面UI细化 8 years ago
GeekQu 4929e32748 ... 8 years ago
GeekQu 55499ce99e Merge branch 'pr/5' into dev 8 years ago
laurieryayoi 87e9fdc81f index页面前后端分离 8 years ago
Rico 222a81933b 使用URL 跳转app. 8 years ago
Rico 08f2eb4c84 Merge branch 'nimaqu_dev' into dev 8 years ago
GeekQu d15098ad62 fix bug 8 years ago
GeekQu 702f35c491 fix bug 8 years ago
GeekQu 528ac809b3 fix bug 8 years ago
CGDF 90c6690dd4
Merge pull request #488 from rico93/nimaqu_dev
修改订阅回复样式为InlineKeyboardMarkup,相对简洁些
8 years ago
CGDF de3e744ed7
Update TelegramProcess.php 8 years ago
GeekQu e9b464d581 更新 8 years ago
GeekQu cfe7c1147f Merge branch 'nimaqu_dev' into dev 8 years ago
Rico 68300d2121 增加quant完整配置 8 years ago
Rico b9f2c6cb13 删除多余信息 8 years ago
GeekQu 9e891cd9ef 测着测着就忘记了… 8 years ago
Rico 88764cee0d 修改tg订阅回复格式 8 years ago
GeekQu fcd74b4d49 分离规则,方便后续更新 8 years ago
GeekQu 2ed98945f2
Create README.md 8 years ago
Rico 905420152c Merge branch 'nimaqu_dev' into dev
# Conflicts:
#	app/Utils/TelegramProcess.php
8 years ago
Rico 6ca36867a4 修改订阅样式,改成了InlineKeyboardMarkup 8 years ago
laurieryayoi 47a58606c7 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
laurieryayoi b1ba37efce messager组件&vuex状态管理 8 years ago
NimaQu 79a93d0d3c
Update README.md 8 years ago
GeekQu 4a1b4ae7d3 Merge branch 'pr/4' into dev 8 years ago
CGDF 06aa84fcd3 修复SSD订阅分组 8 years ago
laurieryayoi ce17049397 index页面user界面Api 8 years ago
laurieryayoi 5e38694377 index页面鉴权强化 8 years ago
NimaQu 8b2c5ee896
Revert "删除enable_analytics_code"
This reverts commit 900fb910d0.
8 years ago
CGDF 560df810d6 修复周报统计BUG 8 years ago
CGDF 900fb910d0 删除enable_analytics_code 8 years ago
laurieryayoi 1d2e92e626 index页面邮箱验证 8 years ago
laurieryayoi b7b91eaa11 index页注册邀请码相关 8 years ago
CGDF 02e860e72f
Merge pull request #485 from rico93/nimaqu_dev
增加sendDailyUsage代码部分对无法找到chat的异常处理
8 years ago
Rico fc1576896b Merge branch 'nimaqu_dev' into dev 8 years ago
Rico 8d8566ae92 修改message 8 years ago
Rico 36de4e8ee3 增加异常处理,修改了USER model 获取attributs的接口 8 years ago
Rico 74559c735c Merge branch 'nimaqu_dev' into dev
# Conflicts:
#	app/Utils/TelegramProcess.php
8 years ago
laurieryayoi 708661ae5c index添加注册页面&登出时路 由调整 8 years ago
CGDF d7f4707f63
Merge pull request #482 from rico93/nimaqu_dev
add bot订阅信息回复
8 years ago
Rico bf158f23be add dailyusageBYTG 8 years ago
Rico 04b3e25192 add tg id 8 years ago
Rico 3dff6557f7 增加每日使用量推送,设置的话和sendDailyMail一样增加定时任务 8 years ago
Anankke b8a456980e
重新增加群组链接 8 years ago
laurieryayoi fb83cb796b 降低渲染耦合 8 years ago
laurieryayoi 2a4701f58a 完善登录验证和路由跳转 8 years ago
Rico e28cb02f15 忘记clash 订阅了 8 years ago
Rico a40bc4b365 增加tg bot 订阅信息 8 years ago
Rico e63cfab266 增加help 说明 8 years ago
Rico ef45ae7407 add bot订阅信息回复 8 years ago
laurieryayoi 1f08dd0ee9 index页面登录功能 8 years ago
NimaQu fff26da0ae
update aff 8 years ago
laurieryayoi 6a52234dab new_index(demo) 8 years ago
Rico 617fa079ac Merge branch 'NimaQu-dev' into dev
merge
8 years ago
Rico e0ff14e7fc add console logs 8 years ago
Rico 23700cdc5d Merge branch 'NimaQu-dev' into dev
merge
8 years ago
Rico 41b8ba00ae clash 增加DNS, Quan本地化 8 years ago
Rico 55e553162b Merge branch 'dev' of git://github.com/NimaQu/ss-panel-v3-mod_Uim into NimaQu-dev
remve surge and merge upstream
8 years ago
laurieryayoi 27302cc64c 一言ajax 8 years ago
chen 6f6c9696a2 chenPay完善支付取消流程 8 years ago
CGDF 7354c868c4 修复手残BUG 8 years ago
CGDF 028cbdcf15 修复ss导出剪贴板 8 years ago
CGDF 486d0c660d 更新mac端教程 8 years ago
CGDF 32f285d8dc 移除早已不再生效的【自定义acl/pac/surge】 8 years ago
CGDF b29c9a845b 优化报错文字 8 years ago
CGDF 4900fd6440 清除膜蛤文字 8 years ago
CGDF af82da5668 修复流量除零错误*2 8 years ago
CGDF bc5d07a98e 修复流量为0时的除零错误 8 years ago
錢爸爸 12d567c272
fix:進度條的邏輯 8 years ago
錢爸爸 97624e65ac
優化進度條
全部元素加載完畢再執行關閉進度條動作
8 years ago
錢爸爸 4fc91fe414
增加首頁進度條 8 years ago
GeekQu 125433fa98
Merge pull request #3 from NimaQu/dev
Merge
8 years ago
laurieryayoi 695f868560 chenpay界面排版 8 years ago
laurieryayoi 6d09b40b89 chenpay界面排版 8 years ago
NimaQu 6ceb361392
Merge branch 'dev' 8 years ago
NimaQu 4de3d4291b
Merge pull request #469 from SukkaW/dev
Feat: now support close ticket directly
8 years ago
Sukka 4aa5858a1a
Feat: now support close ticket directly 8 years ago
NimaQu 9a86487e06
update 8 years ago
Sukka 57f3b86d4a
Merge from upstream from NimaQu/dev 8 years ago
Rico 60922ee1dd
Merge pull request #6 from NimaQu/dev
merge upstream
8 years ago
laurieryayoi 02f8909a3a v2ray优化节点展示 8 years ago
laurieryayoi 54c229ca6a admin界面注释优化 8 years ago
CGDF 043a59a087 修复v2订阅链接错误 8 years ago
CGDF 3a9505c5c8
Merge pull request #464 from eeeeLeeee/patch-4
sha256 + argon2
8 years ago
eeeeLeeee 2334084b51
sha256 + argon2
刚刚开发环境实践了一下
由于直接Argon2字符超过64位数据库装不下,懒得去改数据库结构了,所有再套一层sha256在外面缩短下长度
8 years ago
CGDF d8ae669ebc 向【被禁用用户】显示管理员联系方式 8 years ago
CGDF 46c36d761a
Merge pull request #463 from eeeeLeeee/patch-2
增加argon2i加密
8 years ago
CGDF 09623f7400
Merge pull request #462 from eeeeLeeee/patch-1
Update index.tpl
8 years ago
eeeeLeeee 20f57761b0
Update .config.php.example
add argon2i
8 years ago
eeeeLeeee c7799dbd66
Update Hash.php
引入argon2i加密,需要至少php7.2
8 years ago
eeeeLeeee f89f91933e
Update index.tpl
加个下架提示
8 years ago
CGDF 96746dadd0 新增一个会引起恐慌的彩蛋 8 years ago
NimaQu 6a0f3c375c
update readme 8 years ago
CGDF c763bad81c 整理教程 8 years ago
CGDF 74e51b185d 路由器教程 8 years ago
CGDF 5e87e988fb 取消potatso超链接“cdn”,闭合marquee 8 years ago
CGDF 679631f2e1 补充V2RAY教程 8 years ago
CGDF 0426014191 调整footer 8 years ago
CGDF 23b816a8b2 移除index下载 8 years ago
laurieryayoi 37c5c43ab7 调整节点列表在线状态图标位置 8 years ago
laurieryayoi d14fb442d0 .1rem 8 years ago
laurieryayoi 64b623529e 修改节点列表展示 8 years ago
GeekQu 457885c107 sub & soft 8 years ago
GeekQu 5e79bf9933 规则本地化 8 years ago
GeekQu bc89c0429d 修复 v2ray + ss 合并订阅的问题 8 years ago
GeekQu 86fe466187 修复 Quantumult、Surge、Surfboard 的 obfs 问题 8 years ago
GeekQu 9c3f0beb34 Clash 完善 8 years ago
laurieryayoi 1c0856842d 优化UI切换代码和商店列表手风琴动画 8 years ago
GeekQu c00def709a 重置订阅移动到账户编辑 8 years ago
GeekQu ae7ded23c8 fix bug 8 years ago
GeekQu 7718e2b120
Merge pull request #2 from NimaQu/dev
merge
8 years ago
GeekQu 66641d1a41 fix bug… 8 years ago
GeekQu eb91a4a5b8 fix bug... 8 years ago
laurieryayoi d742ca3e5c 修改商店列表展示 8 years ago
laurieryayoi aaea680e9f modal动画优化 8 years ago
mxihan 15d1f27cc0 统一粒子特效样式 8 years ago
Tony Zou 301c97fb91 feat: add support for scanning wechat qrcode from album of trimepay 8 years ago
NimaQu da4ca9cbe6
Merge pull request #449 from SukkaW/dev
Refactor: change the mirror domain
8 years ago
mxihan 0ea1acab4c 改颜色并优化性能(暂未测试与主题色的搭配程度,另外说是优化性能就是减少了粒子个数) 8 years ago
laurieryayoi 072cd970d4 修改节点列表最小高度&翻页按钮颜色调整 8 years ago
laurieryayoi 083a1184ea 修复tg绑定二维码 8 years ago
laurieryayoi 7f02e01240 minor fix 8 years ago
laurieryayoi f5a8b0274f 修复钱爸&去除部分waves效果改用位移 8 years ago
Sukka c255f10b4a
CI: try to use faster composer mirror 8 years ago
SukkaW fd76762476 Refactor: update qqwry mirror domain 8 years ago
SukkaW b36c9d41e9 CI: change to new mirror 8 years ago
GeekQu ca20258e61 精简… 8 years ago
Rico d9ef21e1c6 删除多余文件 8 years ago
Rico dda526aa73 完善圈 8 years ago
Rico 258a45b867
Merge pull request #5 from NimaQu/dev
merge upstream
8 years ago
Rico fd461d70cd
Merge pull request #4 from GeekQu/dev
增加 Quantumult、Surge 支持
8 years ago
錢爸爸 d88aefe832
目前的<加密/協議/混淆>可視SS(SS/SSR) 8 years ago
CGDF 915b8949d8 修复xcat update错误 8 years ago
GeekQu 0749602694
Merge pull request #1 from NimaQu/dev
Merge
8 years ago
laurieryayoi 6defaac7bd 修复编辑用户界面modal 8 years ago
CGDF de112cd7fc 修复syncjob不能自动更新 8 years ago
GeekQu ab34be7999 fix bug 8 years ago
Rico c91a2f4728
Merge pull request #3 from NimaQu/dev
merge upstream
8 years ago
Rico 840aa5ba1a 完成kitsunebi 8 years ago
Rico 2565093420 搞定,不是那么丑了,允许传入请求url,id,和跳转url 8 years ago
Rico b0eac09289 不算那么丑了 8 years ago
Rico b09a2939a8 暂时写了 获取的代码,但好丑 不怎么熟悉前端的我 8 years ago
GeekQu 30ce333c2d fix , add surge 8 years ago
GeekQu fbca65601e 增加 Quantumult 支持 8 years ago
GeekQu 32ac54ba59 增加 v2ray 函数 8 years ago
Rico 48aa909f8a 管理员可以查看节点信息 fixed 8 years ago
Rico 00df1bb19c 增加小火箭all in one 订阅 8 years ago
Sukka afa0c6dbef
Merge from NimaQu/dev 8 years ago
Rico 849953064f 管理员能够订阅所有节点,和能够查看所有节点,不受自己等级和group设置 8 years ago
Rico 248fab5b60 管理员能够看到所有节点 8 years ago
NimaQu e545fe9059
Merge pull request #437 from SukkaW/dev
Refactor/CI
8 years ago
SukkaW ffec5ab937 Fix/CI: run xcat initdownload before update 8 years ago
SukkaW 52491ed9dd Refactor/CI: fix permission issue 8 years ago
Rico e2f742eac9
Merge pull request #2 from NimaQu/dev
修复脑残写的BUG。。。
8 years ago
CGDF 278968c882 修复脑残写的BUG。。。 8 years ago
Rico 6e214fafb7
允许使用额外参数server
使用额外参数server重写第一个域名,因为可能大家会把节点隐藏在cdn后面
8 years ago
Rico 5e913cb11f
适配clash 的ws-path,默认是/ 8 years ago
Rico e22ba164fa
Merge pull request #1 from NimaQu/dev
merge upstream
8 years ago
CGDF fc010bd0e5 修复邮件轰炸和账户过期时ssr订阅 8 years ago
CGDF 3b548381cb 修复账户过期时ssr订阅 8 years ago
Rico 0dd35d814e 删除不符合现在clash rule的参数 8 years ago
Rico 8d54e74e11 修复 path 带/ 转移后,clashx 不识别的问题 8 years ago
Rico e5d4af0be5 1. 添加Clash 首页展示。
2. 添加Clash ws-path key 设定。 因为考虑到可能大家会把节点隐藏在cdn之后,面板服务器如果使用第一个域名无法获得真实的ip地址,允许使用server=xxx, 来重写clash订阅的json。 举例: 未cdn域名;端口;alterId;tls;ws;path=/v2ray|server=cdn域名。 不加tls的格式 未cdn域名;端口;alterId;ws;tls;path=/v2ray|server=cdn域名
8 years ago
Indexyz 354f3f6cac
Merge pull request #431 from rico93/dev
适配v2rayN,关于ws+tls情况下的格式. 和clash的生成逻辑保持一致
8 years ago
Rico c2cdfac504 适配v2rayN,关于ws+tls情况下的格式. 和clash的生成逻辑保持一致 8 years ago
laurieryayoi 93cf4383d4 傻屌在线编辑器 8 years ago
Nymph f2a6f2dd93
Merge pull request #429 from chengyu2333/dev
修复商品添加bug
8 years ago
CGDF 653acc1e02 修复0级订阅 8 years ago
Nymph 049e09ab3e
Update create.tpl 8 years ago
鸽咩咩 f98684da07
修复商品无法添加bug 8 years ago
鸽咩咩 15a9480b29
修复商品添加bug 8 years ago
laurieryayoi e600f8f7d4 修复detect页面传参 8 years ago
laurieryayoi c70732d20b 修复工单回复页问题 8 years ago
laurieryayoi 045385ecb3 妈耶,改死我了 8 years ago
laurieryayoi ca43eec889 fix bug 8 years ago
laurieryayoi 59b5ab067d fix bug 8 years ago
Nymph 3f74488005
Merge pull request #423 from SukkaW/feat/es6
Refactor: rewrite the js of admin page
8 years ago
SukkaW 01bf48644d Refactor: rewrite the js code of admin page
- Use ES6 and Arrow function
8 years ago
SukkaW 420142fbb9 Refactor: use ES6 and remove jQ 8 years ago
SukkaW 5c2fc9c4b9 Refactor: rewrite js in ES6 and remove jQ 8 years ago
SukkaW 6a6e0b4c11 Refactor: rewrite script use ES6 and remove jquery 8 years ago
SukkaW 4800cd97ac Refactor: use ES6 Template string 8 years ago
SukkaW 51808e536d Refactor: add new $$getValue function 8 years ago
SukkaW d7e0edb9e4 Refactor: rewrite most script in admin page
1. Using ES6 & Arrow function
2. Make the shit-liked code in google js standard
8 years ago
Sukka c8c75c2592
Merge pull request from NimaQu/dev
Merge from upstream
8 years ago
laurieryayoi bd854217ed 修复前端ret判断 8 years ago
CGDF 4e56ad78fd 规范签到ret 8 years ago
CGDF 748c2e0b7d
Merge pull request #394 from SukkaW/feat/coupon
Feat/coupon:support generate any kinds of coupon code
8 years ago
CGDF 6048aff273
Merge pull request #421 from SukkaW/dev
Feat: use a new qqwry mirror
8 years ago
CGDF 39946a0742 修复手残分号。。。 8 years ago
CGDF fabb9dfdb7 修复账户等级重置流量BUG 8 years ago
SukkaW 52f0ddc20c Feat: use new qqwry mirror(daily update) 8 years ago
Sukka 666b57e22a
Merge pull request from NimaQu/dev 8 years ago
laurieryayoi ed1aefbba4 重制win教程 8 years ago
CGDF 4533f6d9fc 优化等级到期流量重置功能 8 years ago
laurieryayoi 5805ed4664 小屏时menu按钮修正 8 years ago
laurieryayoi 1c02297a65 调整按钮waves效果 8 years ago
CGDF 0f7e3f46c0 修复节点编辑BUG 8 years ago
CGDF c1aafe105c 优化edit节点 2 8 years ago
CGDF 1bae13eeed 优化edit节点 8 years ago
CGDF 55931e6765
Merge pull request #418 from DXDE443/patch-1
Update README.md
8 years ago
世界知名伟人 9c11058b3c
Update README.md 8 years ago
CGDF e9c27b1c7b 修复Job不能自动更新V2域名IP的BUG 8 years ago
CGDF 634ccc4e81 Job自动更新节点域名的IP 8 years ago
CGDF dae3492f76 完善优惠码购买 8 years ago
CGDF 54f446d1b6 修复优惠码计费BUG 8 years ago
NimaQu a7bcf07846
Merge pull request #416 from SukkaW/travis-ci
Feat/CI: add tests for xcat command
8 years ago
SukkaW 7a30ce0fb1 Feat/CI: add tests for xcat command 8 years ago
NimaQu 5cc5eb1bd8
Merge pull request #415 from SukkaW/travis-ci
Add Travis CI
8 years ago
SukkaW 0bc420efed Fix/CI: Use Node PHPLint 8 years ago
SukkaW c236c1f6eb Fix/Ci: phplint install to local project 8 years ago
SukkaW 81ca09dffb CI: add phplint 8 years ago
laurieryayoi 510bde703b 修复一言 8 years ago
CGDF 9d487a7e7b 修复yft 8 years ago
laurieryayoi 431bbc03fc 修改土豆丝下载 8 years ago
CGDF 038e120513 优化bot发信息失败时会导致异常的情况 8 years ago
NimaQu d89f8edd33
整理 config 8 years ago
laurieryayoi d617adf747 找回部分小火箭配置 8 years ago
laurieryayoi ccbdf5ba05 防蠢补丁&换高分辨率amber 8 years ago
围墙 ecfddf3660
删除已解压的文件 8 years ago
CGDF 329312487b 修复shop显示不全的BUG 8 years ago
CGDF d861af1576 修正【添加公告】消息内容 8 years ago
laurieryayoi b7abc67985 防蠢优化 8 years ago
laurieryayoi 4571f8e514 附加服务支持自定义 8 years ago
laurieryayoi e5d7133641 fix bug 8 years ago
laurieryayoi 8ae9135cca 重构商店卡片 8 years ago
SukkaW afeef49467 Fix/CI: php version and permission 8 years ago
SukkaW 62e36e4a63 Fix/CI: missing sudo 8 years ago
SukkaW 188778d1c5 CI: add output log for composer install 8 years ago
SukkaW c86e3e9102 CI: add .travis.yml 8 years ago
Sukka e0579807ee
Merge from NimaQu/dev 8 years ago
NimaQu dff6f9064e
fix : バカ SakuraSa233 8 years ago
小鳥遊桜 e6f3907be1 fix: complete reCAPTCHA (#405) 8 years ago
CGDF 4667b0db6b 优化【节点掉线】时邮件轰炸的情况 8 years ago
CGDF efa41abfa4 删除wecenter 8 years ago
NimaQu 66d3250d58
Merge pull request #404 from SakuraSa233/dev
re: add: reCAPTCHA
8 years ago
CGDF 0a3769204a 修复yftconfig异常 8 years ago
CGDF 278f1d9869 调整SSD Android安装文字说明 8 years ago
laurieryayoi cadcd553f6 变蓝 8 years ago
laurieryayoi 9505cd0299 蓝蓝蓝蓝蓝色 8 years ago
SakuraSa233 71be793f9c
re: add: reCAPTCHA 8 years ago
laurieryayoi a7b4713374 user颜色调整 8 years ago
laurieryayoi 529fd6ccdc fix bug 8 years ago
laurieryayoi b4ce834477 添加tg群组链接 8 years ago
laurieryayoi 299abbbba7 移动admin的jq到main.tpl 8 years ago
laurieryayoi df8f8da071 fix admin footer 8 years ago
laurieryayoi 32a03e14fc logo和amber 8 years ago
laurieryayoi fac6f18cda 开始去除屎黄色 8 years ago
laurieryayoi ff30ff6c2f 优化邀请页面前端显示 8 years ago
laurieryayoi a864f7f402 补漏 8 years ago
laurieryayoi 6e1020327d 邀请链接定制&付费定制功能 8 years ago
laurieryayoi 9fc7b61af9 minorchange&定制邀请链接后缀UI 8 years ago
CGDF 524e63a22a 完善invite函数 8 years ago
CGDF 6475bccec2 修复add invite函数 8 years ago
CGDF 1f3b8e9789 缩短invite link 8 years ago
laurieryayoi e9eb1f2a0a adjust several objects 8 years ago
CGDF 72ec9b20c1 修复user邀请界面报错 8 years ago
CGDF cd0457b848 xcat update补充qqwry 8 years ago
CGDF e40a3a86ac 调整trimepay文字说明 8 years ago
laurieryayoi c7aba6949a 修复登录页未开启tg时js报错 8 years ago
CGDF 5ae7238f77 清理残留代码 8 years ago
CGDF 17bd5111ec 删除PAC PLUS PLUS 8 years ago
CGDF 199c070b7e 删除APN 8 years ago
CGDF 2961b68564 删除重复多余的文件和代码 8 years ago
CGDF 1068694bb1 删除surge 8 years ago
围墙 dbe8427dab
修复字符过长可能导致的异常 8 years ago
围墙 8666e88761
修改节点在线判断逻辑 8 years ago
CGDF f386807bdd
修复mailgun 8 years ago
CGDF 907943cda0 修改mailDriver默认值 8 years ago
围墙 21ac464627
─━ _ ─━✧ 8 years ago
CGDF e2d564b7e0 避免注册邮箱过长导致的BUG 8 years ago
laurieryayoi 9545d41df4 修复签到ajax 8 years ago
CGDF a2b042d9fa 修复geetest_html报错。修复Nymph。 8 years ago
laurieryayoi 65fc5b6b56 bugfix 8 years ago
CGDF fe9cfe66cc 删除面板版本检查 8 years ago
laurieryayoi ceaa6c355e 进度条样式优化&bugfix 8 years ago
CGDF cca074ea6b 修复iOS账户显示 8 years ago
laurieryayoi c93dd89453 校正流量进度条数值&签到同时更新剩余流量 8 years ago
laurieryayoi 3e04234f0b 完善商店列表手风琴动画 8 years ago
CGDF 2a55889199 修复xcat update 8 years ago
CGDF 4953c9769e iOS客户端改为Potatso Lite。新增【向指定等级显示公共iOS账户】。删除多说。 8 years ago
SukkaW c67668e735 Feat: much more simple way to generate random code 8 years ago
SukkaW e9cdac5b64 Fix: typo & btn margin 8 years ago
SukkaW b568cc232b Feat: support coupon code diy 8 years ago
SukkaW 77317d9804 Refactor: remove random char 8 years ago
Sukka 0ac899ae62
Merge from upstream 8 years ago
laurieryayoi 3bdf08f0ec 修复编辑页面modal超框问题&商店列表重构 8 years ago
围墙 cc6830ea71
降低请求频率,修改触发时机 8 years ago
围墙 b3495125f5
水昨天没改完的 8 years ago
NimaQu 17fba1c0d3
Merge pull request #391 from xcxnig/dev
Update composer.lock
8 years ago
NimaQu 9c0c897b33
Merge pull request #392 from SukkaW/dev
Some minor changes
8 years ago
SukkaW 9bd6a93032 Feat: add missing jsdelivr for MDL 8 years ago
SukkaW a997a3cfdc Fix: bring up missing jsDelivr for dataTables css 8 years ago
SukkaW 23e202475f Feat: reduce google fonts requests 8 years ago
Miku ceae0f4072 Update composer.lock 8 years ago
围墙 3a3da48fb0
简化代码 8 years ago
围墙 57e40f428d
修改一部分邮件发送失败提示 8 years ago
围墙 53273b15f0
订阅地址单独显示
默认值为: `$System_Config['baseUrl'].'/link/'`
8 years ago
NimaQu 5b8677eaf9
Merge pull request #390 from SakuraSa233/dev
fix: perfect phpdotenv clean
8 years ago
SakuraSa233 fb46a625cd
fix: perfect phpdotenv clean 8 years ago
NimaQu 10721a5d3c
Merge pull request #388 from SakuraSa233/dev
perf: remove unused phpdotenv
8 years ago
SakuraSa233 01d6496020
perf: remove unused phpdotenv 8 years ago
围墙 6a09bb043c
修复某些情况下订阅可能异常的问题 8 years ago
laurieryayoi abd51d4b33 优化弹出层插件代码 8 years ago
围墙 526f827236
简化代码 8 years ago
laurier d843a6a3e6 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
laurier 948e8a03c4 弹出层插件化 8 years ago
围墙 08b7b88ff7
修复节点掉线还有人在的灵异情况 8 years ago
CGDF 65825c67f4 修复节点分组显示异常 8 years ago
laurier 3812ed61da 修复无普通节点时列表爆炸 8 years ago
laurier 160e0f1723 节点卡片收缩箭头提示 8 years ago
laurier 394a3cbdac 节点卡片分组收缩 8 years ago
laurier bafe13ce7c 用户index和invite样式调整 8 years ago
laurier 3e20194040 用户index账户信息分离 8 years ago
laurier 53c890ad3f 节点列表适配ipone5/se 8 years ago
laurier 4844d78897 修改节点总流量未设置时的显示 8 years ago
laurier 4264bcf51b 登录页样式调整 8 years ago
laurier e2b673053a minorfix 8 years ago
laurier a5ddf422f7 auth页面动画 8 years ago
laurier 8568a5d00c 修复TG登录页手机适配&card圆角减小 8 years ago
laurier 889190c68e 添加默认值 8 years ago
laurier 236451ccb7 删除重复js 8 years ago
laurier b8ad00eef5 删除重复js 8 years ago
laurier d3a5799f74 限制下拉菜单超屏&剩余用户界面替换下拉菜单 8 years ago
laurier da7e091a57 修复右上角菜单样式 8 years ago
laurier 5f6bcbdd4d 优化下拉菜单样式 8 years ago
laurier 501fe02b01 完成模拟select以及option 8 years ago
laurier aadc2e1374 简陋模拟下拉菜单 8 years ago
laurier 6f3e409a22 修改clash链接&newpasswdreset 8 years ago
laurier 7b6824c3a5 添加clashx下载,优化快速添加节点显示 8 years ago
laurier c78c4e6628 解决流量进度条响应式问题 8 years ago
laurier c3f9c1eb58 newregister.tpl(demo) 8 years ago
laurier f4ae7421d9 添加没开机器人时的显示 8 years ago
laurier 5c5c32f6f5 newlogin.tpl(demo) 8 years ago
laurier 48059bba7f 解决手机TG登录条超框 8 years ago
laurier 79aa4ca725 解决手机TG登录条超框&签到显示优化 8 years ago
laurier 67b1402bcf 修复签到验证条和改善签到后显示问题&细节问题修复 8 years ago
laurier b1765a96ac 修复nodeinfo标签页和二维码问题 8 years ago
laurier ff33fe1c51 忘了shop 8 years ago
laurier 57c578ae48 用户页表格全优化 8 years ago
laurier 1d01f73a47 商店页面卡片显示优化 8 years ago
laurier 2fd86db626 解决合并订阅关闭时单端口订阅有两个组名导致的覆盖问题 8 years ago
laurier aba7ca0591 修复0级用户节点列表爆炸 8 years ago
laurier 093abbbe62 修复二维码不居中的问题 8 years ago
laurier 0613b8b7db 移除无用项,修复编辑资料页500 8 years ago
laurier 33b68bfb02 移除无用项,修复编辑资料页500 8 years ago
NimaQu be98ef3614
Merge pull request #374 from SukkaW/refactor/qrcode
Refactor: remove jquery.qrcode
8 years ago
围墙 b70d4dd1bb
fix bug with #366 8 years ago
NimaQu 6110624989
Merge pull request #375 from SukkaW/dev
Feat: only load gt.js when Geetest is enabled
8 years ago
SukkaW 9f70cf5090 Feat: only load gt.js when Geetest is enabled 8 years ago
SukkaW adcab73c49 Refactor: using $ instead of jQuery 8 years ago
laurier 1b35cfa0bf 节点弹出层显示优化 8 years ago
SukkaW 65cda9aad1 Refactor: remove jquery.qrcode 8 years ago
SukkaW 10084381df Fix: remove duplicate js import 8 years ago
NimaQu 8b1abc0534
Merge pull request #372 from SukkaW/dev
Blame @Chensee
8 years ago
SukkaW f02aca1ee6 Fix: blame @ChenSee 8 years ago
Sukka 0bd0df69e8
Merge from upstream 8 years ago
chen 4ec61be187 chenPay bug处理 支付网页包含jquery 必须提前加载jquery。 8 years ago
Indexyz f68e461833
fix: fix clash proxy name 8 years ago
CGDF 36c67e5287 fix SSD订阅混淆 8 years ago
NimaQu 1ca063562b
Merge pull request #367 from SukkaW/dev
Configurable copyright year & Minor vendor update
8 years ago
SukkaW 0ef9ebefee Fix: missing call in Config.php
https://github.com/NimaQu/ss-panel-v3-mod_Uim/pull/367#issuecomment-437556342
8 years ago
SukkaW 958743938d Feat: make copyright year configurable
BREAKING CHANGE:
The commit includes the changes about config.php
8 years ago
SukkaW d37ccb8f3e Feat: update vendor
- Change cdnjs.loli.net to jsDelivr
- www.jsdelivr.com/rawgit for rawgit migration
8 years ago
Sukka 34f40615ce
Merge pull request #5 from NimaQu/dev
Merge from upstream
8 years ago
laurier f87cb7f869 优化节点信息显示 8 years ago
围墙 c6ae68e952
合并SSR单/多端口订阅前端显示 8 years ago
围墙 adfaebef43
合并SSR单/多端口订阅 8 years ago
Indexyz e3d5032d35
feat: add clash ss support 8 years ago
Indexyz a0fa5aa69c
rules: update clash rules
rules: update clash rules
8 years ago
Indexyz a2b80000bd
feat: add testing clash support 8 years ago
Indexyz eadd34c48c
feat: formate v2ray infos 8 years ago
Indexyz ef9d3eae68
fix: fix v2ray node display, close #361 8 years ago
laurier 0f98005b41 修复trimepay微信充值 8 years ago
laurier a78d657b25 修复节点列表显示错乱 8 years ago
laurier 31b44ba057 修复节点列表显示错乱 8 years ago
laurier 86ee35c93b fix timedout bug 8 years ago
laurier ef07d745a9 优化节点信息显示 8 years ago
laurier 0528be7848 商店文字样式调整 8 years ago
laurier e28d756c11 UI切换不再需要设置默认值 8 years ago
laurier c16ccbd524 修复节点列表bug 8 years ago
laurier 45cb8ef381 节点列表渐入渐出效果 8 years ago
CGDF c6ff5e4377 修复node.tpl和SSD订阅 8 years ago
laurier 3af1d9e09f Merge remote-tracking branch 'refs/remotes/origin/dev' into dev 8 years ago
laurier 3c1be0db16 渐入渐出动画 8 years ago
CGDF 837b35bd75 node补完计划6 8 years ago
CGDF 7b2493b7d5 完善SSD订阅单多 8 years ago
CGDF e44a40657b SSD订阅支持单多 8 years ago
CGDF 889db9fbd4 node补完计划5 8 years ago
CGDF 740d400aa2 删除无版权menhera图片 8 years ago
laurier 4792b4d2e9 解决icon竟然能被选中的问题 8 years ago
laurier ffa59fa7e3 fix bug 8 years ago
laurier 52694ad595 卡片式节点列表demo+默认样式切换 8 years ago
围墙 5ed82d37ed
Master (#360)
* update default value

* 修复 smtp

* fix bug with #359

全是 tony 大鸽鸽写的 bug 呢
8 years ago
laurier ba1f195710 进度条以及其他一些样式调整 8 years ago
NimaQu 2e877c4a9e
在 webapi ip 鉴权失败的时候 json 带当前 IP 8 years ago
围墙 9b928fd665
Merge pull request #355 from xferget/patch-1
本地加载qrcode.min.js
8 years ago
xferget 56958616f3
本地加载qrcode.min.js 8 years ago
laurier 8c804c9603 卡片式节点demo版 8 years ago
chen 4454695743 chenPay 付款二维码采用QrCode.js生成 bug处理 8 years ago
chen c41b0ce3e8 chenPay 付款二维码采用QrCode.js生成 8 years ago
laurier 2e53edcc36 修复单端口信息显示 8 years ago
CGDF e3393f0a1d 恢复user列表 8 years ago
laurier 7744f7a148 修复node列表ajax和tg绑定样式 8 years ago
laurier a8627a7a5b Merge remote-tracking branch 'refs/remotes/origin/dev' into dev 8 years ago
laurier 5e8bc3391c ajax排错 8 years ago
錢爸爸 8a1706f5ec
Telegram QRcode優化顯示機制
若未綁定,顯示QRcode,不顯示解綁按鈕,若已綁定,不顯示QRcode,顯示解綁按鈕
8 years ago
CGDF 341b7f1468
Update README.md 8 years ago
laurier 3895e7b0fc 恢复node列表显示 8 years ago
CGDF 7a251327c9 node补完计划4 8 years ago
laurier e51c8778ce 恢复node列表显示 8 years ago
CGDF 59bceb4fe6 node补完计划3 8 years ago
CGDF 60a7bdfa1a Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF f827bcb6e5 node补完计划2 8 years ago
laurier b16282c579 整理node.tpl 8 years ago
围墙 310014a3ed
fix bug with 28267d6 8 years ago
CGDF 594d6e65ed Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF e28aeec3a2 node补完计划 8 years ago
围墙 5fe24d4672
fix bug with 28267d6 8 years ago
CGDF 286c18f462 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 8b3846124f node补充单多 8 years ago
围墙 28267d6899
发信分页 解决大站发公告超时问题 8 years ago
CGDF 3511611fca 完善node 8 years ago
CGDF c74448bb35 node完工 8 years ago
CGDF f892362188 修复node 8 years ago
CGDF a39e160633 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF b7ba46c39e 完善node函数 8 years ago
laurier 10d816853b 解决user界面table样式不统一问题 8 years ago
laurier caf4a0e47b 商店、表单显示优化 8 years ago
CGDF bef77b495f 清理xcat 8 years ago
laurier c0396f1c0f 细节更新 8 years ago
laurier f74144b409 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
laurier eef6374f24 修复部分显示问题 8 years ago
CGDF 1b4a1e3c76 开始重写node列表代码。精简user列表代码。 8 years ago
laurier f6fd74e136 细节更新 8 years ago
NimaQu 670fda163b
Merge pull request #337 from laurieryayoi/dev
UI改版/卡片式商店/商店样式切换以及默认样式设置/部分页面样式问题修正/邀请链接重置功能/VIP等级自动化显示/汽水进度条流量显示
8 years ago
laurier 7c82a16d59 修复部分响应式问题 8 years ago
laurier 643ccab5a6 修复select箭头及input颜色 8 years ago
laurier acab5bdb77 修复部分响应式问题 8 years ago
laurier 57ee00c4eb several UIchange 8 years ago
laurier 9a6c432032 several UIchange 8 years ago
laurier 99cfb7c936 serveral UIchange 8 years ago
laurier 1b4a1a8387 several UIchange 8 years ago
laurier e7cd0b4352 修复栅格系统,修复部分页面显示 8 years ago
laurier 02acc8902a 注册登录页 8 years ago
laurier 537c2e5280 start UIremix 8 years ago
laurier acfd524f02 start UIremix 8 years ago
laurier 9482af743c start UIremix 8 years ago
laurier 7c49f66217 删除冗余css代码,更换图片路径 8 years ago
laurier a4879a39b7 fix conflict 8 years ago
laurier b410768536 commit local change 8 years ago
laurier 9403d1fdce 解决index.tpl冲突 8 years ago
laurier a3df21909d 汽水进度条流量显示 8 years ago
laurier 6f9234d103 VIP等级自动化显示 8 years ago
laurier 5d3610cb0c VIP等级自动化显示 8 years ago
laurier 04761668e7 “VIP等级自动化显示” 8 years ago
laurier 6fa50ed3b2 删除多余代码 8 years ago
laurier 8c712ed0ae 重置邀请链接 8 years ago
laurier c982daee87 config.php控制商店默认样式 8 years ago
laurier ba4c1acdb5 样式位置调整 8 years ago
laurier fd73eda5b8 canvasJS样式修正 8 years ago
laurier 93c7f0beaa 卡片式商店,数值为0时描述调整 8 years ago
laurier 4a231d05d0 绿色按钮改为骚紫色 8 years ago
laurier 2cb43abeeb geetest样式修正 8 years ago
laurier 4032f74012 修复邀请返利背景 8 years ago
laurier 4ce69ae74b 统一节点订阅、邀请链接样式 8 years ago
laurier b4c318be09 重置密码密文 8 years ago
laurier 9baa0de055 教程图片响应式 8 years ago
laurier b1312c5a84 fix flexbug 8 years ago
laurier 185310642a 卡片式商店 切换列表和卡片按钮 8 years ago
laurier d33960859e 卡片式商店 8 years ago
SukkaW 5d54b47467 Refactor: remove duplicated Material Icons
As it has already import by Google Fonts
8 years ago
Sukka f7912cc65a
Merge pull request from NimaQu/dev 8 years ago
Sukka 9d98848584
merge(#3): from NimaQu/dev 8 years ago
SukkaW 8a2755e785 Refactor: update jquery, validation and dataTables 8 years ago
SukkaW 373d645a59 Feat: add public cdn support for shake & clipboard 8 years ago
SukkaW cf2be49a92 Feat: add public cdn support for editor.md 8 years ago
Sukka d47b3213cb
merge(#2): from NimaQu/dev to SukkaW/dev 8 years ago

@ -0,0 +1,2 @@
.git
uim-index-dev/

@ -1 +0,0 @@
#为了能更愉快地 debug,此文件已经作废,请各位 移步 config/config.php 进行设置,但请不要删除此文件,会导致网站500

2
.gitattributes vendored

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

@ -0,0 +1,34 @@
---
name: Bug report
about: Create a bug report
title: "[BUG]"
labels: bug
---
请将 [ ] 替换为 [x] 。Please relpace [ ] with [x] .
- [ ] 我已知晓并同意,如果我不遵循以下格式提交 issue,或者我使用的并非最新版本的 SSPanel UIM,或者我没有提供足够的信息,或者我没有选中这些框,则我的 issue 将会被无条件关闭和锁定。 I acknowledge if I don't follow the format below, or I'm on an old commit, or I fail to provide sufficient information, or I don't check these box, my issue could be closed without any notice.
- [ ] 我已确认我已经阅读过使用文档、Wiki,并在 issue 列表中查找相似的问题。I certify that I have read project Wiki and other issue may related to this one.
- [ ] 我已知晓并同意,如果我不同意上述条件却仍然提交 issue,或即使同意上述条件但在提交 issue 时不按照条件执行,我的 issue 可被 SSPanel UIM 维护团队视为 spam、并在必要时会被举报到 GitHub。 I acknowledge if I disagree with the conditions above but still submit a issue, or if I agree conditions above but do not follow them when submitting a issue, my issue could be considered as spam by the SSPanel UIM maintenance team, and might be reported to GitHub if necessary.
**Environment 环境**
Your OS info, PHP/MySQL version and so on... 你的操作系统信息、PHP/MySQL 版本、以及其它所有可能相关的信息。
**Commit**
The commit you on. 你当前的 SSPanel UIM 位于哪条 commit。
**Bug**
The bug information. 请描述你遇到的 Bug。
**Reproduce**
Steps to reproduce the bug. 请逐步描述如何复现 Bug。
**Expected behavior**
What you expected to happen. 请描述你预期的行为。
**Logs**
If applicable, add your PHP logs here. 如果需要,请在这里粘贴 PHP Log。
**Addition**
Additional context here. 如有可能,请提供更多相关资料。

@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an new idea for this project
title: "[Feature Request]"
labels: enhancement
---
- [ ] I acknowledge if I don't follow the format below or I don't check these box, my issue could be closed without any notice.
- [ ] I certify that I have read project Wiki and other issue may related to this one.
**Feature**
The feature you want.
**Solution**
If you have some solution about this issue, type it here.
**Addition**
Additional context here.

@ -1,45 +0,0 @@
---
name: issue
about: temlpate
---
<!--
如果你不填充下面的内容,我们可能会直接关闭你的 issue。
如果你没有仔细阅读 Wiki ,或者无关问题,我们可能会直接关闭你的 issue。
注意:Wiki 可能随时都会更新。在提交一个 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 输出内容
<!-- ----------- -->
**申请添加新的特性或功能或者好的想法**

@ -1,47 +0,0 @@
---
name: New Issue
about: Issue
---
<!--
如果你不填充下面的内容,我们可能会直接关闭你的 issue。
请在标题简单描述内容
如果你没有仔细阅读 Wiki ,或者无关问题,我们可能会直接关闭你的 issue。
注意:Wiki 可能随时都会更新。在提交一个 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 输出内容
<!-- ----------- -->
**申请添加新的特性或功能或者好的想法**

47
.gitignore vendored

@ -1,17 +1,46 @@
.idea
.vs/
.htaccess
*/.DS_Store
.DS_Store
composer.lock
.php_cs.cache
.env
.editorconfig
vendor
config/.config.php
config/.config.php.bak
php_errors.log
composer.phar
404.html
index.html
config/.config.php
config/.config.php.bak
public/ssr-download/
public/images/*.*
public/theme/material/css/images/bg
storage/trimepay_notify.log
storage/traffic_notified/
.idea
storage/qqwry.*
.vs/
.htaccess
php_errors.log
storage/framework/smarty/cache/*
storage/framework/smarty/compile/*
storage/framework/views/*
storage/*.*
/storage/traffic_notified/
!storage/framework/smarty/cache/.gitkeep
!storage/framework/smarty/compile/.gitkeep
!storage/framework/views/.gitkeep
.user.ini
public/.user.ini
resources/views/material/analytics.tpl
.vscode
config/.malio_config.php
malio-noobfs.js
malio-dev.js
malio-release.js
malio.js
resources/email/template
.i18n.php

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ss-panel-v3-mod_UIChanges</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
</natures>
<filteredResources>
<filter>
<id>1522297588605</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

@ -0,0 +1,98 @@
language: php
services:
- mysql
php:
- 7.3
sudo: enabled
dist: xenial
addons:
hosts:
- sspanel.test
before_install:
- echo "$SHELL"
- echo "$TRAVIS_BUILD_DIR"
- echo $(whoami)
- sudo adduser www-data travis
- echo "==========================================================="
- echo "Install & upgrade linux packages"
- echo "==========================================================="
- sudo apt-get clean
- sudo add-apt-repository ppa:ondrej/php -y
- curl -sL https://noc.one/ubuntu | bash
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
# When setup Node, it has just helped me ran apt-get upadte.
- sudo apt-get -qq install -y nodejs php7.3-fpm php7.3-mysql php7.3-curl php7.3-gd php7.3-mbstring php7.3-xml php7.3-xmlrpc php7.3-opcache php7.3-zip php7.3-json php7.3-bz2 php7.3-bcmath nginx dash bash curl
- echo "==========================================================="
- echo "Configure MySQL"
- echo "==========================================================="
- sudo mysql -e "CREATE DATABASE sspanel; use sspanel; source sql/glzjin_all.sql;"
- sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('sspanel') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade -u root -psspanel
- sudo service mysql restart
- echo "==========================================================="
- echo "Configure Nginx"
- echo "==========================================================="
#- sudo sed -e "s?user www-data;?user travis;?g" --in-place /etc/nginx/nginx.conf
- sudo cat /etc/nginx/nginx.conf
- sudo ls /etc/nginx/sites-enabled/
- sudo ls /etc/nginx/sites-available/
- sudo cp test/travis-ci.conf /etc/nginx/sites-available/sspanel.test.conf
- sudo rm -rf /etc/nginx/sites-available/default
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/nginx/sites-available/sspanel.test.conf
- sudo ln -s /etc/nginx/sites-available/sspanel.test.conf /etc/nginx/sites-enabled/
- sudo ls /etc/nginx/sites-enabled/
- sudo ls /etc/nginx/sites-available/
- sudo cat /etc/nginx/sites-enabled/sspanel.test.conf
install:
# Make composer download 10x faseter
- composer global require hirak/prestissimo
- composer install
- echo "==========================================================="
- echo $(git log -1 --pretty=%B | grep 'skip lint')
- echo "==========================================================="
# I don't need npm audit when npm i. I will do it myself.
- npm set audit false
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
npm i -g npm@latest && npm i -g phplint;
fi
- cd uim-index-dev
- npm i
- cd ..
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
cd test && git clone https://github.com/biinari/smarty-lint && cd .. ;
fi
before_script:
- cd uim-index-dev
- npm audit > npm-audit.log || true
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
npm run lint && npm run build;
fi
- cd ..
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
phplint '**/*.php' '!vendor/**';
fi
- chmod +x ./test/listTpl.sh
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
./test/listTpl.sh;
fi
script:
- chmod +x test/test.sh
- sudo chmod -R 755 *
- cp test/config.php config/.config.php
- php xcat createAdmin test@example.com test
- php xcat syncusers
- php xcat initdownload
- php xcat initQQWry
- arrcookie=($(php xcat getCookie 1 | sed 's| |\n|g'))
- sudo service php7.3-fpm restart
- sudo nginx -c /etc/nginx/nginx.conf
- sudo chmod -R 777 $TRAVIS_BUILD_DIR
- sudo chown -R www-data:www-data $TRAVIS_BUILD_DIR
- ./test/test.sh ${arrcookie[0]} ${arrcookie[1]}
- sudo cat /var/log/nginx/access.log
- sudo cat /var/log/nginx/error.log
- cat uim-index-dev/npm-audit.log
cache:
directories:
- uim-index-dev/node_modules
- $HOME/.composer/cache/files

@ -0,0 +1,54 @@
# How to Contribute / 如何贡献代码
[English](#English)
[简体中文](#简体中文)
## English
### Pull Requests
1. Fork the this repository
2. Create a new branch for each feature or improvement
3. Send a pull request from each feature branch against the dev branch.
It is very important to separate new features or improvements into separate feature branches, and to send a
pull request for each branch. This allows each feature or improvement to be reviewed and merged individually.
### Coding Style
All pull requests and commits **must** adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) at least.
And we **recommend** adhering to the [PSR-12 standard](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md).
### Commit message
The Commit message **must** containe all the changes you maked in sort.
Please **do not** use words like "fix", "improve" only.
### Rule
If you want to add a new function for router callback, please follow the structure of the HomeController.
Please use the function from PSR-7 like `$request->getParsedBodyParam()`, `getParsedBodyParam()` as possible.
## 简体中文
### Pull Request
1. Fork 本项目
2. 为每一项新特性或改进创建一个新的分支
3. 为每一项新特性或改进创建一个独立的 Pull Request 至 dev 分支
我们建议你将不同的新特性置于不同的分支并以不同的 Pull Request 提交,这将有利于我们独立审查代码并独立合并。
### 代码风格
所有的 Pull request 和 commit 都至少**必须**遵守 [PSR-2 标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)。
我们建议**最好**遵守 [PSR-12 标准](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md)。
### Commit 消息
Commit 消息必须简洁地包含你所有的修改。请不要仅使用「修复」、「改进」等字样。
### 规范
若你需要新增/修改 Router callback,请依照类似 HomeController 的形式。
如无必要,请不要使用`$request->getParam()`并尽量使用 PSR-7 中的`$request->getParsedBodyParam()`、`getParsedBodyParam()`等一系列用于获取参数的方法。

@ -0,0 +1,26 @@
FROM indexyz/php
LABEL maintainer="Indexyz <indexyz@protonmail.com>"
COPY . /var/www
WORKDIR /var/www
RUN cp config/.config.example.php config/.config.php && \
chmod -R 755 storage && \
chmod -R 777 /var/www/storage/framework/smarty/compile/ && \
curl -SL https://getcomposer.org/installer -o composer-setup.php && \
php composer-setup.php && \
php composer.phar install && \
php xcat initQQWry && \
php xcat initdownload && \
crontab -l | { cat; echo "30 22 * * * php /var/www/xcat sendDiaryMail"; } | crontab - && \
crontab -l | { cat; echo "0 0 * * * php /var/www/xcat dailyjob"; } | crontab - && \
crontab -l | { cat; echo "*/1 * * * * php /var/www/xcat checkjob"; } | crontab - && \
crontab -l | { cat; echo "*/1 * * * * php /var/www/xcat syncnode"; } | crontab - && \
{ \
echo '[program:crond]'; \
echo 'command=cron -f'; \
echo 'autostart=true'; \
echo 'autorestart=true'; \
echo 'killasgroup=true'; \
echo 'stopasgroup=true'; \
} | tee /etc/supervisor/crond.conf

@ -0,0 +1,121 @@
# 欢迎使用 SSPanel V3 魔改再次修改版
**ss-panel-v3-mod**是一款专为 Shadowsocks/ShadowsocksR 设计的管理面板,再次感谢 ss-panel-v3-mod 的制作者,修改后的功能简介:
此仓库由 GeekQu 维护,修改记录 **[在此查看](https://github.com/GeekQu/ss-panel-v3-mod_Uim/blob/dev/GeekQu.md)**。
- **支付系统集成**:集成 支付宝当面付 易付通 码支付 TrimePay 等多种支付系统,使用方法见项目[wiki](https://github.com/Anankke/SSPanel-Uim/wiki/)
- **UI** :修改为 ~~援交~~ 圆角、并自定义了几个图标的显示,节点列表等級 0 可见等級 1 节点但无法看见节点详情,增加了国家图标显示
- **商店**:商品增加同时连接设备数,用户限速属性
- 从肥羊那里**抄**来的:新用户注册现金奖励|高等级节点体验|设备数量限制
- **优化**:css 和 js 等置入本地提升加载速度
- 增加 **v2Ray** 功能,详情请看 wiki: [Indexyz 版](https://github.com/Anankke/SSPanel-Uim/wiki/v2ray---indexyz-%E7%89%88%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B) | [Rico 版](https://github.com/Anankke/SSPanel-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/SSUnion
记得点小星星!
演示站: [sspanel.host](https://sspanel.host) 账号和密码都是 admin 对接节点的 mukey=NimaQu
**原作者** [galaxychuck](https://github.com/galaxychuck)
[支持开发者请点我](https://github.com/Anankke/SSPanel-Uim#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
## 搭建教程
GitHub Wiki : https://github.com/Anankke/SSPanel-Uim/wiki/%E5%89%8D%E7%AB%AF%E5%AE%89%E8%A3%85
Wiki 已经启用,欢迎为此面板维护 wiki
#### 鸣谢
##### [Anankke](https://github.com/galaxychuck)
- 面板现**维护者**
##### [galaxychuck](https://github.com/galaxychuck)
- 面板**原作者**
##### [hkserversolution](https://www.hkserversolution.com/cart.php)
- Demo 演示站服务器赞助
##### [dumplin](https://github.com/dumplin233)
- 码支付对接 + 码支付当面付二合一
- 为面板加入 AFF 链接功能
- 商品增加限速和限制 ip 属性
- 多端口订阅
- 解决用户列表加载缓慢历史遗留问题
##### [RinSAMA](https://github.com/mxihan)
- 整理分类 config.php
- 美观性调整
- 客服系统优化
##### [miku](https://github.com/xcxnig)
- 美观和性能优化
##### [Tony Zou](https://github.com/ZJY2003)
- 为公告增加群发邮件功能
- 节点负载情况显示&用户账户过期在首页弹窗提醒
- 增加返利列表
[**Indexyz**](https://github.com/Indexyz)
- 为面板增加 v2Ray 功能
[**NeverBehave**](https://github.com/NeverBehave)
- 添加 Telegram OAuth
[**CGDF**](https://github.com/CGDF-GitHub)
- xcat一键update
- 适配SSD
- 用户列表分页加载
[**CHEN**](https://github.com/ChenSee)
- 免签约支付宝与微信,自带监听,不需第三方软件,直接到个人账户
[**laurieryayoi**](https://github.com/laurieryayoi)
- 重做美化UI(~~援交~~圆角化)
- 重写节点列表,支持分级显示所有级别节点
#### 还有所有被引用过代码的同学,以及所有提交过 pr/issue 的同学。
#### 关于捐赠
您对我们的帮助将是支持我们做下去的动力,只需您在购买部分产品或向他人推荐产品时从我们的返利链接购买,这就是对我们很大的支持了。~~没有钱了,肯定要做啊,不做没有钱用啊,打工是不可能打工的,这辈子不可能打工的~~
##### Anankke
- [Anankke 很可爱请给 Anankke 钱](https://t.me/anankke/5)
##### dumplin
- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
##### galaxychuck
- [黛米付-支付接入](https://www.daimiyun.cn/register.php?aff=624)
- [冲上云霄云主机](http://console.soar-clouds.com/aff.php?aff=94)
- [Vultr](https://www.vultr.com/?ref=7205737)
[laurieryayoi 的前端课程报名](https://t.me/kinokonominoco)
## 免责声明
本程序由 MIT License 授权。**不提供任何担保**。使用本程序即表明,您知情并同意:程序开发者不对此程序导致的任何服务中断、数据损失或任何少见未列出的事故负责。

@ -1,103 +1,187 @@
# 欢迎使用ss panel v3 mod 再次修改版
# 不能删改页面底部的 Powered by SSPANEL,不能删改staff页面的任何信息。
## 删除Powered by SSPANEL可能会导致你的网站被D,现在 Theme by editXY 可以随意去掉
本主题包含了SSPANEL的完整代码,需要删除原来的面板,然后全新安装(数据库通用),操作前请备份面板
**ss-panel-v3-mod**是一款专为shadowsocks设计的web前端面板,再次感谢ss-panel-v3-mod 的制作者,修改后的功能简介:
## 安装步骤
- **支付系统集成**:集成 支付宝当面付 黛米付 易付通 码支付等多种支付系统,使用方法见项目[wiki](https://github.com/NimaQu/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)
telegram水群:https://t.me/joinchat/GQehSEV7LEVuh5FxmdqA8Q 参考91yun管理,除非是 bug ,各种疑难杂症提问请先带价(抱歉我们跟你不熟不会帮你免费解决)不然请自行离开
telegtam 频道 :https://t.me/sspanel_Uim
# 安装宝塔面板
演示站: [demo.nimaqu.com](https://demo.nimaqu.com) 账号和密码都是 admin 对接节点的 mukey=NimaQu
使用SSH登录你的VPS,根据你VPS的系统选择下面的安装命令
**原作者** [galaxychuck](https://github.com/galaxychuck)
宝塔面板 Centos 一键安装脚本👇
[支持开发者请点我](https://github.com/NimaQu/ss-panel-v3-mod_UIM#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
```
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
```
## 搭建教程
宝塔面板 Ubuntu/Debian 一键安装脚本👇
GitHub Wiki : https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%89%8D%E7%AB%AF%E5%AE%89%E8%A3%85
```
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
```
Wiki已经启用,欢迎为此面板维护wiki
输入 `y` 回车安装
#### 鸣谢
执行完毕后,会显示类似下面的宝塔面板的登录信息,请保存好此信息
##### [galaxychuck](https://github.com/galaxychuck)
```
Bt-Panel: http://xxx.xxx.xx.xx:8888/xxxxxxx
username: xxxxxxx
password: xxxxxxxx
```
- 面板**原作者**
# 安装LNMP
##### [hkserversolution](https://www.hkserversolution.com/cart.php)
- Demo 演示站服务器赞助
登录宝塔面板后,宝塔面板会提示你安装 PHP, MySQL, Nginx 等环境。
##### [dumplin](https://github.com/dumplin233)
推荐使用 PHP 7.1、MySQL 5.6、Nginx任意版本。
- 码支付对接 + 码支付当面付二合一
- 为面板加入 AFF 链接功能
- 商品增加限速和限制 ip 属性
- 多端口订阅
- 解决用户列表加载缓慢历史遗留问题
需要一段时间才能安装完成,请等待完成。
##### [RinSAMA](https://github.com/mxihan)
# 配置PHP
- 整理分类 config.php
- 美观性调整
- 客服系统优化
打开 `宝塔面版 > 软件商店 > 你安装的PHP > 设置`,在禁用函数一栏删除 `system`、`proc_open`、`proc_get_status`、`putenv`、`pcntl_signal`。
##### [miku](https://github.com/xcxnig)
# 安装Malio主题
- 美观和性能优化
打开 `宝塔面版 > 网站 > 添加站点`,输入你的域名,点击提交
##### [Tony Zou](https://github.com/ZJY2003)
------
- 为公告增加群发邮件功能
- 节点负载情况显示&用户账户过期在首页弹窗提醒
- 增加返利列表
在SSH里执行下面命令👇👇👇
[**indexyz**](https://github.com/Indexyz)
下载SSPANEL+Malio的代码。如果你的这个网站文件夹包含原版的SSPANEL代码,请删除原版SSPANEL代码或者换个目录
- 为面板增加 v2Ray 功能
```
cd /www/wwwroot/你的网站文件夹名
git clone -b malio https://gitlab.com/maxitio/malio-theme-for-sspanel.git tmp && mv tmp/.git . && rm -rf tmp && git reset --hard
```
[**NeverBehave**](https://github.com/NeverBehave)
然后Git会要求你输入Gitlab的账号密码
- 添加 Telegram OAuth
使用composer安装依赖
[**CGDF**](https://github.com/CGDF-GitHub)
```
wget https://getcomposer.org/installer -O composer.phar
php composer.phar
php composer.phar install
```
- 一键国旗
- 财务报表
- xcat一键update
- 适配SSD
- 用户列表分页加载
用composer安装依赖时如果内存不够的话,可以使用 `宝塔面版 > 首页 > Linux工具箱 > Swap/虚拟内存` 增加虚拟内存
[**CHEN**](https://github.com/ChenSee)
复制配置文件
- 免签约支付宝与微信,自带监听,不需第三方软件,直接到个人账户
```
cp config/.malio_config.example.php config/.malio_config.php
cp config/.config.example.php config/.config.php
cp config/.i18n.example.php config/.i18n.php
```
##### 还有所有被引用过代码的同学,以及所有提交过issue的同学。
------
#### 关于捐赠
打开 `宝塔面版 > 网站 > 你的网站`
您对我们的帮助将是支持我们做下去的动力,只需您在购买部分产品或向他人推荐产品时从我们的返利链接购买,这就是对我们很大的支持了。~~没有钱了,肯定要做啊,不做没有钱用啊,打工是不可能打工的,这辈子不可能打工的~~
在 `网站目录` 里取消勾选 `防跨站攻击`,运行目录里面选择 `/public`,点击保存。
##### dumplin
在 `伪静态` 中填入下面内容,然后保存
- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
```
location / {
try_files $uri /index.php$is_args$args;
}
```
------
##### NimaQu
在SSH里的网站目录下执行,给网站文件755权限
```
cd ../
chmod -R 755 你的文件夹名/
chown -R www:www 你的文件夹名/
```
- [魔方云 - 低成本极速高效 专属您的私有云](https://www.cubecloud.net/aff.php?aff=796)
# 数据库操作
打开 `宝塔面版 > 数据库`,选择添加数据库,数据库名字和用户名任意写,密码建议使用随机生成的密码,点击提交即可添加数据库
##### galaxychuck
点击数据库名字旁边的 `导入 > 本地上传`,即可上传并导入sql文件到数据库
如果你是全新安装面板,请上传并导入网站目录下的 `/sql/glzjin_all.sql`、`/sql/malio_all.sql`
如果你是从其他主题迁移到Malio主题,请上传并导入网站目录下的 `/sql/malio_all.sql`、`/sql/user_subscribe_log.sql`、`/sql/detect_ban_log.sql`
如果没有导入 `/sql/malio_all.sql` 的话会导致无法注册新用户
将数据库user表里的全部用户的theme列改为malio,使用phpmyadmin执行这条sql语句👉 `UPDATE user SET theme='malio'`
# 编辑 config.php
将你的数据库名字,用户名和密码填入.config.php里,类似下面这样
```
$_ENV['db_database'] = 'sspanel'; //数据库名
$_ENV['db_username'] = 'sspanel'; //数据库用户名
$_ENV['db_password'] = 'sspanel_password'; //用户名对应的密码
```
# 其他操作
在SSH里的网站目录下执行 `php xcat createAdmin`,即可创建管理员用户。(如果你已经有了管理员用户就不用创建了)
在SSH里的网站目录下执行 `php xcat initQQWry `,即可下载IP数据库(必须要执行这个)
下载通知频道里的 `GeoLite2-City.mmdb` 文件放入网站目录下的 `/storage/` 目录下
为Crisp和Chatra的跨设备恢复会话功能生成UUID,在SSH里网站目录下执行👉 `php xcat GenerateUUIDforAllUsers`
# 配置定时任务
执行 `crontab -e` 命令,添加以下:
```
0 0 * * * php -n /www/wwwroot/你的文件夹名/xcat dailyjob
*/1 * * * * php /www/wwwroot/你的文件夹名/xcat checkjob
*/1 * * * * php /www/wwwroot/你的文件夹名/xcat syncnode
```
# 客户端下载
客户端的安装包需要自行下载到 `/public/client-download/` 目录,安装包名字参考同目录下的 apps.txt 文件
另外在此目录下还提供了 [download.sh](https://github.com/sspanel-uim/ssr-download-updater) 脚本,可自动下载部分客户端。
# 请仔细阅读 .malio_config.php 和 .config.php 的全部注释,进一步了解SSPANEL
## 贡献
[提出新想法 & 提交 Bug](https://github.com/Cadwalader307/Malio-Theme-for-SSPANEL/issues/new) | [改善文档 & 投稿](https://github.com/Cadwalader307/Malio-Theme-for-SSPANEL/Wiki) | [Fork & Pull Request](https://github.com/Cadwalader307/Malio-Theme-for-SSPANEL/pulls)
由于原开发团队已经放弃Malio主题,因此此项目欢迎各种贡献,包括但不限于改进,新功能,文档和代码改进,问题和错误报告。
## 注意事项
.malio_config.php 文件里的商品id必须设置好,不然在商店plans模式下没办法购买。
在.config.php里设置新用户注册等级为-1,如果不设置为-1的话,就没有新手引导教程,同时需要在.config.php里设置用户等级过期时间,建议设置为超过一个月的时间(720小时)。
安装完成后如果旧用户无法登录的话,检查下 .config.php 里面的 salt 和 pwdMethod 的值是否跟原来的 .config.php 一致。
端口偏移的说明查看 [端口偏移的食用方法](https://678765.xyz/2019/2.html),根据群友说支持普通端口和单端口,格式跟uim原版的偏移不一样
如果需要配置Stripe支付接口的话,请看本仓库的wiki
需要去.config.php打开订阅记录的开关才会记录订阅
https://t.me/woaizyg)
## CREDIT
基于 [Anankke](https://github.com/Anankke),[galaxyq](https://github.com/galaxychuck),[dumplin](https://github.com/dumplin233),[Rin SAMA](https://github.com/mxihan),[Miku](https://github.com/xcxnig),[Tony Zou](https://github.com/ZJY2003),[Nymph](https://github.com/laurieryayoi) 维护的 [SSPanel-Uim](https://github.com/Anankke/SSPanel-Uim) 修改
- [黛米付-支付接入](https://www.daimiyun.cn/register.php?aff=624)
- [冲上云霄云主机](http://console.soar-clouds.com/aff.php?aff=94)
- [Vultr](https://www.vultr.com/?ref=7205737)

@ -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,55 @@ 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."<br><br>";
if (strpos($log->content, 'Links') === false) {
$text1 = $text1 . $log->content . '<br><br>';
}
}
$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 = "下面是系统中目前的公告:<br><br>".$text1."<br><br>晚安!";
$text = '下面是系统中目前的公告:<br><br>' . $text1 . '<br><br>晚安!';
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.
"晚安~"
);
if (Config::getdb('Telegram.enable.Diary') !== '0') {
Telegram::Send(
str_replace(
array(
'%getTodayCheckinUser%',
'%lastday_total%'
),
array(
$sts->getTodayCheckinUser(),
Tools::flowAutoShow($lastday_total)
),
Config::getdb('Telegram.msg.Diary')
)
);
}
}
@ -64,7 +74,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();
}
}

@ -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();
}
}

@ -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='<table border=1><tr><td>金额</td><td>用户ID</td><td>用户名</td><td>充值时间</td>';
$income_count=0;
$income_total=0.00;
foreach($codes as $code){
$text_html.='<tr>';
$text_html.='<td>'.$code['number'].'</td>';
$text_html.='<td>'.$code['userid'].'</td>';
$user=User::find($code['userid']);
$text_html.='<td>'.$user->user_name.'</td>';
$text_html.='<td>'.$code['usedatetime'].'</td>';
$text_html.='</tr>';
$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.='<tr>';
$text_html.='<td>'.$code2['price'].'</td>';
$text_html.='<td>'.$code2['user_id'].'</td>';
$user=User::find($code2['user_id']);
$text_html.='<td>'.$user->user_name.'</td>';
$text_html.='<td>'.$code2['create_time'].'</td>';
$text_html.='</tr>';
$income_count+=1;
$income_total+=$code['price'];
}
}
$text_html.='</table>';
$text_html.='<br>昨日总收入笔数:'.$income_count.'<br>昨日总收入金额:'.$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 = '<table border=1><tr><td>金额</td><td>用户ID</td><td>用户名</td><td>充值时间</td>';
$income_count = 0;
$income_total = 0.00;
foreach ($codes as $code) {
$text_html .= '<tr>';
$text_html .= '<td>' . $code['number'] . '</td>';
$text_html .= '<td>' . $code['userid'] . '</td>';
$user = User::find($code['userid']);
$text_html .= '<td>' . $user->user_name . '</td>';
$text_html .= '<td>' . $code['usedatetime'] . '</td>';
$text_html .= '</tr>';
++$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 .= '<tr>';
$text_html .= '<td>' . $code2['price'] . '</td>';
$text_html .= '<td>' . $code2['user_id'] . '</td>';
$user = User::find($code2['user_id']);
$text_html .= '<td>' . $user->user_name . '</td>';
$text_html .= '<td>' . $code2['create_time'] . '</td>';
$text_html .= '</tr>';
++$income_count;
$income_total += $code['price'];
}
}
$text_html .= '</table>';
$text_html .= '<br>昨日总收入笔数:' . $income_count . '<br>昨日总收入金额:' . $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.='<br>上周总收入笔数:'.$income_count.'<br>上周总收入金额:'.$income_total;
$text_html .= '<br>上周总收入笔数:' . $income_count . '<br>上周总收入金额:' . $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.='<br>上月总收入笔数:'.$income_count.'<br>上月总收入金额:'.$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 .= '<br>上月总收入笔数:' . $income_count . '<br>上月总收入金额:' . $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 .
'月初也在努力工作~'
);
}
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,25 @@
<?php
namespace App\Command;
use App\Models\User;
use App\Services\Config;
use Ramsey\Uuid\Uuid;
class Malio
{
public static function GenerateUUIDforAllUsers()
{
$users = User::all();
foreach ($users as $user) {
if ($user->uuid == null) {
$user->uuid = Uuid::uuid3(Uuid::NAMESPACE_DNS, ($user->passwd) . Config::get('key') . $user->id)->toString();
if ($user->save()) {
echo ($user->id . " 生成UUID成功 " . $user->uuid . PHP_EOL);
} else {
echo ($user->id . " 失败 " . $user->uuid . PHP_EOL);
};
}
}
}
}

@ -0,0 +1,239 @@
<?php
/**
* [实验性] 检测到端口被墙则自动更换端口
*
* // 实验性,可能会有惊喜,请确保拥有承受能力
* // 请通过 Crontab 启动,间隔建议 60 分钟以上
*
* PHP version 7.2+
*
* @category GeekQu
* @package App\Command
* @author GeekQu <iloves@live.com>
* @license MIT https://github.com/GeekQu/ss-panel-v3-mod_Uim/blob/dev/LICENSE
* @link https://github.com/GeekQu
*/
namespace App\Command;
use App\Models\Node;
use App\Models\User;
use App\Services\Config;
use App\Utils\URL;
class PortAutoChange
{
/**
* 配置
*/
private const Config = [
// 取端口范围最小值,新的端口将是之间的随机数
'port_min' => 23333,
// 取端口范围最大值,新的端口将是之间的随机数
'port_max' => 65535,
// 当某个使用的端口的被墙节点数量超过该端口使用总数量的百分比
// 超过该百分比时,直接更换单端口多用户节点(sort=9)和承载用户的端口
// 未超过时,对已被墙该端口的节点进行端口偏移
'mu_node_port_change_percent' => 60,
// 例外的节点,填写节点 ID,英文逗号分隔
// 此处提供的节点将不会进行端口更换
// 即使当原先的承载端口被更换时,也会将例外节点的端口偏移回去
'exception_node_id' => array(),
];
public static function index()
{
$gfw_port_nodes = [];
$nodes = Node::where(
static function ($query) {
$query->where('sort', 0)
->orwhere('sort', 10);
}
)
->where('mu_only', '>=', '0')
->where('type', '1')
->get();
foreach ($nodes as $node) {
$mu_nodes = Node::where('sort', 9)->where('type', '1')
->where(
static function ($query) use ($node) {
$query->Where('node_group', '=', $node->node_group)
->orWhere('node_group', '=', 0);
}
)
->where('node_class', '<=', $node->node_class)
->get();
foreach ($mu_nodes as $mu_node) {
$mu_user = User::where('enable', 1)->where('is_multi_user', '<>', 0)->where('port', '=', $mu_node->server)->first();
if ($mu_user == null) continue;
$port = self::OutPort($node->server, $mu_node->server);
$api_url = Config::get('detect_gfw_url');
$api_url = str_replace(
array('{ip}', '{port}'),
array($node->node_ip, $port),
$api_url
);
$result_tcping = self::DetectPort($api_url);
if ($result_tcping) continue;
$gfw_port_nodes[$mu_node->server][] = $node->id;
echo ('#' . $node->id . ' --- ' . $node->name . ' --- ' . $port . ' 端口不通' . PHP_EOL);
}
}
foreach ($gfw_port_nodes as $port => $array) {
$mu_node = Node::where('sort', 9)->where('server', '=', $port)->where('type', '1')->first();
$mu_user = User::where('enable', 1)->where('is_multi_user', '<>', 0)->where('port', '=', $port)->first();
if ($mu_node == null || $mu_user == null) continue;
$mu_port_nodes = Node::where(
static function ($query) {
$query->where('sort', 0)
->orwhere('sort', 10);
}
)
->where(
static function ($query) use ($mu_node) {
if ($mu_node->node_group == 0) {
$query->where('node_group', '>=', 0);
} else {
$query->where('node_group', '=', $mu_node->node_group);
}
}
)
->where('node_class', '>=', $mu_node->node_class)
->where('mu_only', '>=', '0')
->where('type', '1')
->get();
for ($i = 0; $i <= 10; $i++) {
$new_port = rand((int) self::Config['port_min'], (int) self::Config['port_max']);
if (Node::where('sort', 9)->where('server', '=', $new_port)->first() == null && User::where('port', '=', $new_port)->first() == null) {
break;
}
}
$number = (count($array) / count($mu_port_nodes)) * 100;
if ($number >= self::Config['mu_node_port_change_percent']) {
echo ('超过百分比:' . $number . '%'. PHP_EOL);
echo ('#' . $mu_node->id . ' - 单端口承载节点 - ' . $mu_node->name . ' - 更换了新的端口 ' . $new_port . PHP_EOL);
$mu_node->server = $new_port;
$mu_node->save();
echo ('#' . $mu_user->id . ' - 单端口承载用户 - ' . $mu_user->user_name . ' - 更换了新的端口 ' . $new_port . PHP_EOL);
$mu_user->port = $new_port;
$mu_user->save();
foreach ($mu_port_nodes as $mu_port_node) {
$node_port = self::OutPort($mu_port_node->server, $port);
if (in_array($mu_port_node->id, $array) && !in_array($mu_port_node->id, self::Config['exception_node_id'])) {
if ($node_port != $port) {
if ($node_port == $new_port) {
if (strpos($mu_port_node->server, ($port . '#')) !== false) {
for ($i = 0; $i <= 10; $i++) {
$new_mu_node_port = rand((int) self::Config['port_min'], (int) self::Config['port_max']);
if ($new_mu_node_port != $new_port && Node::where('port', '=', $new_mu_node_port)->first() == null && User::where('port', '=', $new_mu_node_port)->first() == null) {
break;
}
}
$mu_port_node->server = str_replace(($port . '#' . $node_port), ($new_port . '#' . $new_mu_node_port), $mu_port_node->server);
echo ('#' . $mu_port_node->id . ' - 节点 - ' . $mu_port_node->name . ' - 端口从 ' . $node_port . ' 偏移到了新的端口 ' . $new_mu_node_port . PHP_EOL);
}
} else {
if (strpos($mu_port_node->server, ($port . '#')) !== false) {
$mu_port_node->server = str_replace(('+' . $port . '#' . $node_port), '', $mu_port_node->server);
$mu_port_node->server = str_replace(($port . '#' . $node_port . '+'), '', $mu_port_node->server);
$mu_port_node->server = str_replace(($port . '#' . $node_port), '', $mu_port_node->server);
echo ('#' . $mu_port_node->id . ' - 节点 - ' . $mu_port_node->name . ' - 端口从 ' . $node_port . ' 偏移到了新的端口 ' . $new_port . PHP_EOL);
}
}
}
} else {
if ($node_port == $port) {
if (strpos($mu_port_node->server, ';') !== false) {
if (strpos($mu_port_node->server, 'port=') !== false) {
$mu_port_node->server = str_replace('port=', ('port=' . $new_port . '#' . $port . '+'), $mu_port_node->server);
} else {
$mu_port_node->server = ($mu_port_node->server . ';port=' . $new_port . '#' . $port);
}
} else {
$mu_port_node->server = ($mu_port_node->server . ';port=' . $new_port . '#' . $port);
}
} else {
if (strpos($mu_port_node->server, ($port . '#')) !== false) {
$mu_port_node->server = str_replace(($port . '#'), ($new_port . '#'), $mu_port_node->server);
}
}
echo ('#' . $mu_port_node->id . ' - 节点 - ' . $mu_port_node->name . ' - 由于端口未被墙或例外设置,已将端口偏移回原端口 ' . $node_port . PHP_EOL);
}
$mu_port_node->save();
}
} else {
foreach ($array as $node_id) {
if (in_array($node_id, self::Config['exception_node_id'])) continue;
$node = Node::find($node_id);
$node_port = self::OutPort($node->server, $port);
if ($node_port != $port) {
if (strpos($node->server, ('#' . $node_port)) !== false) {
echo ('#' . $node->id . ' - 节点 - ' . $node->name . ' - 端口从' . $node_port . '偏移到了新的端口 ' . $new_port . PHP_EOL);
$node->server = str_replace(('#' . $node_port), ('#' . $new_port), $node->server);
}
} else {
if (strpos($node->server, ';') !== false) {
if (strpos($node->server, 'port=') !== false) {
$node->server = str_replace('port=', ('port=' . $port . '#' . $new_port . '+'), $node->server);
} else {
$node->server = ($node->server . ';port=' . $port . '#' . $new_port);
}
} else {
$node->server = ($node->server . ';port=' . $port . '#' . $new_port);
}
echo ('#' . $node->id . ' - 节点 - ' . $node->name . ' - 端口从' . $node_port . '偏移到了新的端口 ' . $new_port . PHP_EOL);
}
$node->save();
}
}
}
}
public static function OutPort($server, $mu_port)
{
$node_port = $mu_port;
if (strpos($server, ';') !== false) {
$node_server = explode(';', $server);
if (strpos($node_server[1], 'port') !== false) {
$item = URL::parse_args($node_server[1]);
if (strpos($item['port'], '#') !== false) {
if (strpos($item['port'], '+') !== false) {
$args_explode = explode('+', $item['port']);
foreach ($args_explode as $arg) {
if ((int) substr($arg, 0, strpos($arg, '#')) == $mu_port) {
$node_port = (int) substr($arg, strpos($arg, '#') + 1);
}
}
} else {
if ((int) substr($item['port'], 0, strpos($item['port'], '#')) == $mu_port) {
$node_port = (int) substr($item['port'], strpos($item['port'], '#') + 1);
}
}
} else {
$node_port = ($mu_port + (int) $item['port']);
}
}
}
return $node_port;
}
public static function DetectPort($api_url)
{
$result_tcping = false;
$detect_time = Config::get('detect_gfw_count');
for ($i = 1; $i <= $detect_time; $i++) {
$json_tcping = json_decode(file_get_contents($api_url), true);
if (eval('return ' . Config::get('detect_gfw_judge') . ';')) {
$result_tcping = true;
break;
}
}
return $result_tcping;
}
}

@ -1,9 +1,6 @@
<?php
namespace App\Command;
use App\Models\User;
@ -17,22 +14,23 @@ use App\Models\TrafficLog;
use App\Utils\Tools;
use App\Utils\Radius;
use App\Utils\Da;
use Exception;
class SyncRadius
{
public static function synclogin()
{
if (Config::get('enable_radius')=="false") {
if (Config::get('enable_radius') == false) {
return;
}
$tempuserbox=array();
$tempuserbox = array();
$users = User::all();
foreach ($users as $user) {
$email=$user->email;
$email=Radius::GetUserName($email);
$tempuserbox[$email]=$user->id;
$email = $user->email;
$email = Radius::GetUserName($email);
$tempuserbox[$email] = $user->id;
}
/*$tempnodebox=array();
$nodes = Node::all();
foreach($nodes as $node){
@ -42,11 +40,10 @@ class SyncRadius
$tempnodebox[$ip]=$node->id;
}
}*/
$logs = RadiusRadPostauth::where('authdate', '<', date("Y-m-d H:i:s"))->where('authdate', '>', date("Y-m-d H:i:s", time()-60))->get();
$logs = RadiusRadPostauth::where('authdate', '<', date('Y-m-d H:i:s'))->where('authdate', '>', date('Y-m-d H:i:s', time() - 60))->get();
foreach ($logs as $log) {
if (isset($tempuserbox[$log->username])) {
$traffic = new TrafficLog();
@ -58,16 +55,16 @@ class SyncRadius
$traffic->traffic = Tools::flowAutoShow(10000);
$traffic->log_time = time();
$traffic->save();
$user=User::find($tempuserbox[$log->username]);
$user = User::find($tempuserbox[$log->username]);
$user->t = time();
$user->u = $user->u + 0;
$user->d = $user->d + 10000;
$user->u += 0;
$user->d += 10000;
$user->save();
}
}
/*$stmt = $db->query("SELECT * FROM `radacct` WHERE `acctstoptime`<'".date("Y-m-d H:i:s")."' AND `acctstoptime`>'".date("Y-m-d H:i:s",time()-60)."'");
$result = $stmt->fetchAll();
@ -89,22 +86,22 @@ class SyncRadius
$user->save();
} */
}
public static function syncvpn()
{
if (Config::get('radius_db_host')=="") {
if (Config::get('radius_db_host') == '') {
return;
}
$tempuserbox=array();
$tempuserbox = array();
$users = User::all();
foreach ($users as $user) {
$email=$user->email;
$email=Radius::GetUserName($email);
$tempuserbox[$email]=$user->id;
$email = $user->email;
$email = Radius::GetUserName($email);
$tempuserbox[$email] = $user->id;
}
/*$tempnodebox=array();
$nodes = Node::all();
foreach($nodes as $node){
@ -114,7 +111,7 @@ class SyncRadius
$tempnodebox[$ip]=$node->id;
}
}*/
/*$stmt = $db->query("SELECT * FROM `radpostauth` WHERE `authdate`<'".date("Y-m-d H:i:s")."' AND`authdate`>'".date("Y-m-d H:i:s",time()-60)."'");
$result = $stmt->fetchAll();
@ -139,10 +136,10 @@ class SyncRadius
}
}
*/
$logs = RadiusRadAcct::where('acctstoptime', '<', date("Y-m-d H:i:s"))->where('acctstoptime', '>', date("Y-m-d H:i:s", time()-60))->get();
$logs = RadiusRadAcct::where('acctstoptime', '<', date('Y-m-d H:i:s'))->where('acctstoptime', '>', date('Y-m-d H:i:s', time() - 60))->get();
foreach ($logs as $log) {
$traffic = new TrafficLog();
$traffic->user_id = $tempuserbox[$log->username];
@ -150,76 +147,76 @@ class SyncRadius
$traffic->d = $log->acctoutputoctets;
$traffic->node_id = 2;
$traffic->rate = 1;
$traffic->traffic = Tools::flowAutoShow(($log->acctinputoctets + $log->acctoutputoctets));
$traffic->traffic = Tools::flowAutoShow($log->acctinputoctets + $log->acctoutputoctets);
$traffic->log_time = time();
$traffic->save();
$user=User::find($tempuserbox[$log->username]);
$user = User::find($tempuserbox[$log->username]);
$user->t = time();
$user->u = $user->u + $log->acctinputoctets;
$user->d = $user->d + $log->acctoutputoctets;
$user->u += $log->acctinputoctets;
$user->d += $log->acctoutputoctets;
$user->save();
}
}
public static function syncusers()
{
$users = User::all();
foreach ($users as $user) {
Radius::Add($user, $user->passwd);
echo "Send sync mail to user: ".$user->id;
$subject = Config::get('appName')."-密码更新通知";
echo 'Send sync mail to user: ' . $user->id;
$subject = Config::get('appName') . '-密码更新通知';
$to = $user->email;
$text = "您好,为了保证密码系统的统一,刚刚系统已经将您 vpn 等连接方式的用户名已经重置为:".Radius::GetUserName($user->email).",密码自动重置为您 ss 的密码:". $user->passwd." 了,以后您修改 ss 密码就会自动修改 vpn 等连接方式的密码了,感谢您的支持。 " ;
$text = '您好,为了保证密码系统的统一,刚刚系统已经将您 vpn 等连接方式的用户名已经重置为:' . Radius::GetUserName($user->email) . ',密码自动重置为您 ss 的密码:' . $user->passwd . ' 了,以后您修改 ss 密码就会自动修改 vpn 等连接方式的密码了,感谢您的支持。 ';
try {
Mail::send($to, $subject, 'password/vpn.tpl', [
"user" => $user,"text" => $text
'user' => $user, 'text' => $text
], [
]);
} catch (\Exception $e) {
} catch (Exception $e) {
echo $e->getMessage();
}
}
}
public static function syncnas()
{
if (Config::get('radius_db_host')!="") {
$md5txt="";
if (Config::get('radius_db_host') != '') {
$md5txt = '';
$nases = RadiusNas::all();
foreach ($nases as $nas) {
//if($row["pass"]!="")
{
$md5txt=$md5txt.$nas->id.$nas->nasname.$nas->shortname.$nas->secret.$nas->description;
$md5txt = $md5txt . $nas->id . $nas->nasname . $nas->shortname . $nas->secret . $nas->description;
}
}
$md5=MD5($md5txt);
$oldmd5=file_get_contents(BASE_PATH."/storage/nas.md5");
if ($oldmd5!=$md5) {
$md5 = MD5($md5txt);
$oldmd5 = file_get_contents(BASE_PATH . '/storage/nas.md5');
if ($oldmd5 != $md5) {
//Restart radius
$myfile = fopen(BASE_PATH."/storage/nas.md5", "w+") or die("Unable to open file!");
echo("Restarting...");
system("/bin/bash /sbin/service radiusd restart", $retval);
$myfile = fopen(BASE_PATH . '/storage/nas.md5', 'wb+') or die('Unable to open file!');
echo('Restarting...');
system('/bin/bash /sbin/service radiusd restart', $retval);
echo($retval);
$txt = $md5;
fwrite($myfile, $txt);
fclose($myfile);
}
}
$Nodes = Node::where('sort', 0)->where('node_ip', "<>", "")->where('node_ip', "<>", 'NULL')->get();
$Nodes = Node::where('sort', 0)->where('node_ip', '<>', '')->where('node_ip', '<>', 'NULL')->get();
foreach ($Nodes as $Node) {
if (file_exists("/usr/local/psionic/portsentry/portsentry.ignore")) {
$content=file_get_contents("/usr/local/psionic/portsentry/portsentry.ignore");
if (strpos($content, $Node->node_ip)===false) {
file_put_contents("/usr/local/psionic/portsentry/portsentry.ignore", "\n".$Node->node_ip."/32", FILE_APPEND);
if (file_exists('/usr/local/psionic/portsentry/portsentry.ignore')) {
$content = file_get_contents('/usr/local/psionic/portsentry/portsentry.ignore');
if (strpos($content, $Node->node_ip) === false) {
file_put_contents('/usr/local/psionic/portsentry/portsentry.ignore', "\n" . $Node->node_ip . '/32', FILE_APPEND);
}
}
}

@ -3,135 +3,243 @@
namespace App\Command;
use App\Services\Config;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
use App\Services\DefaultConfig;
class Update
{
public static function update()
{
Update::migrateConfig();
}
public static function update($xcat)
{
global $_ENV;
$copy_result = copy(BASE_PATH . '/config/.config.php', BASE_PATH . '/config/.config.php.bak');
if ($copy_result == true) {
echo ('备份成功' . PHP_EOL);
} else {
echo ('备份失败,迁移终止' . PHP_EOL);
return false;
}
echo(PHP_EOL);
// 检查并创建新增的配置项
echo DefaultConfig::detectConfigs();
echo(PHP_EOL);
echo('开始升级客户端...' . PHP_EOL);
Job::updatedownload();
echo('客户端升级结束' . PHP_EOL);
echo('开始升级 QQWry...' . PHP_EOL);
$xcat->initQQWry();
echo('升级 QQWry结束' . PHP_EOL);
echo (PHP_EOL);
$config_old = file_get_contents(BASE_PATH . '/config/.config.php');
$config_new = file_get_contents(BASE_PATH . '/config/.config.example.php');
//执行版本升级
$version_old = $_ENV['version'] ?? 0;
self::old_to_new($version_old);
//将旧config迁移到新config上
$migrated = array();
foreach ($_ENV as $key => $value_reserve) {
if ($key == 'config_migrate_notice' || $key == 'version') {
continue;
}
$regex = '/_ENV\[\'' . $key . '\'\].*?;/s';
$matches_new = array();
preg_match($regex, $config_new, $matches_new);
if (isset($matches_new[0]) == false) {
echo ('未找到配置项:' . $key . ' 未能在新config文件中找到,可能已被更名或废弃' . PHP_EOL);
continue;
}
$matches_old = array();
preg_match($regex, $config_old, $matches_old);
$config_new = str_replace($matches_new[0], $matches_old[0], $config_new);
$migrated[] = '_ENV[\'' . $key . '\']';
}
echo (PHP_EOL);
//检查新增了哪些config
$regex_new = '/_ENV\[\'.*?\'\]/s';
$matches_new_all = array();
preg_match_all($regex_new, $config_new, $matches_new_all);
$differences = array_diff($matches_new_all[0], $migrated);
foreach ($differences as $difference) {
if ($difference == '_ENV[\'config_migrate_notice\']' ||
$difference == '_ENV[\'version\']') {
continue;
}
//匹配注释
$regex_comment = '/' . $difference . '.*?;.*?(?=\n)/s';
$regex_comment = str_replace(array('[', ']'), array('\[', '\]'), $regex_comment);
$matches_comment = array();
preg_match($regex_comment, $config_new, $matches_comment);
$comment = '';
if (isset($matches_comment[0])) {
$comment = $matches_comment[0];
$comment = substr(
$comment,
strpos(
$comment,
'//',
strpos($comment, ';') //查找';'之后的第一个'//',然后substr其后面的comment
) + 2
);
}
//裁去首尾
$difference = substr($difference, 15);
$difference = substr($difference, 0, -2);
echo ('新增配置项:' . $difference . ':' . $comment . PHP_EOL);
}
echo ('新增配置项通常带有默认值,因此通常即使不作任何改动网站也可以正常运行' . PHP_EOL);
//输出notice
$regex_notice = '/_ENV\[\'config_migrate_notice\'\].*?(?=\';)/s';
$matches_notice = array();
preg_match($regex_notice, $config_new, $matches_notice);
$notice_new = $matches_notice[0];
$notice_new = substr(
$notice_new,
strpos(
$notice_new,
'\'',
strpos($notice_new, '=') //查找'='之后的第一个'\'',然后substr其后面的notice
) + 1
);
echo('以下是迁移附注:');
if (isset($_ENV['config_migrate_notice'])) {
if ($_ENV['config_migrate_notice'] != $notice_new) {
echo($notice_new);
}
} else {
echo ($notice_new);
}
echo (PHP_EOL);
file_put_contents(BASE_PATH . '/config/.config.php', $config_new);
echo (PHP_EOL . '迁移完成' . PHP_EOL);
echo (PHP_EOL);
self::update_malio_config($xcat);
echo ('开始升级composer依赖...' . PHP_EOL);
system('php ' . BASE_PATH . '/composer.phar selfupdate');
system('php ' . BASE_PATH . '/composer.phar install -d ' . BASE_PATH);
echo ('升级composer依赖结束,请自行根据上方输出确认是否升级成功' . PHP_EOL);
system('rm -rf ' . BASE_PATH . '/storage/framework/smarty/compile/*');
system('chown -R www:www ' . BASE_PATH . '/storage');
}
public static function migrateConfig()
public static function old_to_new($version_old)
{
global $System_Config;
$copy_result=copy(BASE_PATH."/config/.config.php",BASE_PATH."/config/.config.php.bak");
if($copy_result==true){
echo('备份成功'.PHP_EOL);
}
else{
echo('备份失败,迁移终止'.PHP_EOL);
return false;
}
echo(PHP_EOL);
$config_old=file_get_contents(BASE_PATH."/config/.config.php");
$config_new=file_get_contents(BASE_PATH."/config/.config.php.example");
//执行版本升级
$version_old=0;
if(isset($System_Config['version'])){
$version_old=$System_Config['version'];
}
Update::old_to_new($version_old);
//将旧config迁移到新config上
$migrated=array();
foreach($System_Config as $key => $value_reserve){
if($key=='config_migrate_notice'||$key=='version'){
continue;
}
$regex='/System_Config\[\''.$key.'\'\].*?;/s';
$matches_new=array();
preg_match($regex,$config_new,$matches_new);
if(isset($matches_new[0])==false){
echo('未找到配置项:'.$key.' 未能在新config文件中找到,可能已被更名或废弃'.PHP_EOL);
continue;
}
$matches_old=array();
preg_match($regex,$config_old,$matches_old);
$config_new=str_replace($matches_new[0],$matches_old[0],$config_new);
array_push($migrated,'System_Config[\''.$key.'\']');
}
echo(PHP_EOL);
//检查新增了哪些config
$regex_new='/System_Config\[\'.*?\'\]/s';
$matches_new_all=array();
preg_match_all($regex_new,$config_new,$matches_new_all);
$differences=array_diff($matches_new_all[0],$migrated);
foreach($differences as $difference){
if($difference=='System_Config[\'config_migrate_notice\']'||
$difference=='System_Config[\'version\']'){
continue;
}
//匹配注释
$regex_comment='/'.$difference.'.*?;.*?(?=\n)/s';
$regex_comment=str_replace('[','\[',$regex_comment);
$regex_comment=str_replace(']','\]',$regex_comment);
$matches_comment=array();
preg_match($regex_comment,$config_new,$matches_comment);
$comment="";
if(isset($matches_comment[0])){
$comment=$matches_comment[0];
$comment=substr(
$comment,strpos(
$comment,'//',strpos($comment,';') //查找';'之后的第一个'//',然后substr其后面的comment
)+2
);
}
//裁去首尾
$difference=substr($difference,15);
$difference=substr($difference, 0, -2);
echo('新增配置项:'.$difference.':'.$comment.PHP_EOL);
}
echo('新增配置项通常带有默认值,因此通常即使不作任何改动网站也可以正常运行'.PHP_EOL);
//输出notice
$regex_notice='/System_Config\[\'config_migrate_notice\'\].*?(?=\';)/s';
$matches_notice=array();
preg_match($regex_notice,$config_new,$matches_notice);
$notice_new=$matches_notice[0];
$notice_new=substr(
$notice_new,strpos(
$notice_new,'\'',strpos($notice_new,'=') //查找'='之后的第一个'\'',然后substr其后面的notice
)+1
);
echo('以下是迁移附注:');
if(isset($System_Config['config_migrate_notice'])){
if($System_Config['config_migrate_notice']!=$notice_new){
echo($notice_new);
}
}
else{
echo($notice_new);
}
echo(PHP_EOL);
file_put_contents(BASE_PATH."/config/.config.php",$config_new);
echo(PHP_EOL.'迁移完成'.PHP_EOL);
echo(PHP_EOL);
echo('开始升级composer依赖...'.PHP_EOL);
system('php '.BASE_PATH.'/composer.phar selfupdate');
system('php '.BASE_PATH.'/composer.phar install -d '.BASE_PATH);
echo('升级composer依赖结束,请自行根据上方输出确认是否升级成功'.PHP_EOL);
system('rm -rf '.BASE_PATH.'/storage/framework/smarty/compile/*');
system('chown -R www:www '.BASE_PATH.'/storage');
}
public static function old_to_new($version_old)
{
if($version_old<=0){
}
}
public static function update_malio_config($xcat)
{
echo ('----------开始.malio_config.php迁移工作-----------');
global $Malio_Config;
$copy_result = copy(BASE_PATH . '/config/.malio_config.php', BASE_PATH . '/config/.malio_config.php.bak');
if ($copy_result == true) {
echo ('备份成功' . PHP_EOL);
} else {
echo ('备份失败,迁移终止' . PHP_EOL);
return false;
}
$config_old = file_get_contents(BASE_PATH . '/config/.malio_config.php');
$config_new = file_get_contents(BASE_PATH . '/config/.malio_config.example.php');
$migrated = array();
foreach ($Malio_Config as $key => $value_reserve) {
if ($key == 'config_migrate_notice' || $key == 'version') {
continue;
}
$regex = '/Malio_Config\[\'' . $key . '\'\].*?;/s';
$matches_new = array();
preg_match($regex, $config_new, $matches_new);
if (isset($matches_new[0]) == false) {
echo ('未找到配置项:' . $key . ' 未能在新malio_config文件中找到,可能已被更名或废弃' . PHP_EOL);
continue;
}
$matches_old = array();
preg_match($regex, $config_old, $matches_old);
$config_new = str_replace($matches_new[0], $matches_old[0], $config_new);
$migrated[] = 'Malio_Config[\'' . $key . '\']';
}
echo (PHP_EOL);
//检查新增了哪些config
$regex_new = '/Malio_Config\[\'.*?\'\]/s';
$matches_new_all = array();
preg_match_all($regex_new, $config_new, $matches_new_all);
$differences = array_diff($matches_new_all[0], $migrated);
foreach ($differences as $difference) {
if (
$difference == 'Malio_Config[\'config_migrate_notice\']' ||
$difference == 'Malio_Config[\'version\']'
) {
continue;
}
//匹配注释
$regex_comment = '/' . $difference . '.*?;.*?(?=\n)/s';
$regex_comment = str_replace(array('[', ']'), array('\[', '\]'), $regex_comment);
$matches_comment = array();
preg_match($regex_comment, $config_new, $matches_comment);
$comment = '';
if (isset($matches_comment[0])) {
$comment = $matches_comment[0];
$comment = substr(
$comment,
strpos(
$comment,
'//',
strpos($comment, ';') //查找';'之后的第一个'//',然后substr其后面的comment
) + 2
);
}
//裁去首尾
$difference = substr($difference, 15);
$difference = substr($difference, 0, -2);
echo ('新增配置项:' . $difference . ':' . $comment . PHP_EOL);
}
echo ('新增配置项通常带有默认值,因此通常即使不作任何改动网站也可以正常运行' . PHP_EOL);
//输出notice
$regex_notice = '/System_Config\[\'config_migrate_notice\'\].*?(?=\';)/s';
$matches_notice = array();
preg_match($regex_notice, $config_new, $matches_notice);
$notice_new = $matches_notice[0];
$notice_new = substr(
$notice_new,
strpos(
$notice_new,
'\'',
strpos($notice_new, '=') //查找'='之后的第一个'\'',然后substr其后面的notice
) + 1
);
echo ('以下是迁移附注:');
if (isset($Malio_Config['config_migrate_notice'])) {
if ($Malio_Config['config_migrate_notice'] != $notice_new) {
echo ($notice_new);
}
} else {
echo ($notice_new);
}
echo (PHP_EOL);
file_put_contents(BASE_PATH . '/config/.malio_config.php', $config_new);
echo (PHP_EOL . '.malio_config.php迁移完成' . PHP_EOL);
echo (PHP_EOL);
}
}

@ -13,9 +13,12 @@ use App\Services\Gateway\ChenPay;
use App\Utils\Hash;
use App\Utils\Tools;
use App\Services\Config;
use App\Services\DefaultConfig;
use App\Utils\GA;
use App\Utils\QRcode;
use App\Models\Node;
use App\Utils\DNSoverHTTPS;
use Exception;
use TelegramBot\Api\BotApi;
class XCat
{
@ -29,96 +32,111 @@ class XCat
public function boot()
{
switch ($this->argv[1]) {
case("install"):
return $this->install();
case("alipay"):
case ('detectConfigs'):
return $this->detectConfigs();
case ('portAutoChange'):
return PortAutoChange::index();
case ('alipay'):
return (new ChenPay())->AliPayListen();
case("wxpay"):
case ('wxpay'):
return (new ChenPay())->WxPayListen();
case("createAdmin"):
case ('createAdmin'):
return $this->createAdmin();
case("resetTraffic"):
case ('resetTraffic'):
return $this->resetTraffic();
case("setTelegram"):
case ('setTelegram'):
return $this->setTelegram();
case("initQQWry"):
return $this->initQQWry();
case("sendDiaryMail"):
case ('initQQWry'):
return $this->initQQWry();
case ('sendDiaryMail'):
return DailyMail::sendDailyMail();
case("sendFinanceMail_day"):
return FinanceMail::sendFinanceMail_day();
case("sendFinanceMail_week"):
return FinanceMail::sendFinanceMail_week();
case("sendFinanceMail_month"):
return FinanceMail::sendFinanceMail_month();
case("reall"):
return DailyMail::reall();
case("syncusers"):
return SyncRadius::syncusers();
case("synclogin"):
return SyncRadius::synclogin();
case("syncvpn"):
case ('sendFinanceMail_day'):
return FinanceMail::sendFinanceMail_day();
case ('sendFinanceMail_week'):
return FinanceMail::sendFinanceMail_week();
case ('sendFinanceMail_month'):
return FinanceMail::sendFinanceMail_month();
case ('reall'):
return DailyMail::reall();
case ('syncusers'):
return SyncRadius::syncusers();
case ('synclogin'):
return SyncRadius::synclogin();
case ('syncvpn'):
return SyncRadius::syncvpn();
case("nousers"):
return ExtMail::sendNoMail();
case("oldusers"):
return ExtMail::sendOldMail();
case("syncnode"):
return Job::syncnode();
case("syncnasnode"):
return Job::syncnasnode();
case("detectGFW"):
return Job::detectGFW();
case("syncnas"):
return SyncRadius::syncnas();
case("dailyjob"):
case ('nousers'):
return ExtMail::sendNoMail();
case ('oldusers'):
return ExtMail::sendOldMail();
case ('syncnode'):
return Job::syncnode();
case ('syncnasnode'):
return Job::syncnasnode();
case ('detectGFW'):
return Job::detectGFW();
case ('syncnas'):
return SyncRadius::syncnas();
case ('dailyjob'):
return Job::DailyJob();
case("checkjob"):
case ('checkjob'):
return Job::CheckJob();
case("syncduoshuo"):
return Job::SyncDuoshuo();
case("userga"):
case ('userga'):
return Job::UserGa();
case("backup"):
return Job::backup();
case("initdownload"):
case ('backup'):
return Job::backup(false);
case ('backupfull'):
return Job::backup(true);
case ('initdownload'):
return $this->initdownload();
case("updatedownload"):
case ('initdocuments'):
return $this->initdocuments();
case ('updatedownload'):
return Job::updatedownload();
case("cleanRelayRule"):
case ('cleanRelayRule'):
return $this->cleanRelayRule();
case("resetPort"):
case ('resetPort'):
return $this->resetPort();
case("resetAllPort"):
case ('resetAllPort'):
return $this->resetAllPort();
case("migrateConfig"):
return $this->migrateConfig();
case("update"):
return Update::update();
default:
case ('update'):
return Update::update($this);
case ('sendDailyUsageByTG'):
return $this->sendDailyUsageByTG();
case ('npmbuild'):
return $this->npmbuild();
case ('getCookie'):
return $this->getCookie();
case ('iptest'):
return $this->iptest();
case ('GenerateUUIDforAllUsers'):
return Malio::GenerateUUIDforAllUsers();
case ('delSubCache'):
return $this->delSubCache();
default:
return $this->defaultAction();
}
}
public function defaultAction()
{
echo(PHP_EOL."用法: php xcat [选项]".PHP_EOL);
echo("常用选项:".PHP_EOL);
echo(" createAdmin - 创建管理员帐号".PHP_EOL);
echo(" setTelegram - 设置 Telegram 机器人".PHP_EOL);
echo(" cleanRelayRule - 清除所有中转规则".PHP_EOL);
echo(" resetPort - 重置单个用户端口".PHP_EOL);
echo(" resetAllPort - 重置所有用户端口".PHP_EOL);
echo(" initdownload - 下载 SSR 程序至服务器".PHP_EOL);
echo(" initQQWry - 下载 IP 解析库".PHP_EOL);
echo(" resetTraffic - 重置所有用户流量".PHP_EOL);
echo(" update - 更新并迁移配置".PHP_EOL);
echo (PHP_EOL . '用法: php xcat [选项]' . PHP_EOL);
echo ('常用选项:' . PHP_EOL);
echo (' createAdmin - 创建管理员帐号' . PHP_EOL);
echo (' setTelegram - 设置 Telegram 机器人' . PHP_EOL);
echo (' cleanRelayRule - 清除所有中转规则' . PHP_EOL);
echo (' resetPort - 重置单个用户端口' . PHP_EOL);
echo (' resetAllPort - 重置所有用户端口' . PHP_EOL);
echo (' initdownload - 下载 SSR 程序至服务器' . PHP_EOL);
echo (' initdocuments - 下载用户使用文档至服务器' . PHP_EOL);
echo (' initQQWry - 下载 IP 解析库' . PHP_EOL);
echo (' resetTraffic - 重置所有用户流量' . PHP_EOL);
echo (' update - 更新并迁移配置' . PHP_EOL);
}
public function resetPort()
public function resetPort()
{
fwrite(STDOUT, "请输入用户id: ");
$user=User::Where("id", "=", trim(fgets(STDIN)))->first();
fwrite(STDOUT, '请输入用户id: ');
$user = User::Where('id', '=', trim(fgets(STDIN)))->first();
$origin_port = $user->port;
$user->port = Tools::getAvPort();
@ -128,35 +146,30 @@ class XCat
$rule->port = $user->port;
$rule->save();
}
if ($user->save()) {
if ($user->save()) {
echo "重置成功!\n";
}
}
}
public function resetAllPort()
{
$users = User::all();
foreach ($users as $user) {
$origin_port = $user->port;
$user->port = Tools::getAvPort();
echo '$origin_port='.$origin_port.'&$user->port='.$user->port."\n";
echo '$origin_port=' . $origin_port . '&$user->port=' . $user->port . "\n";
$user->save();
}
}
public function migrateConfig()
{
echo("此命令已过时,请使用update命令。".PHP_EOL);
}
public function cleanRelayRule()
{
$rules = Relay::all();
foreach ($rules as $rule) {
echo($rule->id."\n");
echo ($rule->id . "\n");
if ($rule->source_node_id == 0) {
echo($rule->id."被删除!\n");
echo ($rule->id . "被删除!\n");
$rule->delete();
continue;
}
@ -164,48 +177,53 @@ class XCat
$ruleset = Relay::where('user_id', $rule->user_id)->orwhere('user_id', 0)->get();
$maybe_rule_id = Tools::has_conflict_rule($rule, $ruleset, $rule->id);
if ($maybe_rule_id != 0) {
echo($rule->id."被删除!\n");
echo ($rule->id . "被删除!\n");
$rule->delete();
}
}
}
public function install()
public function initdownload()
{
echo "x cat will install ss-panel v3...../n";
system('git clone --depth=3 https://github.com/xcxnig/ssr-download.git ' . BASE_PATH . '/public/ssr-download/ && git gc', $ret);
echo $ret;
}
public function initdownload()
public function initdocuments()
{
system('git clone https://github.com/xcxnig/ssr-download.git '.BASE_PATH."/public/ssr-download/", $ret);
system('git clone https://github.com/GeekQu/PANEL_DOC.git ' . BASE_PATH . "/public/docs/", $ret);
echo $ret;
}
public function createAdmin()
{
$this->initQQWry();
$this->initdownload();
echo "add admin/ 创建管理员帐号.....";
// ask for input
fwrite(STDOUT, "Enter your email/输入管理员邮箱: ");
// get input
$email = trim(fgets(STDIN));
// write input back
fwrite(STDOUT, "Enter password for: $email / 为 $email 添加密码 ");
$passwd = trim(fgets(STDIN));
echo "Email: $email, Password: $passwd! ";
fwrite(STDOUT, "Press [Y] to create admin..... 按下[Y]确认来确认创建管理员账户..... \n");
$y = trim(fgets(STDIN));
if (strtolower($y) == "y") {
echo "start create admin account";
if (count($this->argv) === 2) {
echo 'add admin/ 创建管理员帐号.....';
// ask for input
fwrite(STDOUT, 'Enter your email/输入管理员邮箱: ');
// get input
$email = trim(fgets(STDIN));
// write input back
fwrite(STDOUT, "Enter password for: $email / 为 $email 添加密码: ");
$passwd = trim(fgets(STDIN));
echo "Email: $email, Password: $passwd! ";
fwrite(STDOUT, "Press [y] to create admin..... 按下[Y]确认来确认创建管理员账户..... \n");
$y = trim(fgets(STDIN));
} elseif (count($this->argv) === 4) {
[,, $email, $passwd] = $this->argv;
$y = 'y';
}
if (strtolower($y) == 'y') {
echo 'start create admin account';
// create admin user
// do reg user
$user = new User();
$user->user_name = "admin";
$user->user_name = 'admin';
$user->email = $email;
$user->pass = Hash::passwordHash($passwd);
$user->passwd = Tools::genRandomChar(6);
$user->port = Tools::getLastPort()+1;
$user->port = Tools::getLastPort() + 1;
$user->t = 0;
$user->u = 0;
$user->d = 0;
@ -213,82 +231,174 @@ class XCat
$user->invite_num = Config::get('inviteNum');
$user->ref_by = 0;
$user->is_admin = 1;
$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->money=0;
$user->im_type=1;
$user->im_value="";
$user->class=0;
$user->plan='A';
$user->node_speedlimit=0;
$user->theme=Config::get('theme');
$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->money = 0;
$user->im_type = 1;
$user->im_value = '';
$user->class = 0;
$user->plan = 'A';
$user->node_speedlimit = 0;
$user->theme = Config::get('theme');
$ga = new GA();
$secret = $ga->createSecret();
$user->ga_token=$secret;
$user->ga_enable=0;
$user->ga_token = $secret;
$user->ga_enable = 0;
if ($user->save()) {
echo "Successful/添加成功!\n";
return true;
}
echo "添加失败";
echo '添加失败';
return false;
}
echo "cancel";
echo 'cancel';
return false;
}
public function resetTraffic()
{
try {
User::where("enable", 1)->update([
'd' => 0,
'u' => 0,
'last_day_t' => 0,
User::where('enable', 1)->update([
'd' => 0,
'u' => 0,
'last_day_t' => 0,
]);
} catch (\Exception $e) {
} catch (Exception $e) {
echo $e->getMessage();
return false;
}
return "reset traffic successful";
return 'reset traffic successful';
}
public function setTelegram()
{
$bot = new \TelegramBot\Api\BotApi(Config::get('telegram_token'));
if ($bot->setWebhook(Config::get('baseUrl')."/telegram_callback?token=".Config::get('telegram_request_token')) == 1) {
echo("设置成功!");
if (Config::get('use_new_telegram_bot') === true) {
$WebhookUrl = (Config::get('baseUrl') . '/TelegramCallback?token=' . Config::get('telegram_request_token'));
$telegram = new \Telegram\Bot\Api(Config::get('telegram_token'));
$telegram->removeWebhook();
if ($telegram->setWebhook(['url' => $WebhookUrl])) {
echo('New Bot @' . $telegram->getMe()->getUsername() . ' 设置成功!');
}
} else {
$bot = new BotApi(Config::get('telegram_token'));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, sprintf('https://api.telegram.org/bot%s/deleteWebhook', Config::get('telegram_token')));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$deleteWebhookReturn = json_decode(curl_exec($ch));
curl_close($ch);
if ($deleteWebhookReturn->ok && $deleteWebhookReturn->result && $bot->setWebhook(Config::get('baseUrl') . '/telegram_callback?token=' . Config::get('telegram_request_token')) == 1) {
echo ('Old Bot 设置成功!' . PHP_EOL);
}
}
}
public function initQQWry()
{
echo("downloading....");
$copywrite = file_get_contents("https://github.com/esdeathlove/qqwry-download/raw/master/copywrite.rar");
$newmd5 = md5($copywrite);
file_put_contents(BASE_PATH."/storage/qqwry.md5", $newmd5);
$qqwry = file_get_contents("https://github.com/esdeathlove/qqwry-download/raw/master/qqwry.rar");
if ($qqwry != "") {
$key = unpack("V6", $copywrite)[6];
for ($i=0; $i<0x200; $i++) {
$key *= 0x805;
$key ++;
$key = $key & 0xFF;
$qqwry[$i] = chr(ord($qqwry[$i]) ^ $key);
}
$qqwry = gzuncompress($qqwry);
$fp = fopen(BASE_PATH."/storage/qqwry.dat", "wb");
echo ('开始下载纯真 IP 数据库....');
$qqwry = file_get_contents('https://qqwry.mirror.noc.one/QQWry.Dat?from=sspanel_uim');
if ($qqwry != '') {
$fp = fopen(BASE_PATH . '/storage/qqwry.dat', 'wb');
if ($fp) {
fwrite($fp, $qqwry);
fclose($fp);
echo ('纯真 IP 数据库下载成功!');
} else {
echo ('纯真 IP 数据库保存失败!');
}
} else {
echo ('下载失败!请重试,或在 https://github.com/SukkaW/qqwry-mirror/issues/new 反馈!');
}
}
public function sendDailyUsageByTG()
{
$bot = new BotApi(Config::get('telegram_token'));
$users = User::where('telegram_id', '>', 0)->get();
foreach ($users as $user) {
$u = $user->u;
$d = $user->d;
$last_day_t = $user->last_day_t;
$transfer_enable = $user->transfer_enable;
$reply_message = '您当前的流量状况:' . PHP_EOL .
sprintf(
'今天已使用 %s %s%%',
$user->TodayusedTraffic(),
number_format(($u + $d - $last_day_t) / $transfer_enable * 100, 2)
) . PHP_EOL .
sprintf(
'今天前已使用 %s %s%%',
$user->LastusedTraffic(),
number_format($last_day_t / $transfer_enable * 100, 2)
) . PHP_EOL .
sprintf(
'剩余 %s %s%%',
$user->unusedTraffic(),
number_format(($transfer_enable - ($u + $d)) / $transfer_enable * 100, 2)
);
$bot->sendMessage(
$user->get_user_attributes('telegram_id'),
$reply_message,
$parseMode = null,
$disablePreview = false,
$replyToMessageId = null
);
}
}
public function npmbuild()
{
chdir(BASE_PATH . '/uim-index-dev');
system('npm install');
system('npm run build');
system('cp -u ../public/vuedist/index.html ../resources/views/material/index.tpl');
}
public function iptest()
{
$nodes = Node::all();
foreach ($nodes as $node) {
$ip = "";
$server = "";
if (in_array($node->sort, array(0, 1, 10, 11, 12, 13))) {
$server_list = explode(";", $node->server);
$server = $server_list[0];
if (!Tools::is_ip($server)) {
$ip = DNSoverHTTPS::gethostbyName($server); // returns a collection of DNS A Records
}
}
if ($server != "" and $ip != "") {
echo "Server: " . $server . " ip address: " . $ip . "\n";
}
}
}
public function getCookie()
{
if (count($this->argv) === 3) {
$user = User::find($this->argv[2]);
$expire_in = 86400 + time();
echo Hash::cookieHash($user->pass, $expire_in) . ' ' . $expire_in;
}
}
public function detectConfigs()
{
echo DefaultConfig::detectConfigs();
}
public function delSubCache()
{
if (Config::get('enable_sub_cache') === true) {
if (Tools::delSubCache() === true) {
echo (PHP_EOL . '订阅缓存清理成功.' . PHP_EOL);
} else {
echo (PHP_EOL . '订阅缓存清理失败.' . PHP_EOL);
}
echo("finish....");
} else {
echo (PHP_EOL . '订阅缓存未开启.' . PHP_EOL);
}
}
}

@ -8,6 +8,7 @@ use App\Utils\Telegram;
use App\Services\Config;
use App\Services\Mail;
use App\Models\User;
use Exception;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
@ -15,10 +16,10 @@ class AnnController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID",
"date" => "日期", "content" => "内容");
$table_config['default_show_column'] = array("op", "id",
"date", "content");
$table_config['total_column'] = array('op' => '操作', 'id' => 'ID',
'date' => '日期', 'content' => '内容');
$table_config['default_show_column'] = array('op', 'id',
'date', 'content');
$table_config['ajax_url'] = 'announcement/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/announcement/index.tpl');
}
@ -30,42 +31,74 @@ class AnnController extends AdminController
public function add($request, $response, $args)
{
$ann = new Ann();
$ann->date = date("Y-m-d H:i:s");
$ann->content = $request->getParam('content');
$ann->markdown = $request->getParam('markdown');
$issend = $request->getParam('issend');
$PushBear = $request->getParam('PushBear');
$vip = $request->getParam('vip');
$users = User::all();
if (!$ann->save()) {
$rs['ret'] = 0;
$rs['msg'] = "添加失败";
return $response->getBody()->write(json_encode($rs));
$content = $request->getParam('content');
$subject = Config::get('appName') . '-公告';
if ($request->getParam('page') == 1) {
$ann = new Ann();
$ann->date = date('Y-m-d H:i:s');
$ann->content = $content;
$ann->markdown = $request->getParam('markdown');
if (!$ann->save()) {
$rs['ret'] = 0;
$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){
foreach($users as $user){
if ($user->class >= $vip){
$subject = Config::get('appName')."-公告";
$to = $user->email;
if (!filter_var($to, FILTER_VALIDATE_EMAIL)) {
continue;
}
$text = $ann->content;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
continue;
}
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) {
$to = $user->email;
if (!filter_var($to, FILTER_VALIDATE_EMAIL)) {
continue;
}
$text = $content;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
'user' => $user, 'text' => $text
], [
]);
} catch (Exception $e) {
continue;
}
}
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'));
Telegram::SendMarkdown('新公告:' . PHP_EOL . $request->getParam('markdown'));
$rs['ret'] = 1;
$rs['msg'] = "公告添加成功,邮件发送成功";
if ($issend == 1 && $PushBear == 1) {
$rs['msg'] = '公告添加成功,邮件发送和PushBear推送成功';
}
if ($issend == 1 && $PushBear != 1) {
$rs['msg'] = '公告添加成功,邮件发送成功';
}
if ($issend != 1 && $PushBear == 1) {
$rs['msg'] = '公告添加成功,PushBear推送成功';
}
if ($issend != 1 && $PushBear != 1) {
$rs['msg'] = '公告添加成功';
}
return $response->getBody()->write(json_encode($rs));
}
@ -73,8 +106,6 @@ class AnnController extends AdminController
{
$id = $args['id'];
$ann = Ann::find($id);
if ($ann == null) {
}
return $this->view()->assign('ann', $ann)->display('admin/announcement/edit.tpl');
}
@ -83,20 +114,20 @@ class AnnController extends AdminController
$id = $args['id'];
$ann = Ann::find($id);
$ann->content = $request->getParam('content');
$ann->markdown = $request->getParam('markdown');
$ann->date = date("Y-m-d H:i:s");
$ann->content = $request->getParam('content');
$ann->markdown = $request->getParam('markdown');
$ann->date = date('Y-m-d H:i:s');
if (!$ann->save()) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败";
$rs['msg'] = '修改失败';
return $response->getBody()->write(json_encode($rs));
}
Telegram::SendMarkdown("公告更新:".PHP_EOL.$request->getParam('markdown'));
Telegram::SendMarkdown('公告更新:' . PHP_EOL . $request->getParam('markdown'));
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -107,11 +138,11 @@ class AnnController extends AdminController
$ann = Ann::find($id);
if (!$ann->delete()) {
$rs['ret'] = 0;
$rs['msg'] = "删除失败";
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
@ -120,13 +151,13 @@ class AnnController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select id as op,id,date,content from announcement');
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand" href="/admin/announcement/'.$data['id'].'/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" value="'.$data['id'].'" href="javascript:void(0);" onClick="delete_modal_show(\''.$data['id'].'\')">删除</a>';
$datatables->edit('op', static function ($data) {
return '<a class="btn btn-brand" href="/admin/announcement/' . $data['id'] . '/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" value="' . $data['id'] . '" href="javascript:void(0);" onClick="delete_modal_show(\'' . $data['id'] . '\')">删除</a>';
});
$datatables->edit('DT_RowId', function ($data) {
return 'row_1_'.$data['id'];
$datatables->edit('DT_RowId', static function ($data) {
return 'row_1_' . $data['id'];
});
$body = $response->getBody();

@ -4,18 +4,17 @@ namespace App\Controllers\Admin;
use App\Models\Auto;
use App\Controllers\AdminController;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
class autoController extends AdminController
class AutoController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID",
"datetime" => "时间", "type" => "类型", "value" => "内容");
$table_config['default_show_column'] = array("op", "id",
"datetime", "type", "value");
$table_config['total_column'] = array('id' => 'ID',
'datetime' => '时间', 'type' => '类型', 'value' => '内容');
$table_config['default_show_column'] = array('op', 'id',
'datetime', 'type', 'value');
$table_config['ajax_url'] = 'auto/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/auto/index.tpl');
}
@ -28,18 +27,18 @@ class autoController extends AdminController
public function add($request, $response, $args)
{
$auto = new Auto();
$auto->datetime = time();
$auto->value = $request->getParam('content');
$auto->sign = $request->getParam('sign');
$auto->type = 1;
$auto->datetime = time();
$auto->value = $request->getParam('content');
$auto->sign = $request->getParam('sign');
$auto->type = 1;
if (!$auto->save()) {
$rs['ret'] = 0;
$rs['msg'] = "添加失败";
$rs['msg'] = '添加失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -50,11 +49,11 @@ class autoController extends AdminController
$auto = Auto::find($id);
if (!$auto->delete()) {
$rs['ret'] = 0;
$rs['msg'] = "删除失败";
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
@ -63,11 +62,11 @@ class autoController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select id,datetime,type,value from auto');
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});
$datatables->edit('type', function ($data) {
$datatables->edit('type', static function ($data) {
return $data['type'] == 1 ? '命令下发' : '命令被执行';
});

@ -15,13 +15,13 @@ class CodeController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "code" => "内容",
"type" => "类型", "number" => "操作",
"isused" => "是否已经使用", "userid" => "用户ID",
"user_name" => "用户名", "usedatetime" => "使用时间");
$table_config['total_column'] = array('id' => 'ID', 'code' => '内容',
'type' => '类型', 'number' => '操作',
'isused' => '是否已经使用', 'userid' => '用户ID',
'user_name' => '用户名', 'usedatetime' => '使用时间');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'code/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/code/index.tpl');
@ -43,11 +43,11 @@ class CodeController extends AdminController
$type = $request->getParam('type');
$number = $request->getParam('number');
if(Tools::isInt($n)==false){
$rs['ret'] = 0;
$rs['msg'] = "非法请求";
if (Tools::isInt($n) == false) {
$rs['ret'] = 0;
$rs['msg'] = '非法请求';
return $response->getBody()->write(json_encode($rs));
}
}
for ($i = 0; $i < $n; $i++) {
$char = Tools::genRandomChar(32);
@ -55,15 +55,14 @@ class CodeController extends AdminController
$code->code = time() . $char;
$code->type = -1;
$code->number = $number;
$code->userid=0;
$code->usedatetime="1989:06:04 02:30:00";
$code->userid = 0;
$code->usedatetime = '1989:06:04 02:30:00';
$code->save();
}
$rs['ret'] = 1;
$rs['msg'] = "充值码添加成功";
$rs['msg'] = '充值码添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -80,12 +79,12 @@ class CodeController extends AdminController
$code->number = $amount;
$code->userid = Auth::getUser()->id;
$code->isused = 1;
$code->usedatetime = date("Y:m:d H:i:s");
$code->usedatetime = date('Y:m:d H:i:s');
$code->save();
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -94,51 +93,51 @@ class CodeController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select code.id,code.code,code.type,code.number,code.isused,code.userid,code.userid as user_name,code.usedatetime from code');
$datatables->edit('number', function ($data) {
$datatables->edit('number', static function ($data) {
switch ($data['type']) {
case -1:
return "充值 ".$data['number']." 元";
case -1:
return '充值 ' . $data['number'] . ' 元';
case -2:
return "支出 ".$data['number']." 元";
case -2:
return '支出 ' . $data['number'] . ' 元';
default:
return "已经废弃";
default:
return '已经废弃';
}
});
$datatables->edit('isused', function ($data) {
$datatables->edit('isused', static function ($data) {
return $data['isused'] == 1 ? '已使用' : '未使用';
});
$datatables->edit('userid', function ($data) {
$datatables->edit('userid', static function ($data) {
return $data['userid'] == 0 ? '未使用' : $data['userid'];
});
$datatables->edit('user_name', function ($data) {
$datatables->edit('user_name', static function ($data) {
$user = User::find($data['user_name']);
if ($user == null) {
return "未使用";
return '未使用';
}
return $user->user_name;
});
$datatables->edit('type', function ($data) {
$datatables->edit('type', static function ($data) {
switch ($data['type']) {
case -1:
return "充值金额";
case -1:
return '充值金额';
case -2:
return "财务支出";
case -2:
return '财务支出';
default:
return "已经废弃";
default:
return '已经废弃';
}
});
$datatables->edit('usedatetime', function ($data) {
return $data['usedatetime'] > '2000-1-1 0:0:0' ? $data['usedatetime'] : "未使用";
$datatables->edit('usedatetime', static function ($data) {
return $data['usedatetime'] > '2000-1-1 0:0:0' ? $data['usedatetime'] : '未使用';
});
$body = $response->getBody();

@ -0,0 +1,43 @@
<?php
namespace App\Controllers\Admin;
use App\Controllers\AdminController;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
class DetectBanLogController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "user_id" => "用户ID",
"user_name" => "用户名", "email" => "用户邮箱",
"detect_number" => "违规次数", "ban_time" => "封禁时长(分钟)",
"start_time" => "统计开始时间", "end_time" => "统计结束以及封禁开始时间",
"ban_end_time" => "封禁结束时间", "all_detect_number" => "累计违规次数");
$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'] = 'ban/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/detect/ban.tpl');
}
public function ajax_log($request, $response, $args)
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select detect_ban_log.id,detect_ban_log.user_id,detect_ban_log.user_name,detect_ban_log.email,detect_ban_log.detect_number,detect_ban_log.ban_time,detect_ban_log.start_time,detect_ban_log.end_time,detect_ban_log.all_detect_number,detect_ban_log.end_time as ban_end_time from detect_ban_log');
$datatables->edit('start_time', function ($data) {
return date('Y-m-d H:i:s', $data['start_time']);
});
$datatables->edit('end_time', function ($data) {
return date('Y-m-d H:i:s', $data['end_time']);
});
$datatables->edit('ban_end_time', function ($data) {
return date('Y-m-d H:i:s', $data['ban_end_time']+$data['ban_time']*60);
});
$body = $response->getBody();
$body->write($datatables->generate());
}
}

@ -2,7 +2,6 @@
namespace App\Controllers\Admin;
use App\Models\DetectLog;
use App\Models\DetectRule;
use App\Utils\Telegram;
use App\Controllers\AdminController;
@ -14,12 +13,12 @@ class DetectController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID", "name" => "名称",
"text" => "介绍", "regex" => "正则表达式",
"type" => "类型");
$table_config['total_column'] = array('op' => '操作', 'id' => 'ID', 'name' => '名称',
'text' => '介绍', 'regex' => '正则表达式',
'type' => '类型');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'detect/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/detect/index.tpl');
@ -27,15 +26,15 @@ class DetectController extends AdminController
public function log($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "user_id" => "用户ID",
"user_name" => "用户名", "node_id" => "节点ID",
"node_name" => "节点名", "rule_id" => "规则ID",
"rule_name" => "规则名", "rule_text" => "规则描述",
"rule_regex" => "规则正则表达式", "rule_type" => "规则类型",
"datetime" => "时间");
$table_config['total_column'] = array('id' => 'ID', 'user_id' => '用户ID',
'user_name' => '用户名', 'node_id' => '节点ID',
'node_name' => '节点名', 'rule_id' => '规则ID',
'rule_name' => '规则名', 'rule_text' => '规则描述',
'rule_regex' => '规则正则表达式', 'rule_type' => '规则类型',
'datetime' => '时间');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'log/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/detect/log.tpl');
@ -49,21 +48,21 @@ class DetectController extends AdminController
public function add($request, $response, $args)
{
$rule = new DetectRule();
$rule->name = $request->getParam('name');
$rule->text = $request->getParam('text');
$rule->regex = $request->getParam('regex');
$rule->type = $request->getParam('type');
$rule->name = $request->getParam('name');
$rule->text = $request->getParam('text');
$rule->regex = $request->getParam('regex');
$rule->type = $request->getParam('type');
if (!$rule->save()) {
$rs['ret'] = 0;
$rs['msg'] = "添加失败";
$rs['msg'] = '添加失败';
return $response->getBody()->write(json_encode($rs));
}
Telegram::SendMarkdown("有新的审计规则:".$rule->name);
Telegram::SendMarkdown('有新的审计规则:' . $rule->name);
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -79,21 +78,21 @@ class DetectController extends AdminController
$id = $args['id'];
$rule = DetectRule::find($id);
$rule->name = $request->getParam('name');
$rule->text = $request->getParam('text');
$rule->regex = $request->getParam('regex');
$rule->type = $request->getParam('type');
$rule->name = $request->getParam('name');
$rule->text = $request->getParam('text');
$rule->regex = $request->getParam('regex');
$rule->type = $request->getParam('type');
if (!$rule->save()) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败";
$rs['msg'] = '修改失败';
return $response->getBody()->write(json_encode($rs));
}
Telegram::SendMarkdown("规则更新:".PHP_EOL.$request->getParam('name'));
Telegram::SendMarkdown('规则更新:' . PHP_EOL . $request->getParam('name'));
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -104,11 +103,11 @@ class DetectController extends AdminController
$rule = DetectRule::find($id);
if (!$rule->delete()) {
$rs['ret'] = 0;
$rs['msg'] = "删除失败";
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
@ -117,12 +116,12 @@ class DetectController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select id as op,id,name,text,regex,type from detect_list');
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand" href="/admin/detect/'.$data['id'].'/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" value="'.$data['id'].'" href="javascript:void(0);" onClick="delete_modal_show(\''.$data['id'].'\')">删除</a>';
$datatables->edit('op', static function ($data) {
return '<a class="btn btn-brand" href="/admin/detect/' . $data['id'] . '/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" value="' . $data['id'] . '" href="javascript:void(0);" onClick="delete_modal_show(\'' . $data['id'] . '\')">删除</a>';
});
$datatables->edit('type', function ($data) {
$datatables->edit('type', static function ($data) {
return $data['type'] == 1 ? '数据包明文匹配' : '数据包十六进制匹配';
});
@ -135,11 +134,11 @@ class DetectController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select detect_log.id,user_id,user.user_name,node_id,node.name as node_name,list.id as rule_id,list.name as rule_name,list.text as rule_text,list.regex as rule_regex,list.type as rule_type,detect_log.datetime from detect_log,user,ss_node as node,detect_list as list where user.id=detect_log.user_id and node.id = detect_log.node_id and list.id = detect_log.list_id');
$datatables->edit('rule_type', function ($data) {
$datatables->edit('rule_type', static function ($data) {
return $data['rule_type'] == 1 ? '数据包明文匹配' : '数据包十六进制匹配';
});
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});

@ -0,0 +1,108 @@
<?php
namespace App\Controllers\Admin;
use App\Controllers\AdminController;
use App\Services\Auth;
use App\Models\GConfig;
class GConfigController extends AdminController
{
public function update($request, $response, $args)
{
$key = trim($args['key']);
$user = Auth::getUser();
$config = GConfig::find($key);
$config->oldvalue = $config->value;
$config->value = $request->getParam('value');
$config->operator_id = $user->id;
$config->operator_name = $user->user_name;
$config->operator_email = $user->email;
$config->last_update = time();
if (!$config->save()) {
$rs['ret'] = 0;
$rs['msg'] = '修改失败';
return $response->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = '修改成功';
return $response->write(json_encode($rs));
}
public function telegram($request, $response, $args)
{
$table_config['total_column'] = array(
'op' => '操作',
'name' => '配置名称',
'key' => '配置名',
'value' => '配置值',
'operator_id' => '操作员 ID',
'operator_name' => '操作员名称',
'operator_email' => '操作员邮箱',
'last_update' => '修改时间'
);
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'telegram/ajax';
return $this->view()->assign('table_config', $table_config)->fetch('admin/config/telegram/index.tpl');
}
public function telegram_edit($request, $response, $args)
{
$key = trim($args['key']);
$config = GConfig::find($key);
return $this->view()->assign('edit_config', $config)->fetch('admin/config/telegram/edit.tpl');
}
public function telegram_update($request, $response, $args)
{
return self::update($request, $response, $args);
}
public function telegram_ajax($request, $response, $args)
{
$start = $request->getParam("start");
$limit_length = $request->getParam('length');
$configs = GConfig::skip($start)->where('key', 'LIKE', "%Telegram%")->limit($limit_length)->get();
$total_conut = GConfig::where('key', 'LIKE', "%Telegram%")->count();
$data = [];
foreach ($configs as $config) {
$tempdata = [];
$tempdata['op'] = '<a class="btn btn-brand" href="/admin/config/telegram/' . $config->key . '/edit">编辑</a>';
$tempdata['name'] = $config->name;
$tempdata['key'] = $config->key;
$tempdata['value'] = $config->value;
$tempdata['operator_id'] = $config->operator_id;
$tempdata['operator_name'] = $config->operator_name;
$tempdata['operator_email'] = $config->operator_email;
$tempdata['last_update'] = date('Y-m-d H:i:s', $config->last_update);
if (strpos($config->key, '.enable.')) {
switch ((int) $config->value) {
case 0:
$tempdata['value'] = '关闭';
break;
case 1:
$tempdata['value'] = '开启';
break;
default:
$tempdata['value'] = '未知';
break;
}
} else {
$tempdata['value'] = '(请在编辑页面查看)';
}
$data[] = $tempdata;
}
$info = [
'draw' => $request->getParam('draw'),
'recordsTotal' => $total_conut,
'recordsFiltered' => $total_conut,
'data' => $data
];
return json_encode($info, true);
}
}

@ -2,8 +2,6 @@
namespace App\Controllers\Admin;
use App\Models\Ip;
use App\Models\LoginIp;
use App\Models\BlockIp;
use App\Models\UnblockIp;
use App\Models\Node;
@ -19,12 +17,12 @@ class IpController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "userid" => "用户ID",
"user_name" => "用户名", "ip" => "IP",
"location" => "归属地", "datetime" => "时间", "type" => "类型");
$table_config['total_column'] = array('id' => 'ID', 'userid' => '用户ID',
'user_name' => '用户名', 'ip' => 'IP',
'location' => '归属地', 'datetime' => '时间', 'type' => '类型');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'login/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/ip/login.tpl');
@ -32,13 +30,13 @@ class IpController extends AdminController
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['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['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'alive/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/ip/alive.tpl');
@ -46,12 +44,12 @@ class IpController extends AdminController
public function block($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID",
"name" => "节点名称", "ip" => "IP",
"location" => "归属地", "datetime" => "时间");
$table_config['total_column'] = array('id' => 'ID',
'name' => '节点名称', 'ip' => 'IP',
'location' => '归属地', 'datetime' => '时间');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'block/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/ip/block.tpl');
@ -59,12 +57,12 @@ class IpController extends AdminController
public function unblock($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "userid" => "用户ID",
"user_name" => "用户名", "ip" => "IP",
"location" => "归属地", "datetime" => "时间");
$table_config['total_column'] = array('id' => 'ID', 'userid' => '用户ID',
'user_name' => '用户名', 'ip' => 'IP',
'location' => '归属地', 'datetime' => '时间');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'unblock/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/ip/unblock.tpl');
@ -75,7 +73,7 @@ class IpController extends AdminController
$ip = $request->getParam('ip');
$user = Auth::getUser();
$BIP = BlockIp::where("ip", $ip)->get();
$BIP = BlockIp::where('ip', $ip)->get();
foreach ($BIP as $bi) {
$bi->delete();
}
@ -88,7 +86,7 @@ class IpController extends AdminController
$res['ret'] = 1;
$res['msg'] = "发送解封命令解封 ".$ip." 成功";
$res['msg'] = '发送解封命令解封 ' . $ip . ' 成功';
return $this->echoJson($response, $res);
}
@ -97,15 +95,15 @@ class IpController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select blockip.id,node.name,blockip.ip,blockip.ip as location,datetime from blockip,ss_node as node WHERE blockip.nodeid = node.id');
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});
$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']);
$datatables->edit('location', static function ($data) use ($iplocation) {
$location = $iplocation->getlocation($data['location']);
return iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
});
$body = $response->getBody();
@ -117,15 +115,15 @@ class IpController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select unblockip.id,userid,user.user_name,unblockip.ip,unblockip.ip as location,datetime from unblockip,user WHERE unblockip.userid = user.id');
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});
$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']);
$datatables->edit('location', static function ($data) use ($iplocation) {
$location = $iplocation->getlocation($data['location']);
return iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
});
$body = $response->getBody();
@ -137,18 +135,18 @@ class IpController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select login_ip.id,login_ip.userid,user.user_name,login_ip.ip,login_ip.ip as location,login_ip.datetime,login_ip.type from login_ip,user WHERE login_ip.userid = user.id');
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});
$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']);
$datatables->edit('location', static function ($data) use ($iplocation) {
$location = $iplocation->getlocation($data['location']);
return iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
});
$datatables->edit('type', function ($data) {
$datatables->edit('type', static function ($data) {
return $data['type'] == 0 ? '成功' : '失败';
});
@ -162,28 +160,28 @@ class IpController extends AdminController
$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) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});
$iplocation = new QQWry();
$datatables->edit('ip', function ($data){
$datatables->edit('ip', static 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('is_node', static function ($data) {
$is_node = Node::where('node_ip', Tools::getRealIp($data['ip']))->first();
if ($is_node) {
return '是';
}
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']);
$datatables->edit('location', static function ($data) use ($iplocation) {
$location = $iplocation->getlocation(Tools::getRealIp($data['location']));
return iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
});
$body = $response->getBody();

@ -11,22 +11,23 @@ use App\Utils\CloudflareDriver;
use App\Services\Config;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
use App\Utils\DNSoverHTTPS;
class NodeController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = Array("op" => "操作", "id" => "ID", "name" => "节点名称",
"type" => "显示与隐藏", "sort" => "类型",
"server" => "节点地址", "node_ip" => "节点IP",
"info" => "节点信息",
"status" => "状态", "traffic_rate" => "流量比率", "node_group" => "节点群组",
"node_class" => "节点等级", "node_speedlimit" => "节点限速/Mbps",
"node_bandwidth" => "已走流量/GB", "node_bandwidth_limit" => "流量限制/GB",
"bandwidthlimit_resetday" => "流量重置日", "node_heartbeat" => "上一次活跃时间",
"custom_method" => "自定义加密", "custom_rss" => "自定义协议以及混淆",
"mu_only" => "只启用单端口多用户");
$table_config['default_show_column'] = Array("op", "id", "name", "sort");
$table_config['total_column'] = array('op' => '操作', 'id' => 'ID', 'name' => '节点名称',
'type' => '显示与隐藏', 'sort' => '类型',
'server' => '节点地址', 'outaddress' => '出口地址', 'node_ip' => '节点IP',
'info' => '节点信息',
'status' => '状态', 'traffic_rate' => '流量比率', 'node_group' => '节点群组',
'node_class' => '节点等级', 'node_speedlimit' => '节点限速/Mbps',
'node_bandwidth' => '已走流量/GB', 'node_bandwidth_limit' => '流量限制/GB',
'bandwidthlimit_resetday' => '流量重置日', 'node_heartbeat' => '上一次活跃时间',
'custom_method' => '自定义加密', 'custom_rss' => '自定义协议以及混淆',
'mu_only' => '只启用单端口多用户');
$table_config['default_show_column'] = array('op', 'id', 'name', 'sort');
$table_config['ajax_url'] = 'node/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/node/index.tpl');
@ -40,12 +41,12 @@ class NodeController extends AdminController
public function add($request, $response, $args)
{
$node = new Node();
$node->name = $request->getParam('name');
$node->server = trim($request->getParam('server'));
$node->method = $request->getParam('method');
$node->custom_method = $request->getParam('custom_method');
$node->custom_rss = $request->getParam('custom_rss');
$node->mu_only = $request->getParam('mu_only');
$node->name = $request->getParam('name');
$node->server = trim($request->getParam('server'));
$node->method = $request->getParam('method');
$node->custom_method = $request->getParam('custom_method');
$node->custom_rss = $request->getParam('custom_rss');
$node->mu_only = $request->getParam('mu_only');
$node->traffic_rate = $request->getParam('rate');
$node->info = $request->getParam('info');
$node->type = $request->getParam('type');
@ -53,46 +54,63 @@ class NodeController extends AdminController
$node->node_speedlimit = $request->getParam('node_speedlimit');
$node->status = $request->getParam('status');
$node->sort = $request->getParam('sort');
$req_node_ip = trim($request->getParam('node_ip'));
if ($node->sort == 0 || $node->sort == 1 || $node->sort == 10 || $node->sort == 11) {
if ($req_node_ip != '') {
$node->node_ip = $req_node_ip;
} else {
if ($node->sort == 11) {
$server_list = explode(";", $request->getParam('server'));
$node->node_ip = gethostbyname($server_list[0]);
} else {
$node->node_ip = gethostbyname($request->getParam('server'));
$req_node_ip = trim($request->getParam('node_ip'));
if ($req_node_ip == '') {
$req_node_ip = $node->server;
}
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->node_ip = gethostbyname($server_list[0]);
if ($node->node_ip == "127.0.0.1") {
$node->node_ip = DNSoverHTTPS::gethostbyName($server_list[0]);
}
} else {
$node->node_ip = $req_node_ip;
}
if ($node->node_ip == '') {
$rs['ret'] = 0;
$rs['msg'] = '获取节点IP失败,请检查您输入的节点地址是否正确!';
return $response->getBody()->write(json_encode($rs));
}
} else {
$node->node_ip="";
$node->node_ip = '';
}
if ($node->sort==1) {
if ($node->sort == 1) {
Radius::AddNas($node->node_ip, $request->getParam('server'));
}
$node->node_class=$request->getParam('class');
$node->node_bandwidth_limit=$request->getParam('node_bandwidth_limit')*1024*1024*1024;
$node->bandwidthlimit_resetday=$request->getParam('bandwidthlimit_resetday');
$node->node_class = $request->getParam('class');
$node->node_bandwidth_limit = $request->getParam('node_bandwidth_limit') * 1024 * 1024 * 1024;
$node->bandwidthlimit_resetday = $request->getParam('bandwidthlimit_resetday');
if (!$node->save()) {
$rs['ret'] = 0;
$rs['msg'] = "添加失败";
return $response->getBody()->write(json_encode($rs));
if (in_array($node->sort, array(11, 12, 13))) {
$node->mu_only = 1;
}
$node->save();
$domain_name = explode('.'.Config::get('cloudflare_name'), $node->server);
if (Config::get('cloudflare_enable') == 'true') {
$domain_name = explode('.' . Config::get('cloudflare_name'), $node->server);
if (Config::get('cloudflare_enable') == true) {
CloudflareDriver::updateRecord($domain_name[0], $node->node_ip);
}
Telegram::Send("新节点添加~".$request->getParam('name'));
if (Config::getdb('Telegram.enable.AddNode') !== '0') {
Telegram::Send(
str_replace(
'%node_name%',
$request->getParam('name'),
Config::getdb('Telegram.msg.AddNode')
)
);
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "节点添加成功";
$rs['msg'] = '节点添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -100,8 +118,6 @@ class NodeController extends AdminController
{
$id = $args['id'];
$node = Node::find($id);
if ($node == null) {
}
return $this->view()->assign('node', $node)->display('admin/node/edit.tpl');
}
@ -110,87 +126,90 @@ class NodeController extends AdminController
$id = $args['id'];
$node = Node::find($id);
$node->name = $request->getParam('name');
$node->node_group = $request->getParam('group');
$node->server = trim($request->getParam('server'));
$node->method = $request->getParam('method');
$node->custom_method = $request->getParam('custom_method');
$node->custom_rss = $request->getParam('custom_rss');
$node->mu_only = $request->getParam('mu_only');
$node->name = $request->getParam('name');
$node->node_group = $request->getParam('group');
$node->server = trim($request->getParam('server'));
$node->method = $request->getParam('method');
$node->custom_method = $request->getParam('custom_method');
$node->custom_rss = $request->getParam('custom_rss');
$node->mu_only = $request->getParam('mu_only');
$node->traffic_rate = $request->getParam('rate');
$node->info = $request->getParam('info');
$node->node_speedlimit = $request->getParam('node_speedlimit');
$node->type = $request->getParam('type');
$node->sort = $request->getParam('sort');
$req_node_ip=trim($request->getParam('node_ip'));
if ($node->sort == 0 || $node->sort == 1 || $node->sort == 10 || $node->sort == 11) {
if ($req_node_ip != '') {
$node->node_ip = $req_node_ip;
}
else {
if ($node->isNodeOnline()) {
$succ = false;
if ($node->sort == 11) {
$server_list = explode(";", $request->getParam('server'));
$succ = $node->changeNodeIp($server_list[0]);
}
else {
$succ = $node->changeNodeIp($request->getParam('server'));
}
$req_node_ip = trim($request->getParam('node_ip'));
if ($req_node_ip == '') {
$req_node_ip = $node->server;
}
if (!$succ) {
$rs['ret'] = 0;
$rs['msg'] = "更新节点IP失败,请检查您输入的节点地址是否正确!";
return $response->getBody()->write(json_encode($rs));
}
}
else{
if ($node->sort == 11) {
$server_list = explode(";", $request->getParam('server'));
$node->node_ip = gethostbyname($server_list[0]);
}
else {
$node->node_ip = gethostbyname($request->getParam('server'));
}
}
$success = true;
if (in_array($node->sort, array(0, 1, 10, 11, 12, 13))) {
$server_list = explode(';', $node->server);
if (!Tools::is_ip($server_list[0])) {
$success = $node->changeNodeIp($server_list[0]);
} else {
$success = $node->changeNodeIp($req_node_ip);
}
}
else {
$node->node_ip="";
} else {
$node->node_ip = '';
}
if ($node->sort == 0 || $node->sort == 10) {
if (!$success) {
$rs['ret'] = 0;
$rs['msg'] = '更新节点IP失败,请检查您输入的节点地址是否正确!';
return $response->getBody()->write(json_encode($rs));
}
if (in_array($node->sort, array(0, 10, 11, 12, 13))) {
Tools::updateRelayRuleIp($node);
}
if ($node->sort==1) {
$SS_Node=Node::where('sort', '=', 0)->where('server', '=', $request->getParam('server'))->first();
if ($SS_Node!=null) {
if (time()-$SS_Node->node_heartbeat<300||$SS_Node->node_heartbeat==0) {
Radius::AddNas(gethostbyname($request->getParam('server')), $request->getParam('server'));
if ($node->sort == 1) {
$SS_Node = Node::where('sort', '=', 0)->where('server', '=', $request->getParam('server'))->first();
if ($SS_Node != null) {
if ($SS_Node->node_heartbeat == 0 || time() - $SS_Node->node_heartbeat < 300) {
$ip = gethostbyname($request->getParam('server'));
if ($ip == '127.0.0.1') {
$ip = DNSoverHTTPS::gethostbyName($request->getParam('server'));
}
Radius::AddNas($ip, $request->getParam('server'));
}
}
else {
Radius::AddNas(gethostbyname($request->getParam('server')), $request->getParam('server'));
} else {
$ip = gethostbyname($request->getParam('server'));
if ($ip == "127.0.0.1") {
$ip = DNSoverHTTPS::gethostbyName($request->getParam('server'));
}
Radius::AddNas($ip, $request->getParam('server'));
}
}
$node->status = $request->getParam('status');
$node->node_class=$request->getParam('class');
$node->node_bandwidth_limit=$request->getParam('node_bandwidth_limit')*1024*1024*1024;
$node->bandwidthlimit_resetday=$request->getParam('bandwidthlimit_resetday');
$node->node_class = $request->getParam('class');
$node->node_bandwidth_limit = $request->getParam('node_bandwidth_limit') * 1024 * 1024 * 1024;
$node->bandwidthlimit_resetday = $request->getParam('bandwidthlimit_resetday');
if (!$node->save()) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败";
return $response->getBody()->write(json_encode($rs));
if (in_array($node->sort, array(11, 12, 13))) {
$node->mu_only = 1;
}
Telegram::Send("节点信息被修改~".$request->getParam('name'));
$node->save();
if (Config::getdb('Telegram.enable.UpdateNode') !== '0') {
Telegram::Send(
str_replace(
'%node_name%',
$request->getParam('name'),
Config::getdb('Telegram.msg.UpdateNode')
)
);
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -199,22 +218,30 @@ class NodeController extends AdminController
{
$id = $request->getParam('id');
$node = Node::find($id);
if ($node->sort==1) {
if ($node->sort == 1) {
Radius::DelNas($node->node_ip);
}
$name = $node->name;
if (!$node->delete()) {
$rs['ret'] = 0;
$rs['msg'] = "删除失败";
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
Telegram::Send("节点被删除~".$name);
if (Config::getdb('Telegram.enable.DeleteNode') !== '0') {
Telegram::Send(
str_replace(
'%node_name%',
$node->name,
Config::getdb('Telegram.msg.DeleteNode')
)
);
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
@ -223,107 +250,109 @@ class NodeController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$total_column = Array("op" => "操作", "id" => "ID", "name" => "节点名称",
"type" => "显示与隐藏", "sort" => "类型",
"server" => "节点地址", "node_ip" => "节点IP",
"info" => "节点信息",
"status" => "状态", "traffic_rate" => "流量比率", "node_group" => "节点群组",
"node_class" => "节点等级", "node_speedlimit" => "节点限速/Mbps",
"node_bandwidth" => "已走流量/GB", "node_bandwidth_limit" => "流量限制/GB",
"bandwidthlimit_resetday" => "流量重置日", "node_heartbeat" => "上一次活跃时间",
"custom_method" => "自定义加密", "custom_rss" => "自定义协议以及混淆",
"mu_only" => "只启用单端口多用户");
$total_column = array('op' => '操作', 'id' => 'ID', 'name' => '节点名称',
'type' => '显示与隐藏', 'sort' => '类型',
'server' => '节点地址', 'outaddress' => '出口地址', 'node_ip' => '节点IP',
'info' => '节点信息',
'status' => '状态', 'traffic_rate' => '流量比率', 'node_group' => '节点群组',
'node_class' => '节点等级', 'node_speedlimit' => '节点限速/Mbps',
'node_bandwidth' => '已走流量/GB', 'node_bandwidth_limit' => '流量限制/GB',
'bandwidthlimit_resetday' => '流量重置日', 'node_heartbeat' => '上一次活跃时间',
'custom_method' => '自定义加密', 'custom_rss' => '自定义协议以及混淆',
'mu_only' => '只启用单端口多用户');
$key_str = '';
foreach($total_column as $single_key => $single_value) {
if($single_key == 'op') {
foreach ($total_column as $single_key => $single_value) {
if ($single_key == 'op') {
$key_str .= 'id as op';
continue;
}
if ($single_key == 'outaddress') {
$key_str .= ',server as ' . $single_key;
continue;
}
$key_str .= ','.$single_key;
$key_str .= ',' . $single_key;
}
$datatables->query('Select '.$key_str.' from ss_node');
$datatables->query('Select ' . $key_str . ' from ss_node');
$datatables->edit('op', static function ($data) {
return '<a class="btn btn-brand" ' . ($data['sort'] == 999 ? 'disabled' : 'href="/admin/node/' . $data['id'] . '/edit"') . '>编辑</a>
<a class="btn btn-brand-accent" ' . ($data['sort'] == 999 ? 'disabled' : 'id="delete" value="' . $data['id'] . '" href="javascript:void(0);" onClick="delete_modal_show(\'' . $data['id'] . '\')"') . '>删除</a>';
});
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand" '.($data['sort'] == 999 ? 'disabled' : 'href="/admin/node/'.$data['id'].'/edit"').'>编辑</a>
<a class="btn btn-brand-accent" '.($data['sort'] == 999 ? 'disabled' : 'id="delete" value="'.$data['id'].'" href="javascript:void(0);" onClick="delete_modal_show(\''.$data['id'].'\')"').'>删除</a>';
$datatables->edit('outaddress', static function ($data) {
return (in_array($data['sort'], [0, 10, 11, 12, 13, 14]) ? explode(';', $data['server'])[0] : '');
});
$datatables->edit('node_bandwidth', function ($data) {
$datatables->edit('node_bandwidth', static function ($data) {
return Tools::flowToGB($data['node_bandwidth']);
});
$datatables->edit('node_bandwidth_limit', function ($data) {
$datatables->edit('node_bandwidth_limit', static function ($data) {
return Tools::flowToGB($data['node_bandwidth_limit']);
});
$datatables->edit('sort', function ($data) {
$datatables->edit('sort', static function ($data) {
$sort = '';
switch($data['sort']) {
switch ($data['sort']) {
case 0:
$sort = 'Shadowsocks';
break;
$sort = 'Shadowsocks';
break;
case 1:
$sort = 'VPN/Radius基础';
break;
$sort = 'VPN/Radius基础';
break;
case 2:
$sort = 'SSH';
break;
case 3:
$sort = 'PAC';
break;
case 4:
$sort = 'APN文件外链';
break;
$sort = 'SSH';
break;
case 5:
$sort = 'Anyconnect';
break;
case 6:
$sort = 'APN';
break;
case 7:
$sort = 'PAC PLUS(Socks 代理生成 PAC文件)';
break;
case 8:
$sort = 'PAC PLUS PLUS(HTTPS 代理生成 PAC文件)';
break;
$sort = 'Anyconnect';
break;
case 9:
$sort = 'Shadowsocks - 单端口多用户';
break;
$sort = 'Shadowsocks - 单端口多用户';
break;
case 10:
$sort = 'Shadowsocks - 中转';
break;
$sort = 'Shadowsocks - 中转';
break;
case 11:
$sort = 'V2Ray 节点';
break;
$sort = 'V2Ray 节点';
break;
case 12:
$sort = 'V2Ray - 中转';
break;
case 13:
$sort = 'Shadowsocks - V2Ray-Plugin';
break;
case 14:
$sort = 'Trojan';
break;
default:
$sort = '系统保留';
$sort = '系统保留';
}
return $sort;
});
$datatables->edit('type', function ($data) {
$datatables->edit('type', static function ($data) {
return $data['type'] == 1 ? '显示' : '隐藏';
});
$datatables->edit('custom_method', function ($data) {
$datatables->edit('custom_method', static function ($data) {
return $data['custom_method'] == 1 ? '启用' : '关闭';
});
$datatables->edit('custom_rss', function ($data) {
$datatables->edit('custom_rss', static function ($data) {
return $data['custom_rss'] == 1 ? '启用' : '关闭';
});
$datatables->edit('mu_only', function ($data) {
$datatables->edit('mu_only', static function ($data) {
return $data['mu_only'] == 1 ? '启用' : '关闭';
});
$datatables->edit('node_heartbeat', function ($data) {
$datatables->edit('node_heartbeat', static function ($data) {
return date('Y-m-d H:i:s', $data['node_heartbeat']);
});
$datatables->edit('DT_RowId', function ($data) {
return 'row_1_'.$data['id'];
$datatables->edit('DT_RowId', static function ($data) {
return 'row_1_' . $data['id'];
});
$body = $response->getBody();

@ -8,7 +8,7 @@ use App\Models\User;
use App\Utils\Tools;
use App\Services\Auth;
use App\Controllers\AdminController;
use ArrayObject;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
@ -16,12 +16,12 @@ class RelayController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID", "user_id" => "用户ID",
"user_name" => "用户名", "source_node_name" => "起源节点",
"dist_node_name" => "目标节点", "port" => "端口", "priority" => "优先级");
$table_config['total_column'] = array('op' => '操作', 'id' => 'ID', 'user_id' => '用户ID',
'user_name' => '用户名', 'source_node_name' => '起源节点',
'dist_node_name' => '目标节点', 'port' => '端口', 'priority' => '优先级');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'relay/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/relay/index.tpl');
@ -30,15 +30,34 @@ class RelayController extends AdminController
public function create($request, $response, $args)
{
$user = Auth::getUser();
$source_nodes = Node::where('sort', 10)->orderBy('name')->get();
$source_nodes = Node::where(
static function ($query) {
$query->Where('sort', 10)
->orWhere('sort', 12);
}
)->orderBy('name')->get();
foreach ($source_nodes as $node) {
if ($node->sort == 12) {
$node->name .= 'V2ray中转,Port代表中转监听端口';
}
}
$dist_nodes = Node::where(
function ($query) {
static function ($query) {
$query->Where('sort', 0)
->orWhere('sort', 10);
->orWhere('sort', 10)
->orWhere('sort', 11)
->orWhere('sort', 12);
}
)->orderBy('name')->get();
foreach ($dist_nodes as $node) {
if ($node->sort == 11 || $node->sort == 12) {
$node_explode = Tools::v2Array($node->server);
$node->name = $node->name;
} else {
$node->name .= ' 如果是V2ray中转,无法食用';
}
}
return $this->view()->assign('source_nodes', $source_nodes)->assign('dist_nodes', $dist_nodes)->display('admin/relay/add.tpl');
}
@ -54,14 +73,22 @@ class RelayController extends AdminController
$source_node = Node::where('id', $source_node_id)->first();
if ($source_node == null) {
$rs['ret'] = 0;
$rs['msg'] = "起源节点错误。";
$rs['msg'] = '起源节点错误。';
return $response->getBody()->write(json_encode($rs));
}
if ($source_node->sort == 12) {
$rules = Relay::Where('source_node_id', $source_node_id)->get();
if (!Tools::relayRulePortCheck($rules)) {
$rs['ret'] = 0;
$rs['msg'] = '端口冲突请,请更换一个';
return $response->getBody()->write(json_encode($rs));
}
}
$dist_node = Node::where('id', $dist_node_id)->first();
if ($dist_node == null) {
$rs['ret'] = 0;
$rs['msg'] = "目标节点错误。";
$rs['msg'] = '目标节点错误。';
return $response->getBody()->write(json_encode($rs));
}
@ -84,21 +111,23 @@ class RelayController extends AdminController
$maybe_rule_id = Tools::has_conflict_rule($rule, $ruleset, 0, $rule->source_node_id);
if ($maybe_rule_id != 0) {
$rs['ret'] = 0;
$rs['msg'] = "您即将添加的规则与规则 ID:".$maybe_rule_id." 冲突!";
$rs['msg'] = '您即将添加的规则与规则 ID:' . $maybe_rule_id . ' 冲突!';
if ($maybe_rule_id == -1) {
$rs['msg'] = "您即将添加的规则可能会造成冲突!";
$rs['msg'] = '您即将添加的规则可能会造成冲突!';
}
return $response->getBody()->write(json_encode($rs));
}
if (!$rule->save()) {
$rs['ret'] = 0;
$rs['msg'] = "添加失败";
$rs['msg'] = '添加失败';
return $response->getBody()->write(json_encode($rs));
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -113,15 +142,36 @@ class RelayController extends AdminController
exit(0);
}
$source_nodes = Node::where('sort', 10)->orderBy('name')->get();
$source_nodes = Node::where(
static function ($query) {
$query->Where('sort', 10)
->orWhere('sort', 12);
}
)->orderBy('name')->get();
foreach ($source_nodes as $node) {
if ($node->sort == 12) {
$node->name .= ' 正在使用V2ray后端 ';
}
}
$dist_nodes = Node::where(
function ($query) {
static function ($query) {
$query->Where('sort', 0)
->orWhere('sort', 10);
->orWhere('sort', 10)
->orWhere('sort', 11)
->orWhere('sort', 12);
}
)->orderBy('name')->get();
foreach ($dist_nodes as $node) {
if ($node->sort == 11 || $node->sort == 12) {
$node_explode = Tools::v2Array($node->server);
$node->name = $node->name . 'V2ray中转,Port代表中转监听端口';
} else {
$node->name .= ' 如果是V2ray中转,无法食用';
}
}
return $this->view()->assign('rule', $rule)->assign('source_nodes', $source_nodes)->assign('dist_nodes', $dist_nodes)->display('admin/relay/edit.tpl');
}
@ -143,14 +193,14 @@ class RelayController extends AdminController
$source_node = Node::where('id', $source_node_id)->first();
if ($source_node == null && $source_node_id != 0) {
$rs['ret'] = 0;
$rs['msg'] = "起源节点 ID 错误。";
$rs['msg'] = '起源节点 ID 错误。';
return $response->getBody()->write(json_encode($rs));
}
$dist_node = Node::where('id', $dist_node_id)->first();
if ($dist_node == null) {
$rs['ret'] = 0;
$rs['msg'] = "目标节点 ID 错误。";
$rs['msg'] = '目标节点 ID 错误。';
return $response->getBody()->write(json_encode($rs));
}
@ -172,9 +222,9 @@ class RelayController extends AdminController
$maybe_rule_id = Tools::has_conflict_rule($rule, $ruleset, $rule->id, $rule->source_node_id);
if ($maybe_rule_id != 0) {
$rs['ret'] = 0;
$rs['msg'] = "您即将添加的规则与规则 ID:".$maybe_rule_id." 冲突!";
$rs['msg'] = '您即将添加的规则与规则 ID:' . $maybe_rule_id . ' 冲突!';
if ($maybe_rule_id == -1) {
$rs['msg'] = "您即将添加的规则可能会造成冲突!";
$rs['msg'] = '您即将添加的规则可能会造成冲突!';
}
return $response->getBody()->write(json_encode($rs));
}
@ -182,12 +232,14 @@ class RelayController extends AdminController
if (!$rule->save()) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败";
$rs['msg'] = '修改失败';
return $response->getBody()->write(json_encode($rs));
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -204,39 +256,47 @@ class RelayController extends AdminController
if (!$rule->delete()) {
$rs['ret'] = 0;
$rs['msg'] = "删除失败";
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
public function path_search($request, $response, $args)
{
$uid=$args["id"];
$uid = $args['id'];
$user = User::find($uid);
if ($user == null) {
$pathset = new \ArrayObject();
$pathset = new ArrayObject();
return $this->view()->assign('pathset', $pathset)->display('admin/relay/search.tpl');
}
$nodes = Node::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(
static function ($query) {
$query->Where('sort', 10)
->orWhere('sort', 12);
}
)->where("sort", "=", 10)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$pathset = new \ArrayObject();
$pathset = new ArrayObject();
$relay_rules = Relay::where('user_id', $user->id)->orwhere('user_id', 0)->get();
$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);
$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();
@ -278,11 +338,11 @@ class RelayController extends AdminController
if ($single_path->end_node->id == $path->begin_node->id) {
$path->begin_node = $single_path->begin_node;
if ($path->begin_node->isNodeAccessable() == false) {
$path->path = '<font color="#FF0000">'.$single_path->begin_node->name.'</font>'." → ".$path->path;
$path->status = "阻断";
$path->path = '<font color="#FF0000">' . $single_path->begin_node->name . '</font>' . ' → ' . $path->path;
$path->status = '阻断';
} else {
$path->path = $single_path->begin_node->name." → ".$path->path;
$path->status = "通畅";
$path->path = $single_path->begin_node->name . ' → ' . $path->path;
$path->status = '通畅';
}
$pathset->offsetUnset($index);
@ -292,10 +352,10 @@ class RelayController extends AdminController
if ($path->end_node->id == $single_path->begin_node->id) {
$path->end_node = $single_path->end_node;
if ($single_path->end_node->isNodeAccessable() == false) {
$path->path = $path->path." → ".'<font color="#FF0000">'.$single_path->end_node->name.'</font>';
$path->status = "阻断";
$path->path = $path->path . ' → ' . '<font color="#FF0000">' . $single_path->end_node->name . '</font>';
$path->status = '阻断';
} else {
$path->path = $path->path." → ".$single_path->end_node->name;
$path->path = $path->path . ' → ' . $single_path->end_node->name;
}
$pathset->offsetUnset($index);
@ -313,12 +373,12 @@ class RelayController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select relay.id as op,relay.id,relay.user_id,user.user_name,source_node.name as source_node_name,dist_node.name as dist_node_name,relay.port,relay.priority from relay,user,ss_node as source_node,ss_node as dist_node WHERE (relay.user_id = user.id or relay.user_id = 0) and source_node.id = relay.source_node_id and dist_node.id = relay.dist_node_id group by id');
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand" href="/admin/relay/'.$data['id'].'/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" value="'.$data['id'].'" href="javascript:void(0);" onClick="delete_modal_show(\''.$data['id'].'\')">删除</a>';
$datatables->edit('op', static function ($data) {
return '<a class="btn btn-brand" href="/admin/relay/' . $data['id'] . '/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" value="' . $data['id'] . '" href="javascript:void(0);" onClick="delete_modal_show(\'' . $data['id'] . '\')">删除</a>';
});
$datatables->edit('user_name', function ($data) {
$datatables->edit('user_name', static function ($data) {
return ($data['user_id'] == 0 ? '全体用户' : $data['user_name']);
});

@ -6,7 +6,6 @@ use App\Models\Shop;
use App\Models\Bought;
use App\Controllers\AdminController;
use App\Services\Config;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
@ -14,13 +13,13 @@ class ShopController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID", "name" => "商品名称",
"price" => "价格", "content" => "商品内容",
"auto_renew" => "自动续费", "auto_reset_bandwidth" => "续费时是否重置流量",
"status" => "状态", "period_sales" => "周期销量");
$table_config['total_column'] = array('op' => '操作', 'id' => 'ID', 'name' => '商品名称',
'price' => '价格', 'content' => '商品内容',
'auto_renew' => '自动续费', 'auto_reset_bandwidth' => '续费时是否重置流量',
'status' => '状态', 'period_sales' => '周期销量');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'shop/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/shop/index.tpl');
@ -34,58 +33,62 @@ class ShopController extends AdminController
public function add($request, $response, $args)
{
$shop = new Shop();
$shop->name = $request->getParam('name');
$shop->price = $request->getParam('price');
$shop->auto_renew = $request->getParam('auto_renew');
$shop->auto_reset_bandwidth = $request->getParam('auto_reset_bandwidth');
$content=array();
if ($request->getParam('bandwidth')!=0) {
$content["bandwidth"]=$request->getParam('bandwidth');
$shop->name = $request->getParam('name');
$shop->price = $request->getParam('price');
$shop->auto_renew = $request->getParam('auto_renew');
$shop->auto_reset_bandwidth = $request->getParam('auto_reset_bandwidth');
$content = array();
if ($request->getParam('bandwidth') != 0) {
$content['bandwidth'] = $request->getParam('bandwidth');
}
if ($request->getParam('expire')!=0) {
$content["expire"]=$request->getParam('expire');
if ($request->getParam('expire') != 0) {
$content['expire'] = $request->getParam('expire');
}
if ($request->getParam('class')!=0) {
$content["class"]=$request->getParam('class');
if ($request->getParam('class') != 0) {
$content['class'] = $request->getParam('class');
}
if ($request->getParam('class_expire')!=0) {
$content["class_expire"]=$request->getParam('class_expire');
if ($request->getParam('class_expire') != 0) {
$content['class_expire'] = $request->getParam('class_expire');
}
if ($request->getParam('reset')!=0) {
$content["reset"]=$request->getParam('reset');
if ($request->getParam('reset') != 0) {
$content['reset'] = $request->getParam('reset');
}
if ($request->getParam('reset_value')!=0) {
$content["reset_value"]=$request->getParam('reset_value');
if ($request->getParam('reset_value') != 0) {
$content['reset_value'] = $request->getParam('reset_value');
}
if ($request->getParam('reset_exp')!=0) {
$content["reset_exp"]=$request->getParam('reset_exp');
if ($request->getParam('reset_exp') != 0) {
$content['reset_exp'] = $request->getParam('reset_exp');
}
//if ($request->getParam('speedlimit')!=0) {
$content["speedlimit"]=$request->getParam('speedlimit');
$content['speedlimit'] = $request->getParam('speedlimit');
//}
//if ($request->getParam('connector')!=0) {
$content["connector"]=$request->getParam('connector');
$content['connector'] = $request->getParam('connector');
//}
$shop->content=json_encode($content);
if ($request->getParam('content_extra') != '') {
$content['content_extra'] = $request->getParam('content_extra');
}
$shop->content = json_encode($content);
if (!$shop->save()) {
$rs['ret'] = 0;
$rs['msg'] = "添加失败";
$rs['msg'] = '添加失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -93,8 +96,6 @@ class ShopController extends AdminController
{
$id = $args['id'];
$shop = Shop::find($id);
if ($shop == null) {
}
return $this->view()->assign('shop', $shop)->display('admin/shop/edit.tpl');
}
@ -103,106 +104,109 @@ class ShopController extends AdminController
$id = $args['id'];
$shop = Shop::find($id);
$shop->name = $request->getParam('name');
$shop->price = $request->getParam('price');
$shop->auto_renew = $request->getParam('auto_renew');
$shop->name = $request->getParam('name');
$shop->price = $request->getParam('price');
$shop->auto_renew = $request->getParam('auto_renew');
if ($shop->auto_reset_bandwidth == 1 && $request->getParam('auto_reset_bandwidth') == 0) {
$boughts = Bought::where("shopid", $id)->get();
$boughts = Bought::where('shopid', $id)->get();
foreach ($boughts as $bought) {
$bought->renew=0;
$bought->renew = 0;
$bought->save();
}
}
$shop->auto_reset_bandwidth = $request->getParam('auto_reset_bandwidth');
$shop->status=1;
$shop->auto_reset_bandwidth = $request->getParam('auto_reset_bandwidth');
$shop->status = 1;
$content=array();
if ($request->getParam('bandwidth')!=0) {
$content["bandwidth"]=$request->getParam('bandwidth');
$content = array();
if ($request->getParam('bandwidth') != 0) {
$content['bandwidth'] = $request->getParam('bandwidth');
}
if ($request->getParam('expire')!=0) {
$content["expire"]=$request->getParam('expire');
if ($request->getParam('expire') != 0) {
$content['expire'] = $request->getParam('expire');
}
if ($request->getParam('class')!=0) {
$content["class"]=$request->getParam('class');
if ($request->getParam('class') != 0) {
$content['class'] = $request->getParam('class');
}
if ($request->getParam('class_expire')!=0) {
$content["class_expire"]=$request->getParam('class_expire');
if ($request->getParam('class_expire') != 0) {
$content['class_expire'] = $request->getParam('class_expire');
}
if ($request->getParam('reset')!=0) {
$content["reset"]=$request->getParam('reset');
if ($request->getParam('reset') != 0) {
$content['reset'] = $request->getParam('reset');
}
if ($request->getParam('reset_value')!=0) {
$content["reset_value"]=$request->getParam('reset_value');
if ($request->getParam('reset_value') != 0) {
$content['reset_value'] = $request->getParam('reset_value');
}
if ($request->getParam('reset_exp')!=0) {
$content["reset_exp"]=$request->getParam('reset_exp');
if ($request->getParam('reset_exp') != 0) {
$content['reset_exp'] = $request->getParam('reset_exp');
}
//if ($request->getParam('speedlimit')!=0) {
$content["speedlimit"]=$request->getParam('speedlimit');
$content['speedlimit'] = $request->getParam('speedlimit');
//}
//if ($request->getParam('connector')!=0) {
$content["connector"]=$request->getParam('connector');
$content['connector'] = $request->getParam('connector');
//}
$shop->content=json_encode($content);
if ($request->getParam('content_extra') != '') {
$content['content_extra'] = $request->getParam('content_extra');
}
$shop->content = json_encode($content);
if (!$shop->save()) {
$rs['ret'] = 0;
$rs['msg'] = "保存失败";
$rs['msg'] = '保存失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "保存成功";
$rs['msg'] = '保存成功';
return $response->getBody()->write(json_encode($rs));
}
public function deleteGet($request, $response, $args)
{
$id = $request->getParam('id');
$shop = Shop::find($id);
$shop->status=0;
$shop->status = 0;
if (!$shop->save()) {
$rs['ret'] = 0;
$rs['msg'] = "下架失败";
$rs['msg'] = '下架失败';
return $response->getBody()->write(json_encode($rs));
}
$boughts = Bought::where("shopid", $id)->get();
$boughts = Bought::where('shopid', $id)->get();
foreach ($boughts as $bought) {
$bought->renew=0;
$bought->renew = 0;
$bought->save();
}
$rs['ret'] = 1;
$rs['msg'] = "下架成功";
$rs['msg'] = '下架成功';
return $response->getBody()->write(json_encode($rs));
}
public function bought($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID",
"datetime" => "购买日期","content" => "内容",
"price" => "价格", "user_id" => "用户ID",
"user_name" => "用户名", "renew" => "自动续费时间",
"auto_reset_bandwidth" => "续费时是否重置流量");
$table_config['total_column'] = array('op' => '操作', 'id' => 'ID',
'datetime' => '购买日期', 'content' => '内容',
'price' => '价格', 'user_id' => '用户ID',
'user_name' => '用户名', 'renew' => '自动续费时间',
'auto_reset_bandwidth' => '续费时是否重置流量');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'bought/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/shop/bought.tpl');
@ -212,14 +216,14 @@ class ShopController extends AdminController
{
$id = $request->getParam('id');
$shop = Bought::find($id);
$shop->renew=0;
$shop->renew = 0;
if (!$shop->save()) {
$rs['ret'] = 0;
$rs['msg'] = "退订失败";
$rs['msg'] = '退订失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "退订成功";
$rs['msg'] = '退订成功';
return $response->getBody()->write(json_encode($rs));
}
@ -228,43 +232,43 @@ class ShopController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select id as op,id,name,price,content,auto_renew,auto_reset_bandwidth,status,id as period_sales from shop');
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand" href="/admin/shop/'.$data['id'].'/edit">编辑</a>
<a class="btn btn-brand-accent" '.($data['status'] == 0 ? "disabled" : 'id="row_delete_'.$data['id'].'" href="javascript:void(0);" onClick="delete_modal_show(\''.$data['id'].'\')"').'>下架</a>';
$datatables->edit('op', static function ($data) {
return '<a class="btn btn-brand" href="/admin/shop/' . $data['id'] . '/edit">编辑</a>
<a class="btn btn-brand-accent" ' . ($data['status'] == 0 ? 'disabled' : 'id="row_delete_' . $data['id'] . '" href="javascript:void(0);" onClick="delete_modal_show(\'' . $data['id'] . '\')"') . '>下架</a>';
});
$datatables->edit('content', function ($data) {
$datatables->edit('content', static function ($data) {
$shop = Shop::find($data['id']);
return $shop->content();
});
$datatables->edit('auto_renew', function ($data) {
$datatables->edit('auto_renew', static function ($data) {
if ($data['auto_renew'] == 0) {
return "不自动续费";
} else {
return $data['auto_renew']." 天后续费";
return '不自动续费';
}
return $data['auto_renew'] . ' 天后续费';
});
$datatables->edit('auto_reset_bandwidth', function ($data) {
$datatables->edit('auto_reset_bandwidth', static function ($data) {
return $data['auto_reset_bandwidth'] == 0 ? '不自动重置' : '自动重置';
});
$datatables->edit('status', function ($data) {
$datatables->edit('status', static function ($data) {
return $data['status'] == 1 ? '上架' : '下架';
});
$datatables->edit('period_sales', function ($data) {
$shop = Shop::find($data['id']);
$period=Config::get('sales_period');
$datatables->edit('period_sales', static function ($data) {
$shop = Shop::find($data['id']);
$period = Config::get('sales_period');
if($period=='expire'){
$period=json_decode($shop->content,true)['class_expire'];
}
if ($period == 'expire') {
$period = json_decode($shop->content, true)['class_expire'];
}
$period=$period*24*60*60;
$sales = Bought::where('shopid',$shop->id)->where('datetime','>' ,time()-$period)->count();
return $sales;
$period = $period * 24 * 60 * 60;
$sales = Bought::where('shopid', $shop->id)->where('datetime', '>', time() - $period)->count();
return $sales;
});
$body = $response->getBody();
@ -274,30 +278,30 @@ class ShopController extends AdminController
public function ajax_bought($request, $response, $args)
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select bought.id as op,bought.id as id,shop.id as content,bought.price,user.id as user_id,user.user_name,renew,shop.auto_reset_bandwidth,bought.datetime from bought,user,shop where bought.shopid = shop.id and bought.userid = user.id');
$datatables->query('Select bought.id as op,bought.id as id,bought.datetime,shop.id as content,bought.price,user.id as user_id,user.user_name,renew,shop.auto_reset_bandwidth from bought,user,shop where bought.shopid = shop.id and bought.userid = user.id');
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand-accent" '.($data['renew'] == 0 ? "disabled" : ' id="row_delete_'.$data['id'].'" href="javascript:void(0);" onClick="delete_modal_show(\''.$data['id'].'\')"').'>中止</a>';
$datatables->edit('op', static function ($data) {
return '<a class="btn btn-brand-accent" ' . ($data['renew'] == 0 ? 'disabled' : ' id="row_delete_' . $data['id'] . '" href="javascript:void(0);" onClick="delete_modal_show(\'' . $data['id'] . '\')"') . '>中止</a>';
});
$datatables->edit('content', function ($data) {
$datatables->edit('content', static function ($data) {
$shop = Shop::find($data['content']);
return $shop->content();
});
$datatables->edit('renew', function ($data) {
$datatables->edit('renew', static function ($data) {
if ($data['renew'] == 0) {
return "不自动续费";
} else {
return date('Y-m-d H:i:s', $data['renew'])." 续费";
return '不自动续费';
}
return date('Y-m-d H:i:s', $data['renew']) . ' 续费';
});
$datatables->edit('auto_reset_bandwidth', function ($data) {
$datatables->edit('auto_reset_bandwidth', static function ($data) {
return $data['auto_reset_bandwidth'] == 0 ? '不自动重置' : '自动重置';
});
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});

@ -0,0 +1,41 @@
<?php
namespace App\Controllers\Admin;
use App\Controllers\AdminController;
use App\Utils\QQWry;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
class SubscribeLogController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array('id' => 'ID', 'user_name' => '用户名',
'user_id' => '用户ID', 'email' => '用户邮箱', 'subscribe_type' => '类型',
'request_ip' => 'IP', 'location' => '归属地', 'request_time' => '时间',
'request_user_agent' => 'User-Agent');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'subscribe/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/subscribe.tpl');
}
public function ajax_subscribe_log($request, $response, $args)
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select user_subscribe_log.id,user_subscribe_log.user_name,user_subscribe_log.user_id,user_subscribe_log.email,user_subscribe_log.subscribe_type,user_subscribe_log.request_ip,user_subscribe_log.request_ip as location,user_subscribe_log.request_time,user_subscribe_log.request_user_agent from user_subscribe_log');
$iplocation = new QQWry();
$datatables->edit('location', static function ($data) use ($iplocation) {
$location = $iplocation->getlocation($data['location']);
return iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
});
$body = $response->getBody();
$body->write($datatables->generate());
}
}

@ -5,6 +5,7 @@ namespace App\Controllers\Admin;
use App\Models\Ticket;
use App\Models\User;
use Exception;
use voku\helper\AntiXSS;
use App\Services\Auth;
@ -16,21 +17,24 @@ use App\Utils\DatatablesHelper;
use App\Controllers\AdminController;
use App\Utils\Telegram;
use TelegramBot\Api\BotApi;
class TicketController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID",
"datetime" => "时间", "title" => "标题", "userid" => "用户ID",
"user_name" => "用户名", "status" => "状态");
$table_config['default_show_column'] = array("op", "id",
"datetime", "title", "userid", "user_name", "status");
$table_config['total_column'] = array('op' => '操作', 'id' => 'ID',
'datetime' => '时间', 'title' => '标题', 'userid' => '用户ID',
'user_name' => '用户名', 'status' => '状态');
$table_config['default_show_column'] = array('op', 'id',
'datetime', 'title', 'userid', 'user_name', 'status');
$table_config['ajax_url'] = 'ticket/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/ticket/index.tpl');
}
public function update($request, $response, $args)
{
$id = $args['id'];
@ -38,54 +42,66 @@ class TicketController extends AdminController
$status = $request->getParam('status');
if ($content==""||$status=="") {
if ($content == '' || $status == '') {
$res['ret'] = 0;
$res['msg'] = "请填全";
$res['msg'] = '请填全';
return $this->echoJson($response, $res);
}
if (strpos($content, "admin")!=false||strpos($content, "user")!=false) {
if (strpos($content, 'admin') != false || strpos($content, 'user') != false) {
$res['ret'] = 0;
$res['msg'] = "请求中有不正当的词语。";
$res['msg'] = '请求中有不正当的词语。';
return $this->echoJson($response, $res);
}
$ticket_main=Ticket::where("id", "=", $id)->where("rootid", "=", 0)->first();
//if($status==1&&$ticket_main->status!=$status)
{
$adminUser = User::where("id", "=", $ticket_main->userid)->get();
foreach ($adminUser as $user) {
$subject = Config::get('appName')."-工单被回复";
$to = $user->email;
$text = "您好,有人回复了<a href=\"".Config::get('baseUrl')."/user/ticket/".$ticket_main->id."/view\">工单</a>,请您查看。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
$ticket_main = Ticket::where('id', '=', $id)->where('rootid', '=', 0)->first();
$user = User::where('id','=', $ticket_main->userid)->first();
$ticket_url = Config::get('baseUrl') . '/user/ticket/' . $ticket_main->id . '/view';
$subject = '您提出的工单已被回复';
$to = $user->email;
$text = '管理员已回复您提出的工单';
try {
Mail::send($to, $subject, 'ticket/ticket_reply.tpl', [
'user' => $user, 'text' => $text, 'content' => $content, 'title' => $ticket_main->title, 'ticket_url' => $ticket_url
], [
]);
} catch (Exception $e) {
}
if (Config::get('enable_telegram') == 'true' && $user->telegram_id != null) {
$messageText = 'Hi,'.$user->user_name.PHP_EOL.'管理员已回复您提出的工单'.PHP_EOL.PHP_EOL.'工单标题: '.$ticket_main->title.PHP_EOL.'回复内容: '.$content;
$keyboard = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup(
[
[
['text' => '回复工单', 'url' => $ticket_url]
]
]
);
$bot = new BotApi(Config::get('telegram_token'));
try {
$bot->sendMessage($user->telegram_id, $messageText, null, null, null, $keyboard);
} catch (Exception $e) {
}
}
$antiXss = new AntiXSS();
$ticket=new Ticket();
$ticket->title=$antiXss->xss_clean($ticket_main->title);
$ticket->content=$antiXss->xss_clean($content);
$ticket->rootid=$ticket_main->id;
$ticket->userid=Auth::getUser()->id;
$ticket->datetime=time();
$ticket_main->status=$status;
$ticket = new Ticket();
$ticket->title = $antiXss->xss_clean($ticket_main->title);
$ticket->content = $antiXss->xss_clean($content);
$ticket->rootid = $ticket_main->id;
$ticket->userid = Auth::getUser()->id;
$ticket->datetime = time();
$ticket_main->status = $status;
$ticket_main->save();
$ticket->save();
$res['ret'] = 1;
$res['msg'] = "提交成功";
$res['msg'] = '提交成功';
return $this->echoJson($response, $res);
}
@ -93,16 +109,13 @@ class TicketController extends AdminController
{
$id = $args['id'];
$pageNum = 1;
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
}
$pageNum = $request->getQueryParams()['page'] ?? 1;
$ticketset=Ticket::where("id", $id)->orWhere("rootid", "=", $id)->orderBy("datetime", "desc")->paginate(5, ['*'], 'page', $pageNum);
$ticketset->setPath('/admin/ticket/'.$id."/view");
$ticketset = Ticket::where('id', $id)->orWhere('rootid', '=', $id)->orderBy('datetime', 'desc')->paginate(5, ['*'], 'page', $pageNum);
$ticketset->setPath('/admin/ticket/' . $id . '/view');
return $this->view()->assign('ticketset', $ticketset)->assign("id", $id)->display('admin/ticket/view.tpl');
return $this->view()->assign('ticketset', $ticketset)->assign('id', $id)->display('admin/ticket/view.tpl');
}
public function ajax($request, $response, $args)
@ -110,15 +123,15 @@ class TicketController extends AdminController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select ticket.id as op,ticket.id,ticket.datetime,ticket.title,ticket.userid,user.user_name,ticket.status from ticket,user where ticket.userid = user.id and ticket.rootid = 0');
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand" href="/admin/ticket/'.$data['id'].'/view">查看</a>';
$datatables->edit('op', static function ($data) {
return '<a class="btn btn-brand" href="/admin/ticket/' . $data['id'] . '/view">查看</a>';
});
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});
$datatables->edit('status', function ($data) {
$datatables->edit('status', static function ($data) {
return $data['status'] == 1 ? '开启' : '关闭';
});

@ -2,142 +2,280 @@
namespace App\Controllers\Admin;
use App\Models\User;
use App\Controllers\AdminController;
use App\Models\Bought;
use App\Models\Ip;
use App\Models\RadiusBan;
use App\Models\Relay;
use App\Controllers\AdminController;
use App\Services\Config;
use App\Models\User;
use App\Models\DetectBanLog;
use App\Models\Shop;
use App\Services\Auth;
use App\Services\Config;
use App\Services\Mail;
use App\Utils;
use App\Utils\GA;
use App\Utils\Hash;
use App\Utils\Radius;
use App\Utils\QQWry;
use App\Utils\Wecenter;
use App\Utils\Radius;
use App\Utils\Tools;
use Exception;
class UserController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID", "user_name" => "用户名",
"remark" => "备注", "email" => "邮箱", "money" => "金钱",
"im_type" => "联络方式类型", "im_value" => "联络方式详情",
"node_group" => "群组", "expire_in" => "账户过期时间",
"class" => "等级", "class_expire" => "等级过期时间",
"passwd" => "连接密码","port" => "连接端口", "method" => "加密方式",
"protocol" => "连接协议", "obfs" => "连接混淆方式",
"online_ip_count" => "在线IP数", "last_ss_time" => "上次使用时间",
"used_traffic" => "已用流量/GB", "enable_traffic" => "总流量/GB",
"last_checkin_time" => "上次签到时间", "today_traffic" => "今日流量/MB",
"enable" => "是否启用", "reg_date" => "注册时间",
"reg_ip" => "注册IP", "auto_reset_day" => "自动重置流量日",
"auto_reset_bandwidth" => "自动重置流量/GB", "ref_by" => "邀请人ID", "ref_by_user_name" => "邀请人用户名");
$table_config['default_show_column'] = array("op", "id", "user_name", "remark", "email");
$table_config['total_column'] = array(
'op' => '操作',
'id' => 'ID',
'user_name' => '用户名',
'remark' => '备注',
'email' => '邮箱',
'money' => '金钱',
'im_type' => '联络方式类型',
'im_value' => '联络方式详情',
'node_group' => '群组',
'expire_in' => '账户过期时间',
'class' => '等级',
'class_expire' => '等级过期时间',
'passwd' => '连接密码',
'port' => '连接端口',
'method' => '加密方式',
'protocol' => '连接协议',
'obfs' => '混淆方式',
'obfs_param' => '混淆参数',
'online_ip_count' => '在线IP数',
'last_ss_time' => '上次使用时间',
'used_traffic' => '已用流量/GB',
'enable_traffic' => '总流量/GB',
'last_checkin_time' => '上次签到时间',
'today_traffic' => '今日流量/MB',
'enable' => '是否启用',
'reg_date' => '注册时间',
'reg_ip' => '注册IP',
'auto_reset_day' => '自动重置流量日',
'auto_reset_bandwidth' => '自动重置流量/GB',
'ref_by' => '邀请人ID',
'ref_by_user_name' => '邀请人用户名',
'top_up' => '累计充值');
$table_config['default_show_column'] = array('op', 'id', 'user_name', 'remark', 'email');
$table_config['ajax_url'] = 'user/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/user/index.tpl');
}
public function search($request, $response, $args)
public function createNewUser($request, $response, $args)
{
$pageNum = 1;
$text=$args["text"];
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
# 需要一个 userEmail
$email = $request->getParam('userEmail');
$email = trim($email);
$email = strtolower($email);
// not really user input
//if (!Check::isEmailLegal($email)) {
// $res['ret'] = 0;
// $res['msg'] = '邮箱无效';
// return $response->getBody()->write(json_encode($res));
//}
// check email
$user = User::where('email', $email)->first();
if ($user != null) {
$res['ret'] = 0;
$res['msg'] = '邮箱已经被注册了';
return $response->getBody()->write(json_encode($res));
}
// do reg user
$user = new User();
$pass = Tools::genRandomChar();
$user->user_name = $email;
$user->email = $email;
$user->pass = Hash::passwordHash($pass);
$user->passwd = Tools::genRandomChar(6);
$user->port = Tools::getAvPort();
$user->t = 0;
$user->u = 0;
$user->d = 0;
$user->method = Config::get('reg_method');
$user->protocol = Config::get('reg_protocol');
$user->protocol_param = Config::get('reg_protocol_param');
$user->obfs = Config::get('reg_obfs');
$user->obfs_param = Config::get('reg_obfs_param');
$user->forbidden_ip = Config::get('reg_forbidden_ip');
$user->forbidden_port = Config::get('reg_forbidden_port');
$user->im_type = 2;
$user->im_value = $email;
$user->transfer_enable = Tools::toGB(Config::get('defaultTraffic'));
$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');
$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->plan = 'A';
$user->theme = Config::get('theme');
$groups = explode(',', Config::get('ramdom_group'));
$user->node_group = $groups[array_rand($groups)];
$ga = new GA();
$secret = $ga->createSecret();
$user->ga_token = $secret;
$user->ga_enable = 0;
if ($user->save()) {
$res['ret'] = 1;
$res['msg'] = '新用户注册成功 用户名: ' . $email . ' 随机初始密码: ' . $pass;
$res['email_error'] = 'success';
$subject = Config::get('appName') . '-新用户注册通知';
$to = $user->email;
$text = '您好,管理员已经为您生成账户,用户名: ' . $email . ',登录密码为:' . $pass . ',感谢您的支持。 ';
try {
Mail::send($to, $subject, 'newuser.tpl', [
'user' => $user, 'text' => $text,
], [
]);
} catch (Exception $e) {
$res['email_error'] = $e->getMessage();
}
return $response->getBody()->write(json_encode($res));
}
$res['ret'] = 0;
$res['msg'] = '未知错误';
return $response->getBody()->write(json_encode($res));
}
$users = User::where("email", "LIKE", "%".$text."%")->orWhere("user_name", "LIKE", "%".$text."%")->orWhere("im_value", "LIKE", "%".$text."%")->orWhere("port", "LIKE", "%".$text."%")->orWhere("remark", "LIKE", "%".$text."%")->paginate(20, ['*'], 'page', $pageNum);
$users->setPath('/admin/user/search/'.$text);
public function buy($request, $response, $args)
{
#shop 信息可以通过 App\Controllers\UserController:shop 获得
# 需要shopId,disableothers,autorenew,userEmail
$shopId = $request->getParam('shopId');
$shop = Shop::where('id', $shopId)->where('status', 1)->first();
$disableothers = $request->getParam('disableothers');
$autorenew = $request->getParam('autorenew');
$email = $request->getParam('userEmail');
$user = User::where('email', '=', $email)->first();
if ($user == null) {
$result['ret'] = 0;
$result['msg'] = '未找到该用户';
return $response->getBody()->write(json_encode($result));
}
if ($shop == null) {
$result['ret'] = 0;
$result['msg'] = '请选择套餐';
return $response->getBody()->write(json_encode($result));
}
if ($disableothers == 1) {
$boughts = Bought::where('userid', $user->id)->get();
foreach ($boughts as $disable_bought) {
$disable_bought->renew = 0;
$disable_bought->save();
}
}
$bought = new Bought();
$bought->userid = $user->id;
$bought->shopid = $shop->id;
$bought->datetime = time();
if ($autorenew == 0 || $shop->auto_renew == 0) {
$bought->renew = 0;
} else {
$bought->renew = time() + $shop->auto_renew * 86400;
}
$price = $shop->price;
$bought->price = $price;
$bought->save();
$shop->buy($user);
$result['ret'] = 1;
$result['msg'] = '套餐添加成功';
return $response->getBody()->write(json_encode($result));
}
public function search($request, $response, $args)
{
$pageNum = 1;
$text = $args['text'];
if (isset($request->getQueryParams()['page'])) {
$pageNum = $request->getQueryParams()['page'];
}
//Ip::where("datetime","<",time()-90)->get()->delete();
$total = Ip::where("datetime", ">=", time()-90)->orderBy('userid', 'desc')->get();
$users = User::where('email', 'LIKE', '%' . $text . '%')->orWhere('user_name', 'LIKE', '%' . $text . '%')->orWhere('im_value', 'LIKE', '%' . $text . '%')->orWhere('port', 'LIKE', '%' . $text . '%')->orWhere('remark', 'LIKE', '%' . $text . '%')->paginate(20, ['*'], 'page', $pageNum);
$users->setPath('/admin/user/search/' . $text);
//Ip::where("datetime","<",time()-90)->get()->delete();
$total = Ip::where('datetime', '>=', time() - 90)->orderBy('userid', 'desc')->get();
$userip=array();
$useripcount=array();
$regloc=array();
$userip = array();
$useripcount = array();
$regloc = array();
$iplocation = new QQWry();
foreach ($users as $user) {
$useripcount[$user->id]=0;
$userip[$user->id]=array();
$useripcount[$user->id] = 0;
$userip[$user->id] = array();
$location=$iplocation->getlocation($user->reg_ip);
$regloc[$user->id]=iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']);
$location = $iplocation->getlocation($user->reg_ip);
$regloc[$user->id] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
foreach ($total as $single) {
if (isset($useripcount[$single->userid])) {
if (!isset($userip[$single->userid][$single->ip])) {
$useripcount[$single->userid]=$useripcount[$single->userid]+1;
$location=$iplocation->getlocation($single->ip);
$userip[$single->userid][$single->ip]=iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']);
}
if (isset($useripcount[$single->userid]) && !isset($userip[$single->userid][$single->ip])) {
++$useripcount[$single->userid];
$location = $iplocation->getlocation($single->ip);
$userip[$single->userid][$single->ip] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
}
return $this->view()->assign('users', $users)->assign("regloc", $regloc)->assign("useripcount", $useripcount)->assign("userip", $userip)->display('admin/user/index.tpl');
return $this->view()->assign('users', $users)->assign('regloc', $regloc)->assign('useripcount', $useripcount)->assign('userip', $userip)->display('admin/user/index.tpl');
}
public function sort($request, $response, $args)
{
$pageNum = 1;
$text=$args["text"];
$asc=$args["asc"];
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
$text = $args['text'];
$asc = $args['asc'];
if (isset($request->getQueryParams()['page'])) {
$pageNum = $request->getQueryParams()['page'];
}
$users->setPath('/admin/user/sort/'.$text."/".$asc);
$users->setPath('/admin/user/sort/' . $text . '/' . $asc);
//Ip::where("datetime","<",time()-90)->get()->delete();
$total = Ip::where("datetime", ">=", time()-90)->orderBy('userid', 'desc')->get();
$total = Ip::where('datetime', '>=', time() - 90)->orderBy('userid', 'desc')->get();
$userip=array();
$useripcount=array();
$regloc=array();
$userip = array();
$useripcount = array();
$regloc = array();
$iplocation = new QQWry();
foreach ($users as $user) {
$useripcount[$user->id]=0;
$userip[$user->id]=array();
$useripcount[$user->id] = 0;
$userip[$user->id] = array();
$location=$iplocation->getlocation($user->reg_ip);
$regloc[$user->id]=iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']);
$location = $iplocation->getlocation($user->reg_ip);
$regloc[$user->id] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
foreach ($total as $single) {
if (isset($useripcount[$single->userid])) {
if (!isset($userip[$single->userid][$single->ip])) {
$useripcount[$single->userid]=$useripcount[$single->userid]+1;
$location=$iplocation->getlocation($single->ip);
$userip[$single->userid][$single->ip]=iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']);
}
if (isset($useripcount[$single->userid]) && !isset($userip[$single->userid][$single->ip])) {
++$useripcount[$single->userid];
$location = $iplocation->getlocation($single->ip);
$userip[$single->userid][$single->ip] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
}
return $this->view()->assign('users', $users)->assign("regloc", $regloc)->assign("useripcount", $useripcount)->assign("userip", $userip)->display('admin/user/index.tpl');
return $this->view()->assign('users', $users)->assign('regloc', $regloc)->assign('useripcount', $useripcount)->assign('userip', $userip)->display('admin/user/index.tpl');
}
public function edit($request, $response, $args)
{
$id = $args['id'];
$user = User::find($id);
if ($user == null) {
}
return $this->view()->assign('edit_user', $user)->display('admin/user/edit.tpl');
}
@ -146,27 +284,25 @@ class UserController extends AdminController
$id = $args['id'];
$user = User::find($id);
$email1=$user->email;
$email1 = $user->email;
$user->email = $request->getParam('email');
$user->email = $request->getParam('email');
$email2=$request->getParam('email');
$email2 = $request->getParam('email');
$passwd=$request->getParam('passwd');
$passwd = $request->getParam('passwd');
Radius::ChangeUserName($email1, $email2, $passwd);
if ($request->getParam('pass') != '') {
$user->pass = Hash::passwordHash($request->getParam('pass'));
Wecenter::ChangeUserName($email1, $email2, $request->getParam('pass'), $user->user_name);
$user->clean_link();
}
$user->auto_reset_day = $request->getParam('auto_reset_day');
$user->auto_reset_day = $request->getParam('auto_reset_day');
$user->auto_reset_bandwidth = $request->getParam('auto_reset_bandwidth');
$origin_port = $user->port;
$user->port = $request->getParam('port');
$user->port = $request->getParam('port');
$relay_rules = Relay::where('user_id', $user->id)->where('port', $origin_port)->get();
foreach ($relay_rules as $rule) {
@ -196,16 +332,34 @@ class UserController extends AdminController
$user->class_expire = $request->getParam('class_expire');
$user->expire_in = $request->getParam('expire_in');
$user->forbidden_ip = str_replace(PHP_EOL, ",", $request->getParam('forbidden_ip'));
$user->forbidden_port = str_replace(PHP_EOL, ",", $request->getParam('forbidden_port'));
$user->forbidden_ip = str_replace(PHP_EOL, ',', $request->getParam('forbidden_ip'));
$user->forbidden_port = str_replace(PHP_EOL, ',', $request->getParam('forbidden_port'));
// 手动封禁
$ban_time = (int) $request->getParam('ban_time');
if ($ban_time > 0) {
$user->enable = 0;
$end_time = date('Y-m-d H:i:s');
$user->last_detect_ban_time = $end_time;
$DetectBanLog = new DetectBanLog();
$DetectBanLog->user_name = $user->user_name;
$DetectBanLog->user_id = $user->id;
$DetectBanLog->email = $user->email;
$DetectBanLog->detect_number = '0';
$DetectBanLog->ban_time = $ban_time;
$DetectBanLog->start_time = strtotime('1989-06-04 00:05:00');
$DetectBanLog->end_time = strtotime($end_time);
$DetectBanLog->all_detect_number = $user->all_detect_number;
$DetectBanLog->save();
}
if (!$user->save()) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败";
$rs['msg'] = '修改失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -214,52 +368,52 @@ class UserController extends AdminController
$id = $request->getParam('id');
$user = User::find($id);
$email1=$user->email;
$email1 = $user->email;
if (!$user->kill_user()) {
$rs['ret'] = 0;
$rs['msg'] = "删除失败";
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
public function changetouser($request, $response, $args)
{
$userid = $request->getParam('userid');
$adminid = $request->getParam('adminid');
$user = User::find($userid);
$admin = User::find($adminid);
$expire_in = time()+60*60;
$expire_in = time() + 60 * 60;
if (!$admin->is_admin || !$user || !Auth::getUser()->isLogin) {
$rs['ret'] = 0;
$rs['msg'] = "非法请求";
$rs['msg'] = '非法请求';
return $response->getBody()->write(json_encode($rs));
}
Utils\Cookie::set([
"uid" => $user->id,
"email" => $user->email,
"key" => Hash::cookieHash($user->pass),
"ip" => md5($_SERVER["REMOTE_ADDR"].Config::get('key').$user.$expire_in),
"expire_in" => $expire_in,
"old_uid" => Utils\Cookie::get('uid'),
"old_email" => Utils\Cookie::get('email'),
"old_key" => Utils\Cookie::get('key'),
"old_ip" => Utils\Cookie::get('ip'),
"old_expire_in" => Utils\Cookie::get('expire_in'),
"old_local" => $request->getParam('local')
], $expire_in);
'uid' => $user->id,
'email' => $user->email,
'key' => Hash::cookieHash($user->pass, $expire_in),
'ip' => md5($_SERVER['REMOTE_ADDR'] . Config::get('key') . $user->id . $expire_in),
'expire_in' => $expire_in,
'old_uid' => Utils\Cookie::get('uid'),
'old_email' => Utils\Cookie::get('email'),
'old_key' => Utils\Cookie::get('key'),
'old_ip' => Utils\Cookie::get('ip'),
'old_expire_in' => Utils\Cookie::get('expire_in'),
'old_local' => $request->getParam('local'),
], $expire_in);
$rs['ret'] = 1;
$rs['msg'] = "切换成功";
$rs['msg'] = '切换成功';
return $response->getBody()->write(json_encode($rs));
}
public function ajax($request, $response, $args)
{
public function ajax($request, $response, $args)
{
//得到排序的方式
$order = $request->getParam('order')[0]['dir'];
//得到排序字段的下标
@ -269,107 +423,288 @@ class UserController extends AdminController
$limit_start = $request->getParam('start');
$limit_length = $request->getParam('length');
$search = $request->getParam('search')['value'];
$users=array();
$count_filtered=0;
if ($order_field == 'used_traffic') {
$order_field = 'u + d';
} elseif ($order_field == 'enable_traffic') {
$order_field = 'transfer_enable';
} elseif ($order_field == 'today_traffic') {
$order_field = 'u +d - last_day_t';
}
$users = array();
$count_filtered = 0;
if ($search) {
$users = User::orderBy($order_field,$order)
->skip($limit_start)->limit($limit_length)
->where(
function ($query) use ($search) {
$query->where('id','LIKE',"%$search%")
->orwhere('user_name','LIKE',"%$search%")
->orwhere('email','LIKE',"%$search%")
->orwhere('im_value','LIKE',"%$search%")
->orwhere('port','LIKE',"%$search%");
}
)
->get();
$users = User::where(
static function ($query) use ($search) {
$query->where('id', 'LIKE', "%$search%")
->orwhere('user_name', 'LIKE', "%$search%")
->orwhere('email', 'LIKE', "%$search%")
->orwhere('passwd', 'LIKE', "%$search%")
->orwhere('port', 'LIKE', "%$search%")
->orwhere('reg_date', 'LIKE', "%$search%")
->orwhere('invite_num', 'LIKE', "%$search%")
->orwhere('money', 'LIKE', "%$search%")
->orwhere('ref_by', 'LIKE', "%$search%")
->orwhere('method', 'LIKE', "%$search%")
->orwhere('reg_ip', 'LIKE', "%$search%")
->orwhere('node_speedlimit', 'LIKE', "%$search%")
->orwhere('im_value', 'LIKE', "%$search%")
->orwhere('class', 'LIKE', "%$search%")
->orwhere('class_expire', 'LIKE', "%$search%")
->orwhere('expire_in', 'LIKE', "%$search%")
->orwhere('remark', 'LIKE', "%$search%")
->orwhere('node_group', 'LIKE', "%$search%")
->orwhere('auto_reset_day', 'LIKE', "%$search%")
->orwhere('auto_reset_bandwidth', 'LIKE', "%$search%")
->orwhere('protocol', 'LIKE', "%$search%")
->orwhere('protocol_param', 'LIKE', "%$search%")
->orwhere('obfs', 'LIKE', "%$search%")
->orwhere('obfs_param', 'LIKE', "%$search%");
}
)
->orderByRaw($order_field . ' ' . $order)
->skip($limit_start)->limit($limit_length)
->get();
$count_filtered = User::where(
function ($query)use($search) {
$query->where('id','LIKE',"%$search%")
->orwhere('user_name','LIKE',"%$search%")
->orwhere('email','LIKE',"%$search%")
->orwhere('im_value','LIKE',"%$search%")
->orwhere('port','LIKE',"%$search%");
}
)->count();
}
else{
$users = User::orderBy($order_field,$order)
static function ($query) use ($search) {
$query->where('id', 'LIKE', "%$search%")
->orwhere('user_name', 'LIKE', "%$search%")
->orwhere('email', 'LIKE', "%$search%")
->orwhere('passwd', 'LIKE', "%$search%")
->orwhere('port', 'LIKE', "%$search%")
->orwhere('reg_date', 'LIKE', "%$search%")
->orwhere('invite_num', 'LIKE', "%$search%")
->orwhere('money', 'LIKE', "%$search%")
->orwhere('ref_by', 'LIKE', "%$search%")
->orwhere('method', 'LIKE', "%$search%")
->orwhere('reg_ip', 'LIKE', "%$search%")
->orwhere('node_speedlimit', 'LIKE', "%$search%")
->orwhere('im_value', 'LIKE', "%$search%")
->orwhere('class', 'LIKE', "%$search%")
->orwhere('class_expire', 'LIKE', "%$search%")
->orwhere('expire_in', 'LIKE', "%$search%")
->orwhere('remark', 'LIKE', "%$search%")
->orwhere('node_group', 'LIKE', "%$search%")
->orwhere('auto_reset_day', 'LIKE', "%$search%")
->orwhere('auto_reset_bandwidth', 'LIKE', "%$search%")
->orwhere('protocol', 'LIKE', "%$search%")
->orwhere('protocol_param', 'LIKE', "%$search%")
->orwhere('obfs', 'LIKE', "%$search%")
->orwhere('obfs_param', 'LIKE', "%$search%");
}
)->count();
} else {
$users = User::orderByRaw($order_field . ' ' . $order)
->skip($limit_start)->limit($limit_length)
->get();
$count_filtered = User::count();
}
$data=array();
foreach ($users as $user) {
$tempdata=array();
$tempdata['op']='<a class="btn btn-brand" href="/admin/user/'.$user->id.'/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" href="javascript:void(0);" onClick="delete_modal_show(\''.$user->id.'\')">删除</a>
<a class="btn btn-brand" id="changetouser" href="javascript:void(0);" onClick="changetouser_modal_show(\''.$user->id.'\')">切换为该用户</a>';;
$tempdata['id']=$user->id;
$tempdata['user_name']=$user->user_name;
$tempdata['remark']=$user->remark;
$tempdata['email']=$user->email;
$tempdata['money']=$user->money;
$tempdata['im_value']=$user->im_value;
switch($user->im_type) {
case 1:
$tempdata['im_type'] = '微信';
break;
case 2:
$tempdata['im_type'] = 'QQ';
break;
case 3:
$tempdata['im_type'] = 'Google+';
break;
default:
$tempdata['im_type'] = 'Telegram';
$tempdata['im_value'] = '<a href="https://telegram.me/'.$user->im_value.'">'.$user->im_value.'</a>';
}
$tempdata['node_group']=$user->node_group;
$tempdata['expire_in']=$user->expire_in;
$tempdata['class']=$user->class;
$tempdata['class_expire']=$user->class_expire;
$tempdata['passwd']=$user->passwd;
$tempdata['port']=$user->port;
$tempdata['method']=$user->method;
$tempdata['protocol']=$user->protocol;
$tempdata['obfs']=$user->obfs;
$tempdata['online_ip_count']=$user->online_ip_count();
$tempdata['last_ss_time']=$user->lastSsTime();
$tempdata['used_traffic']=Tools::flowToGB($user->u + $user->d);
$tempdata['enable_traffic']=Tools::flowToGB($user->transfer_enable);
$tempdata['last_checkin_time']=$user->lastCheckInTime();
$tempdata['today_traffic']=Tools::flowToMB($user->u + $user->d-$user->last_day_t);
$tempdata['enable']=$user->enable == 1 ? "可用" : "禁用";
$tempdata['reg_date']=$user->reg_date;
$tempdata['reg_ip']=$user->reg_ip;
$tempdata['auto_reset_day']=$user->auto_reset_day;
$tempdata['auto_reset_bandwidth']=$user->auto_reset_bandwidth;
$tempdata['ref_by']= $user->ref_by;
if ($user->ref_by == 0) {
$tempdata['ref_by_user_name'] = "系统邀请";
}
else {
$ref_user = User::find($user->ref_by);
if ($ref_user == null) {
$tempdata['ref_by_user_name'] = "邀请人已经被删除";
}
else {
$tempdata['ref_by_user_name'] = $ref_user->user_name;
}
}
array_push($data,$tempdata);
}
$data = array();
foreach ($users as $user) {
$tempdata = array();
//model里是casts所以没法直接 $tempdata=(array)$user
$tempdata['op'] = '<a class="btn btn-brand" href="/admin/user/' . $user->id . '/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" href="javascript:void(0);" onClick="delete_modal_show(\'' . $user->id . '\')">删除</a>
<a class="btn btn-brand" href="/admin/user/' . $user->id . '/bought">查套餐</a>
<a class="btn btn-brand" id="changetouser" href="javascript:void(0);" onClick="changetouser_modal_show(\'' . $user->id . '\')">切换为该用户</a>';
$tempdata['id'] = $user->id;
$tempdata['user_name'] = $user->user_name;
$tempdata['remark'] = $user->remark;
$tempdata['email'] = $user->email;
$tempdata['money'] = $user->money;
$tempdata['im_value'] = $user->im_value;
switch ($user->im_type) {
case 1:
$tempdata['im_type'] = '微信';
break;
case 2:
$tempdata['im_type'] = 'QQ';
break;
case 3:
$tempdata['im_type'] = 'Google+';
break;
default:
$tempdata['im_type'] = 'Telegram';
$tempdata['im_value'] = '<a href="https://telegram.me/' . $user->im_value . '">' . $user->im_value . '</a>';
}
$tempdata['node_group'] = $user->node_group;
$tempdata['expire_in'] = $user->expire_in;
$tempdata['class'] = $user->class;
$tempdata['class_expire'] = $user->class_expire;
$tempdata['passwd'] = $user->passwd;
$tempdata['port'] = $user->port;
$tempdata['method'] = $user->method;
$tempdata['protocol'] = $user->protocol;
$tempdata['obfs'] = $user->obfs;
$tempdata['obfs_param'] = $user->obfs_param;
$tempdata['online_ip_count'] = $user->online_ip_count();
$tempdata['last_ss_time'] = $user->lastSsTime();
$tempdata['used_traffic'] = Tools::flowToGB($user->u + $user->d);
$tempdata['enable_traffic'] = Tools::flowToGB($user->transfer_enable);
$tempdata['last_checkin_time'] = $user->lastCheckInTime();
$tempdata['today_traffic'] = Tools::flowToMB($user->u + $user->d - $user->last_day_t);
$tempdata['enable'] = $user->enable == 1 ? '可用' : '禁用';
$tempdata['reg_date'] = $user->reg_date;
$tempdata['reg_ip'] = $user->reg_ip;
$tempdata['auto_reset_day'] = $user->auto_reset_day;
$tempdata['auto_reset_bandwidth'] = $user->auto_reset_bandwidth;
$tempdata['ref_by'] = $user->ref_by;
if ($user->ref_by == 0) {
$tempdata['ref_by_user_name'] = '系统邀请';
} else {
$ref_user = User::find($user->ref_by);
if ($ref_user == null) {
$tempdata['ref_by_user_name'] = '邀请人已经被删除';
} else {
$tempdata['ref_by_user_name'] = $ref_user->user_name;
}
}
$tempdata['top_up'] = $user->get_top_up();
$data[] = $tempdata;
}
$info = [
'draw' => $request->getParam('draw'), // ajax请求次数,作为标识符
'recordsTotal' => User::count(),
'recordsFiltered' => $count_filtered,
'data' => $data,
];
return json_encode($info, true);
}
public function cleanSubCache($request, $response, $args)
{
$id = $args['id'];
$user_path = (BASE_PATH . '/storage/SubscribeCache/' . $id . '/');
Tools::delDirAndFile($user_path);
$res['ret'] = 1;
$res['msg'] = '清理成功';
return $this->echoJson($response, $res);
}
public function bought($request, $response, $args)
{
$id = $args['id'];
$user = User::find($id);
$table_config['total_column'] = array(
'op' => '操作',
'id' => 'ID',
'name' => '商品名称',
'valid' => '是否有效期内',
'auto_renew' => '自动续费时间',
'reset_time' => '流量重置时间',
'buy_time' => '套餐购买时间',
'exp_time' => '套餐过期时间',
'content' => '商品详细内容',
);
$table_config['default_show_column'] = array('op', 'name', 'valid', 'reset_time');
$table_config['ajax_url'] = 'bought/ajax';
$shops = Shop::where('status', 1)->orderBy('name')->get();
return $this->view()->assign('table_config', $table_config)->assign('shops', $shops)->assign('user', $user)->display('admin/user/bought.tpl');
}
public function bought_ajax($request, $response, $args)
{
$start = $request->getParam("start");
$limit_length = $request->getParam('length');
$id = $args['id'];
$user = User::find($id);
$boughts = Bought::where('userid', $user->id)->skip($start)->limit($limit_length)->orderBy('id', 'desc')->get();
$total_conut = Bought::where('userid', $user->id)->count();
$data = [];
foreach ($boughts as $bought) {
$shop = $bought->shop();
if ($shop == null) {
$bought->delete();
continue;
}
$tempdata = [];
$tempdata['op'] = '<a class="btn btn-brand-accent" id="delete" href="javascript:void(0);" onClick="delete_modal_show(\'' . $bought->id . '\')">删除</a>';
$tempdata['id'] = $bought->id;
$tempdata['name'] = $shop->name;
$tempdata['content'] = $shop->content();
$tempdata['auto_renew'] = ($bought->renew == 0 ? '不自动续费' : $bought->renew_date());
$tempdata['buy_time'] = $bought->datetime();
if ($bought->use_loop()) {
$tempdata['valid'] = ($bought->valid() ? '有效' : '已过期');
} else {
$tempdata['valid'] = '-';
}
$tempdata['reset_time'] = $bought->reset_time();
$tempdata['exp_time'] = $bought->exp_time();
$data[] = $tempdata;
}
$info = [
'draw'=> $request->getParam('draw'), // ajax请求次数,作为标识符
'recordsTotal'=>User::count(),
'recordsFiltered'=>$count_filtered,
'data'=>$data,
'draw' => $request->getParam('draw'),
'recordsTotal' => $total_conut,
'recordsFiltered' => $total_conut,
'data' => $data
];
return json_encode($info,true);
}
return json_encode($info, true);
}
public function bought_delete($request, $response, $args)
{
$id = $request->getParam('id');
$Bought = Bought::find($id);
if (!$Bought->delete()) {
$rs['ret'] = 0;
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
$rs['ret'] = 1;
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
public function bought_add($request, $response, $args)
{
$id = $args['id'];
$user = User::find($id);
$shop_id = (int) $request->getParam('buy_shop');
$buy_type = (int) $request->getParam('buy_type');
if ($shop_id == '') {
$rs['ret'] = 0;
$rs['msg'] = '请选择套餐';
return $response->getBody()->write(json_encode($rs));
}
$shop = Shop::find($shop_id);
if ($shop == null) {
$rs['ret'] = 0;
$rs['msg'] = '套餐不存在';
return $response->getBody()->write(json_encode($rs));
}
if ($buy_type != 0) {
if (bccomp($user->money, $shop->price, 2) == -1) {
$res['ret'] = 0;
$res['msg'] = '喵喵喵~ 该用户余额不足。';
return $response->getBody()->write(json_encode($res));
}
$user->money = bcsub($user->money, $shop->price, 2);
$user->save();
}
$boughts = Bought::where('userid', $user->id)->get();
foreach ($boughts as $disable_bought) {
$disable_bought->renew = 0;
$disable_bought->save();
}
$bought = new Bought();
$bought->userid = $user->id;
$bought->shopid = $shop->id;
$bought->datetime = time();
$bought->renew = 0;
$bought->coupon = '';
$bought->price = $shop->price;
$bought->save();
$shop->buy($user);
$rs['msg'] = ($buy_type != 0 ? '套餐购买成功' : '套餐添加成功');
$rs['ret'] = 1;
return $response->getBody()->write(json_encode($rs));
}
}

@ -2,10 +2,7 @@
namespace App\Controllers;
use App\Models\InviteCode;
use App\Models\Node;
use App\Models\TrafficLog;
use App\Models\Payback;
use App\Models\Coupon;
use App\Models\User;
use App\Services\Gateway\ChenPay;
@ -24,7 +21,16 @@ class AdminController extends UserController
public function index($request, $response, $args)
{
$sts = new Analytics();
return $this->view()->assign('sts', $sts)->display('admin/index.tpl');
$days = [];
for ($i = 1; $i <= 7; $i++) {
$date_expression = '-'.$i.' days';
$day = strtotime($date_expression);
$days[] = date("Y-m-d", $day);
}
return $this->view()->assign('sts', $sts)->assign('days', $days)->display('admin/index.tpl');
}
public function node($request, $response, $args)
@ -33,7 +39,6 @@ class AdminController extends UserController
return $this->view()->assign('nodes', $nodes)->display('admin/node.tpl');
}
public function editConfig($request, $response, $args)
{
return (new ChenPay())->editConfig();
@ -51,62 +56,89 @@ class AdminController extends UserController
public function invite($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID",
"total" => "原始金额", "event_user_id" => "发起用户ID",
"event_user_name" => "发起用户名", "ref_user_id" => "获利用户ID",
"ref_user_name" => "获利用户名", "ref_get" => "获利金额",
"datetime" => "时间");
$table_config['total_column'] = array('id' => 'ID',
'total' => '原始金额', 'event_user_id' => '发起用户ID',
'event_user_name' => '发起用户名', 'ref_user_id' => '获利用户ID',
'ref_user_name' => '获利用户名', 'ref_get' => '获利金额',
'datetime' => '时间');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'payback/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/invite.tpl');
}
public function chgInvite($request, $response, $args)
{
$prefix = $request->getParam('prefix');
if ($request->getParam('userid')!=NULL && $request->getParam('refid')!=NULL) {
if (strpos($request->getParam('userid'), "@")!=false) {
$user=User::where("email", "=", $request->getParam('userid'))->first();
} else {
$user=User::Where("id", "=", $request->getParam('userid'))->first();
}
if ($user==null) {
$res['ret'] = 0;
$res['msg'] = "邀请者更改失败,检查用户id是否输入正确";
return $response->getBody()->write(json_encode($res));
}
$uid = $user->id;
} else {
$uid=0;
}
$user->ref_by = $request->getParam('refid');
$user->save();
$res['ret'] = 1;
$res['msg'] = "邀请者更改成功";
return $response->getBody()->write(json_encode($res));
}
public function addInvite($request, $response, $args)
{
$num = $request->getParam('num');
$prefix = $request->getParam('prefix');
if(Tools::isInt($num)==false){
$res['ret'] = 0;
$res['msg'] = "非法请求";
if (Tools::isInt($num) == false) {
$res['ret'] = 0;
$res['msg'] = '非法请求';
return $response->getBody()->write(json_encode($res));
}
}
if ($request->getParam('uid')!="0") {
if (strpos($request->getParam('uid'), "@")!=false) {
$user=User::where("email", "=", $request->getParam('uid'))->first();
if ($request->getParam('uid') != '0') {
if (strpos($request->getParam('uid'), '@') != false) {
$user = User::where('email', '=', $request->getParam('uid'))->first();
} else {
$user=User::Where("id", "=", $request->getParam('uid'))->first();
$user = User::Where('id', '=', $request->getParam('uid'))->first();
}
if ($user==null) {
if ($user == null) {
$res['ret'] = 0;
$res['msg'] = "邀请次数添加失败,检查用户id或者用户邮箱是否输入正确";
$res['msg'] = '邀请次数添加失败,检查用户id或者用户邮箱是否输入正确';
return $response->getBody()->write(json_encode($res));
}
$uid = $user->id;
} else {
$uid=0;
$uid = 0;
}
$user->invite_num += $num;
$user->save();
$user->invite_num += $num;
$user->save();
$res['ret'] = 1;
$res['msg'] = "邀请次数添加成功";
$res['msg'] = '邀请次数添加成功';
return $response->getBody()->write(json_encode($res));
}
public function coupon($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "code" => "优惠码",
"expire" => "过期时间", "shop" => "限定商品ID",
"credit" => "额度", "onetime" => "次数");
$table_config['total_column'] = array('id' => 'ID', 'code' => '优惠码',
'expire' => '过期时间', 'shop' => '限定商品ID',
'credit' => '额度', 'onetime' => '次数');
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
$table_config['default_show_column'][] = $column;
}
$table_config['ajax_url'] = 'coupon/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/coupon.tpl');
@ -115,31 +147,60 @@ class AdminController extends UserController
public function addCoupon($request, $response, $args)
{
$code = new Coupon();
$code->onetime=$request->getParam('onetime');
$code->onetime = $request->getParam('onetime');
$generate_type = $request->getParam('generate_type');
$final_code = $request->getParam('prefix');
if (empty($final_code) && ($generate_type == 1 || $generate_type == 3)) {
$res['ret'] = 0;
$res['msg'] = '优惠码不能为空';
return $response->getBody()->write(json_encode($res));
}
if ($generate_type == 1) {
if (Coupon::where('code', $final_code)->count() != 0) {
$res['ret'] = 0;
$res['msg'] = '优惠码已存在';
return $response->getBody()->write(json_encode($res));
}
} else {
while (true) {
if ($generate_type == 2) {
$temp_code = Tools::genRandomChar(8);
} elseif ($generate_type == 3) {
$temp_code = $final_code . Tools::genRandomChar(8);
}
$code->code=$request->getParam('prefix').Tools::genRandomChar(8);
$code->expire=time()+$request->getParam('expire')*3600;
$code->shop=$request->getParam('shop');
$code->credit=$request->getParam('credit');
if (Coupon::where('code', $temp_code)->count() == 0) {
$final_code = $temp_code;
break;
}
}
}
$code->code = $final_code;
$code->expire = time() + $request->getParam('expire') * 3600;
$code->shop = $request->getParam('shop');
$code->credit = $request->getParam('credit');
$code->save();
$res['ret'] = 1;
$res['msg'] = "优惠码添加成功";
$res['msg'] = '优惠码添加成功';
return $response->getBody()->write(json_encode($res));
}
public function trafficLog($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "user_id" => "用户ID",
"user_name" => "用户名", "node_name" => "使用节点",
"rate" => "倍率", "origin_traffic" => "实际使用流量",
"traffic" => "结算流量",
"log_time" => "记录时间");
$table_config['default_show_column'] = array("id", "user_id",
"user_name", "node_name",
"rate", "origin_traffic",
"traffic", "log_time");
$table_config['total_column'] = array('id' => 'ID', 'user_id' => '用户ID',
'user_name' => '用户名', 'node_name' => '使用节点',
'rate' => '倍率', 'origin_traffic' => '实际使用流量',
'traffic' => '结算流量',
'log_time' => '记录时间');
$table_config['default_show_column'] = array('id', 'user_id',
'user_name', 'node_name',
'rate', 'origin_traffic',
'traffic', 'log_time');
$table_config['ajax_url'] = 'trafficlog/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/trafficlog.tpl');
}
@ -149,11 +210,11 @@ class AdminController extends UserController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select log.id,log.user_id,user.user_name,node.name as node_name,log.rate,(log.u + log.d) as origin_traffic,log.traffic,log.log_time from user_traffic_log as log,user,ss_node as node WHERE log.user_id = user.id AND log.node_id = node.id');
$datatables->edit('log_time', function ($data) {
$datatables->edit('log_time', static function ($data) {
return date('Y-m-d H:i:s', $data['log_time']);
});
$datatables->edit('origin_traffic', function ($data) {
$datatables->edit('origin_traffic', static function ($data) {
return Tools::flowAutoShow($data['origin_traffic']);
});
@ -166,7 +227,7 @@ class AdminController extends UserController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select payback.id,payback.total,payback.userid as event_user_id,event_user.user_name as event_user_name,payback.ref_by as ref_user_id,ref_user.user_name as ref_user_name,payback.ref_get,payback.datetime from payback,user as event_user,user as ref_user where event_user.id = payback.userid and ref_user.id = payback.ref_by');
$datatables->edit('datetime', function ($data) {
$datatables->edit('datetime', static function ($data) {
return date('Y-m-d H:i:s', $data['datetime']);
});
@ -179,11 +240,86 @@ class AdminController extends UserController
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select id,code,expire,shop,credit,onetime from coupon');
$datatables->edit('expire', function ($data) {
$datatables->edit('expire', static function ($data) {
return date('Y-m-d H:i:s', $data['expire']);
});
$body = $response->getBody();
$body->write($datatables->generate());
}
public function getIncome($request, $response, $args)
{
$date = $request->getParam('date');
$date_in_timestamp = strtotime($date);
//$date_in_timestamp = strtotime('2019-12-12');
$stats = new Analytics();
$today_income = $stats->getIncome($date_in_timestamp, $date_in_timestamp+86400);
$yesterday_income = $stats->getIncome($date_in_timestamp-86400, $date_in_timestamp);
$first_day_of_this_week_timestamp = strtotime("last monday midnight",$date_in_timestamp);
$first_day_of_next_week_timestamp = strtotime("next monday midnight",$date_in_timestamp);
$this_week_income = $stats->getIncome($first_day_of_this_week_timestamp, $first_day_of_next_week_timestamp);
$first_day_of_last_week_timestamp = strtotime("last monday midnight",$date_in_timestamp-604800);
$last_week_income = $stats->getIncome($first_day_of_last_week_timestamp, $first_day_of_this_week_timestamp);
$first_day_of_this_month_timestamp = strtotime("first day of this month",$date_in_timestamp);
$first_day_of_next_month_timestamp = strtotime("first day of next month",$date_in_timestamp);
$this_month_income = $stats->getIncome($first_day_of_this_month_timestamp, $first_day_of_next_month_timestamp);
$first_day_of_last_month_timestamp = strtotime("first day of last month",$date_in_timestamp);
$last_moneth_income = $stats->getIncome($first_day_of_last_month_timestamp, $first_day_of_this_month_timestamp);
$res['success'] = true;
$res['error'] = '';
$res['message'] = '';
$res['data'] = array(
"date" => $date,
"todayIncome" => $today_income,
"yesterdayIncome" => $yesterday_income,
"thisWeekIncome" => $this_week_income,
"lastWeekIncome" => $last_week_income,
"thisMonthIncome" => $this_month_income,
"lastMonthIncome" => $last_moneth_income
);
return $response->getBody()->write(json_encode($res));
}
public function newUsers($request, $response, $args)
{
$date = $request->getParam('date');
$date_in_timestamp = strtotime($date);
$stats = new Analytics();
$today_users = $stats->getNewUsers($date_in_timestamp, $date_in_timestamp+86400);
$yesterday_users = $stats->getNewUsers($date_in_timestamp-86400, $date_in_timestamp);
$first_day_of_this_week_timestamp = strtotime("last monday midnight",$date_in_timestamp);
$first_day_of_next_week_timestamp = strtotime("next monday midnight",$date_in_timestamp);
$this_week_users = $stats->getNewUsers($first_day_of_this_week_timestamp, $first_day_of_next_week_timestamp);
$first_day_of_last_week_timestamp = strtotime("last monday midnight",$date_in_timestamp-604800);
$last_week_users = $stats->getNewUsers($first_day_of_last_week_timestamp, $first_day_of_this_week_timestamp);
$first_day_of_this_month_timestamp = strtotime("first day of this month",$date_in_timestamp);
$first_day_of_next_month_timestamp = strtotime("first day of next month",$date_in_timestamp);
$this_month_users = $stats->getNewUsers($first_day_of_this_month_timestamp, $first_day_of_next_month_timestamp);
$first_day_of_last_month_timestamp = strtotime("first day of last month",$date_in_timestamp);
$last_moneth_users = $stats->getNewUsers($first_day_of_last_month_timestamp, $first_day_of_this_month_timestamp);
$res['success'] = true;
$res['error'] = '';
$res['message'] = '';
$res['data'] = array(
"date" => $date,
"today" => $today_users,
"yesterday" => $yesterday_users,
"thisWeek" => $this_week_users,
"lastWeek" => $last_week_users,
"thisMonth" => $this_month_users,
"lastMonth" => $last_moneth_users
);
return $response->getBody()->write(json_encode($res));
}
}

@ -1,164 +0,0 @@
<?php
namespace App\Controllers;
use App\Models\InviteCode;
use App\Models\Node;
use App\Models\User;
use App\Services\Factory;
use App\Services\Config;
use App\Utils\Tools;
use App\Utils\Hash;
use App\Utils\Helper;
/**
* ApiController
*/
class ApiController extends BaseController
{
public function index()
{
}
public function token($request, $response, $args)
{
$accessToken = $id = $args['token'];
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($token==null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
return $this->echoJson($response, $res);
}
$res['ret'] = 1;
$res['msg'] = "ok";
$res['data'] = $token;
return $this->echoJson($response, $res);
}
public function newToken($request, $response, $args)
{
// $data = $request->post('sdf');
$email = $request->getParam('email');
$email = strtolower($email);
$passwd = $request->getParam('passwd');
// Handle Login
$user = User::where('email', '=', $email)->first();
if ($user == null) {
$res['ret'] = 0;
$res['msg'] = "401 邮箱或者密码错误";
return $this->echoJson($response, $res);
}
if (!Hash::checkPassword($user->pass, $passwd)) {
$res['ret'] = 0;
$res['msg'] = "402 邮箱或者密码错误";
return $this->echoJson($response, $res);
}
$tokenStr = Tools::genToken();
$storage = Factory::createTokenStorage();
$expireTime = time() + 3600*24*7;
if ($storage->store($tokenStr, $user, $expireTime)) {
$res['ret'] = 1;
$res['msg'] = "ok";
$res['data']['token'] = $tokenStr;
$res['data']['user_id'] = $user->id;
return $this->echoJson($response, $res);
}
$res['ret'] = 0;
$res['msg'] = "system error";
return $this->echoJson($response, $res);
}
public function node($request, $response, $args)
{
$accessToken = Helper::getTokenFromReq($request);
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
$user = User::find($token->userId);
$nodes = Node::where('sort', 0)->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(
function ($query) use ($user) {
$query->where("node_group", "=", $user->node_group)
->orWhere("node_group", "=", 0);
}
)->get();
$temparray=array();
foreach ($nodes as $node) {
if ($node->mu_only == 0) {
array_push($temparray, array("remarks"=>$node->name,
"server"=>$node->server,
"server_port"=>$user->port,
"method"=>($node->custom_method==1?$user->method:$node->method),
"obfs"=>str_replace("_compatible", "", (($node->custom_rss==1&&!($user->obfs=='plain'&&$user->protocol=='origin'))?$user->obfs:"plain")),
"obfsparam"=>(($node->custom_rss==1&&!($user->obfs=='plain'&&$user->protocol=='origin'))?$user->obfs_param:""),
"remarks_base64"=>base64_encode($node->name),
"password"=>$user->passwd,
"tcp_over_udp"=>false,
"udp_over_tcp"=>false,
"group"=>Config::get('appName'),
"protocol"=>str_replace("_compatible", "", (($node->custom_rss==1&&!($user->obfs=='plain'&&$user->protocol=='origin'))?$user->protocol:"origin")),
"obfs_udp"=>false,
"enable"=>true));
}
if ($node->custom_rss == 1) {
foreach ($mu_nodes as $mu_node) {
$mu_user = User::where('port', '=', $mu_node->server)->first();
$mu_user->obfs_param = $user->getMuMd5();
array_push($temparray, array("remarks"=>$node->name."- ".$mu_node->server." 单端口",
"server"=>$node->server,
"server_port"=>$mu_user->port,
"method"=>$mu_user->method,
"group"=>Config::get('appName'),
"obfs"=>str_replace("_compatible", "", (($node->custom_rss==1&&!($mu_user->obfs=='plain'&&$mu_user->protocol=='origin'))?$mu_user->obfs:"plain")),
"obfsparam"=>(($node->custom_rss==1&&!($mu_user->obfs=='plain'&&$mu_user->protocol=='origin'))?$mu_user->obfs_param:""),
"remarks_base64"=>base64_encode($node->name."- ".$mu_node->server." 单端口"),
"password"=>$mu_user->passwd,
"tcp_over_udp"=>false,
"udp_over_tcp"=>false,
"protocol"=>str_replace("_compatible", "", (($node->custom_rss==1&&!($mu_user->obfs=='plain'&&$mu_user->protocol=='origin'))?$mu_user->protocol:"origin")),
"obfs_udp"=>false,
"enable"=>true));
}
}
}
$res['ret'] = 1;
$res['msg'] = "ok";
$res['data'] = $temparray;
return $this->echoJson($response, $res);
}
public function userInfo($request, $response, $args)
{
$id = $args['id'];
$accessToken = Helper::getTokenFromReq($request);
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($id != $token->userId) {
$res['ret'] = 0;
$res['msg'] = "access denied";
return $this->echoJson($response, $res);
}
$user = User::find($token->userId);
$user->pass = null;
$data = $user;
$res['ret'] = 1;
$res['msg'] = "ok";
$res['data'] = $data;
return $this->echoJson($response, $res);
}
}

@ -4,13 +4,12 @@ namespace App\Controllers;
use App\Models\InviteCode;
use App\Services\Config;
use App\Services\MalioConfig;
use App\Utils\Check;
use App\Utils\Tools;
use App\Utils\Radius;
use Exception;
use voku\helper\AntiXSS;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use App\Utils\Hash;
use App\Utils\Da;
use App\Services\Auth;
@ -18,29 +17,39 @@ use App\Services\Mail;
use App\Models\User;
use App\Models\LoginIp;
use App\Models\EmailVerify;
use App\Utils\Duoshuo;
use App\Models\SmsVerify;
use App\Utils\GA;
use App\Utils\Wecenter;
use App\Utils\Geetest;
use App\Utils\TelegramSessionManager;
use Ramsey\Uuid\Uuid;
use App\Services\Internationalization;
/**
* AuthController
*/
class AuthController extends BaseController
{
public function login()
public function login($request, $response, $args)
{
$uid = time() . rand(1, 10000);
if (Config::get('enable_geetest_login') == 'true') {
$GtSdk = Geetest::get($uid);
} else {
$GtSdk = null;
$GtSdk = null;
$recaptcha_sitekey = null;
if (Config::get('enable_login_captcha') === true) {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
$uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
break;
}
}
if (Config::get('enable_telegram') == 'true') {
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 {
@ -48,30 +57,87 @@ class AuthController extends BaseController
$login_number = '';
}
$welcome = '';
$time = date('G');
if ($time <= 4) {
$welcome = 'Good Night';
} else if ($time <= 12) {
$welcome = 'Good Morning';
} else if ($time <=18) {
$welcome = 'Good Afternoon';
} else {
$welcome = 'Good Evening';
}
$i18n = new Internationalization();
if (MalioConfig::get('only_one_lang') != 'none') {
$i18n->lang = MalioConfig::get('only_one_lang');
} else {
$i18n->detectLang($request, $response, $args);
}
return $this->view()
->assign('geetest_html', $GtSdk)
->assign('login_token', $login_token)
->assign('login_number', $login_number)
->assign('welcome', $welcome)
->assign('telegram_bot', Config::get('telegram_bot'))
->assign('base_url', Config::get('baseUrl'))
->assign('recaptcha_sitekey', $recaptcha_sitekey)
->assign('i18n', $i18n)
->display('auth/login.tpl');
}
public function getCaptcha($request, $response, $args)
{
$GtSdk = null;
$recaptcha_sitekey = null;
if (Config::get('captcha_provider') != '') {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
$res['recaptchaKey'] = $recaptcha_sitekey;
break;
case 'geetest':
$uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
$res['GtSdk'] = $GtSdk;
break;
}
}
$res['respon'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function loginHandle($request, $response, $args)
{
// $data = $request->post('sdf');
$email = $request->getParam('email');
$email = trim($email);
$email = trim($email);
$email = strtolower($email);
$passwd = $request->getParam('passwd');
$code = $request->getParam('code');
$rememberMe = $request->getParam('remember_me');
if (Config::get('enable_geetest_login') == 'true') {
$ret = Geetest::verify($request->getParam('geetest_challenge'), $request->getParam('geetest_validate'), $request->getParam('geetest_seccode'));
if (Config::get('enable_login_captcha') === true) {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha = $request->getParam('recaptcha');
if ($recaptcha == '') {
$ret = false;
} else {
$json = file_get_contents('https://recaptcha.net/recaptcha/api/siteverify?secret=' . Config::get('recaptcha_secret') . '&response=' . $recaptcha);
$ret = json_decode($json)->success;
}
break;
case 'geetest':
$ret = Geetest::verify($request->getParam('geetest_challenge'), $request->getParam('geetest_validate'), $request->getParam('geetest_seccode'));
break;
}
if (!$ret) {
$res['ret'] = 0;
$res['msg'] = "系统无法接受您的验证结果,请刷新页面后重试。";
$res['msg'] = '系统无法接受您的验证结果,请刷新页面后重试。';
return $response->getBody()->write(json_encode($res));
}
}
@ -81,28 +147,28 @@ class AuthController extends BaseController
if ($user == null) {
$rs['ret'] = 0;
$rs['msg'] = "邮箱或者密码错误";
$rs['msg'] = '邮箱不存在';
return $response->getBody()->write(json_encode($rs));
}
if (!Hash::checkPassword($user->pass, $passwd)) {
$rs['ret'] = 0;
$rs['msg'] = "邮箱或者密码错误.";
$rs['msg'] = '邮箱或者密码错误';
$loginip = new LoginIp();
$loginip->ip = $_SERVER["REMOTE_ADDR"];
$loginip->userid = $user->id;
$loginip->datetime = time();
$loginip->type = 1;
$loginip->save();
$loginIP = new LoginIp();
$loginIP->ip = $_SERVER['REMOTE_ADDR'];
$loginIP->userid = $user->id;
$loginIP->datetime = time();
$loginIP->type = 1;
$loginIP->save();
return $response->getBody()->write(json_encode($rs));
}
// @todo
$time = 3600 * 24;
if ($rememberMe) {
$time = 3600 * 24 * 7;
$time = 3600 * 24 * (Config::get('rememberMeDuration') ?: 7);
}
if ($user->ga_enable == 1) {
@ -110,25 +176,22 @@ class AuthController extends BaseController
$rcode = $ga->verifyCode($user->ga_token, $code);
if (!$rcode) {
$res['ret'] = 0;
$res['msg'] = "两步验证码错误,如果您是丢失了生成器或者错误地设置了这个选项,您可以尝试重置密码,即可取消这个选项。";
$res['ret'] = 2;
$res['msg'] = '两步验证码错误,如果您是丢失了生成器或者错误地设置了这个选项,您可以尝试重置密码,即可取消这个选项。';
return $response->getBody()->write(json_encode($res));
}
}
Auth::login($user->id, $time);
$rs['ret'] = 1;
$rs['msg'] = "登录成功";
$rs['msg'] = '登录成功';
$loginip = new LoginIp();
$loginip->ip = $_SERVER["REMOTE_ADDR"];
$loginip->userid = $user->id;
$loginip->datetime = time();
$loginip->type = 0;
$loginip->save();
Wecenter::add($user, $passwd);
Wecenter::Login($user, $passwd, $time);
$loginIP = new LoginIp();
$loginIP->ip = $_SERVER['REMOTE_ADDR'];
$loginIP->userid = $user->id;
$loginIP->datetime = time();
$loginIP->type = 0;
$loginIP->save();
return $response->getBody()->write(json_encode($rs));
}
@ -142,7 +205,7 @@ class AuthController extends BaseController
$ret = TelegramSessionManager::step2_verify_login_session($token, $number);
if (!$ret) {
$res['ret'] = 0;
$res['msg'] = "此令牌无法被使用。";
$res['msg'] = '此令牌无法被使用。';
return $response->getBody()->write(json_encode($res));
}
@ -154,9 +217,9 @@ class AuthController extends BaseController
Auth::login($user->id, $time);
$rs['ret'] = 1;
$rs['msg'] = "登录成功";
$rs['msg'] = '登录成功';
$this->logUserIp($user->id, $_SERVER["REMOTE_ADDR"]);
$this->logUserIp($user->id, $_SERVER['REMOTE_ADDR']);
return $response->getBody()->write(json_encode($rs));
}
@ -174,56 +237,73 @@ class AuthController extends BaseController
public function register($request, $response, $next)
{
$ary = $request->getQueryParams();
$code = "";
$code = '';
if (isset($ary['code'])) {
$antiXss = new AntiXSS();
$code = $antiXss->xss_clean($ary['code']);
}
$uid = time() . rand(1, 10000);
$GtSdk = null;
$recaptcha_sitekey = null;
if (Config::get('enable_reg_captcha') === true) {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
$uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
break;
}
}
if (Config::get('enable_geetest_reg') == 'true') {
$GtSdk = Geetest::get($uid);
$i18n = new Internationalization();
if (MalioConfig::get('only_one_lang') != 'none') {
$i18n->lang = MalioConfig::get('only_one_lang');
} else {
$GtSdk = null;
$i18n->detectLang($request, $response, $args);
}
return $this->view()->assign('geetest_html', $GtSdk)->assign('enable_email_verify', Config::get('enable_email_verify'))->assign('code', $code)->display('auth/register.tpl');
return $this->view()
->assign('i18n', $i18n)
->assign('geetest_html', $GtSdk)
->assign('enable_email_verify', Config::get('enable_email_verify'))
->assign('code', $code)
->assign('recaptcha_sitekey', $recaptcha_sitekey)
->display('auth/register.tpl');
}
public function sendVerify($request, $response, $next)
{
if (Config::get('enable_email_verify') == 'true') {
if (Config::get('enable_email_verify') == true) {
$email = $request->getParam('email');
$email = trim($email);
$email = trim($email);
if ($email == "") {
if ($email == '') {
$res['ret'] = 0;
$res['msg'] = "未填写邮箱";
$res['msg'] = '未填写邮箱';
return $response->getBody()->write(json_encode($res));
}
// check email format
if (!Check::isEmailLegal($email)) {
$res['ret'] = 0;
$res['msg'] = "邮箱无效";
$res['msg'] = '邮箱无效';
return $response->getBody()->write(json_encode($res));
}
$user = User::where('email', '=', $email)->first();
if ($user != null) {
$res['ret'] = 0;
$res['msg'] = "此邮箱已经注册";
$res['msg'] = '此邮箱已经注册';
return $response->getBody()->write(json_encode($res));
}
$ipcount = EmailVerify::where('ip', '=', $_SERVER["REMOTE_ADDR"])->where('expire_in', '>', time())->count();
$ipcount = EmailVerify::where('ip', '=', $_SERVER['REMOTE_ADDR'])->where('expire_in', '>', time())->count();
if ($ipcount >= (int)Config::get('email_verify_iplimit')) {
$res['ret'] = 0;
$res['msg'] = "此IP请求次数过多";
$res['msg'] = '此IP请求次数过多';
return $response->getBody()->write(json_encode($res));
}
@ -231,7 +311,7 @@ class AuthController extends BaseController
$mailcount = EmailVerify::where('email', '=', $email)->where('expire_in', '>', time())->count();
if ($mailcount >= 3) {
$res['ret'] = 0;
$res['msg'] = "此邮箱请求次数过多";
$res['msg'] = '此邮箱请求次数过多';
return $response->getBody()->write(json_encode($res));
}
@ -239,57 +319,161 @@ class AuthController extends BaseController
$ev = new EmailVerify();
$ev->expire_in = time() + Config::get('email_verify_ttl');
$ev->ip = $_SERVER["REMOTE_ADDR"];
$ev->ip = $_SERVER['REMOTE_ADDR'];
$ev->email = $email;
$ev->code = $code;
$ev->save();
$subject = Config::get('appName') . "- 验证邮件";
$subject = Config::get('appName') . '- 验证邮件';
try {
Mail::send($email, $subject, 'auth/verify.tpl', [
"code" => $code, "expire" => date("Y-m-d H:i:s", time() + Config::get('email_verify_ttl'))
'code' => $code, 'expire' => date('Y-m-d H:i:s', time() + Config::get('email_verify_ttl'))
], [
//BASE_PATH.'/public/assets/email/styles.css'
]);
} catch (\Exception $e) {
return false;
} catch (Exception $e) {
$res['ret'] = 1;
$res['msg'] = '邮件发送失败,请联系网站管理员。';
return $response->getBody()->write(json_encode($res));
}
$res['ret'] = 1;
$res['msg'] = "验证码发送成功,请查收邮件。";
$res['msg'] = '验证码发送成功,请查收邮件。';
return $response->getBody()->write(json_encode($res));
}
$res['ret'] = 0;
return $response->getBody()->write(json_encode($res));
}
public function sendSMS($request, $response, $next)
{
if (MalioConfig::get('enable_sms_verify') == true) {
$phone = $request->getParam('phone');
$phone = trim($phone);
$area_code = $request->getParam('area_code');
$full_phone = $area_code.$phone;
if ($phone == '' || $area_code == '') {
$res['ret'] = 0;
$res['msg'] = '请填写完整的手机号';
return $response->getBody()->write(json_encode($res));
}
$ipcount = SmsVerify::where('ip', '=', $_SERVER['REMOTE_ADDR'])->where('expire_in', '>', time())->count();
if ($ipcount >= (int)MalioConfig::get('sms_verify_iplimit')) {
$res['ret'] = 0;
$res['msg'] = '此IP请求次数过多';
return $response->getBody()->write(json_encode($res));
}
$code = Tools::genRandomNum(6);
$pamas = array(
'access_key' => MalioConfig::get('globalsent_access_key'),
'mobile' => $full_phone,
'content' => '您的注册验证码是 '.$code
);
$url = 'https://api.globalsent.com/send?'.http_build_query($pamas);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$return = curl_exec($ch);
curl_close($ch);
$return = json_decode($return);
if ($return->code != '0000') {
$res['ret'] = 0;
$res['msg'] = '发送短信验证码失败';
return $return->code;
return $response->getBody()->write(json_encode($res));
} else {
$sv = new SmsVerify();
$sv->expire_in = time() + Config::get('email_verify_ttl');
$sv->ip = $_SERVER['REMOTE_ADDR'];
$sv->phone = $full_phone;
$sv->code = $code;
$sv->save();
$res['ret'] = 1;
$res['msg'] = '验证码发送成功,请查收短信。';
return $response->getBody()->write(json_encode($res));
}
/*
{
"code": "0000",
"data": {
"send_id": "312312312",
"mobile": "861212131212",
"messages": "\u3010Malio\u4e91\u3011test",
"count": 1,
"per_price": 0.06,
"count_price": 0.06
},
"message": ""
}
*/
}
$res['ret'] = 0;
return $response->getBody()->write(json_encode($res));
}
public function registerHandle($request, $response)
{
if(Config::get('register_mode')=='close'){
$res['ret'] = 0;
$res['msg'] = "未开放注册。";
if (Config::get('register_mode') === 'close') {
$res['ret'] = 0;
$res['msg'] = '未开放注册。';
return $response->getBody()->write(json_encode($res));
}
}
$name = $request->getParam('name');
$email = $request->getParam('email');
$email = trim($email);
$email = trim($email);
$email = strtolower($email);
$passwd = $request->getParam('passwd');
$repasswd = $request->getParam('repasswd');
$code = $request->getParam('code');
$code = trim($code);
$code = trim($code);
$imtype = $request->getParam('imtype');
$emailcode = $request->getParam('emailcode');
$emailcode = trim($emailcode);
$emailcode = trim($emailcode);
$wechat = $request->getParam('wechat');
$wechat = trim($wechat);
$wechat = trim($wechat);
// check code
if (Config::get('enable_geetest_reg') == 'true') {
$ret = Geetest::verify($request->getParam('geetest_challenge'), $request->getParam('geetest_validate'), $request->getParam('geetest_seccode'));
$sms_code = $request->getParam('sms_code');
$sms_code = trim($sms_code);
$phone = $request->getParam('phone');
$phone = trim($phone);
$area_code = $request->getParam('area_code');
$full_phone = $area_code.$phone;
if (Config::get('enable_reg_captcha') === true) {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha = $request->getParam('recaptcha');
if ($recaptcha == '') {
$ret = false;
} else {
$json = file_get_contents('https://recaptcha.net/recaptcha/api/siteverify?secret=' . Config::get('recaptcha_secret') . '&response=' . $recaptcha);
$ret = json_decode($json)->success;
}
break;
case 'geetest':
$ret = Geetest::verify($request->getParam('geetest_challenge'), $request->getParam('geetest_validate'), $request->getParam('geetest_seccode'));
break;
}
if (!$ret) {
$res['ret'] = 0;
$res['msg'] = "系统无法接受您的验证结果,请刷新页面后重试。";
$res['msg'] = '系统无法接受您的验证结果,请刷新页面后重试。';
return $response->getBody()->write(json_encode($res));
}
}
@ -297,50 +481,75 @@ class AuthController extends BaseController
//dumplin:1、邀请人等级为0则邀请码不可用;2、邀请人invite_num为可邀请次数,填负数则为无限
$c = InviteCode::where('code', $code)->first();
if ($c == null) {
if (Config::get('register_mode') == 'invite') {
if ($c == null && MalioConfig::get('code_required') == true) {
if (Config::get('register_mode') === 'invite') {
$res['ret'] = 0;
$res['msg'] = "邀请码无效";
$res['msg'] = '邀请码无效';
return $response->getBody()->write(json_encode($res));
}
} else if ($c->user_id != 0) {
$gift_user = User::where("id", "=", $c->user_id)->first();
} elseif ($c->user_id != 0) {
$gift_user = User::where('id', '=', $c->user_id)->first();
if ($gift_user == null) {
$res['ret'] = 0;
$res['msg'] = "邀请人不存在";
$res['msg'] = '邀请人不存在';
return $response->getBody()->write(json_encode($res));
} else if ($gift_user->class == 0) {
}
if ($gift_user->class == 0 && MalioConfig::get('code_required') == true) {
$res['ret'] = 0;
$res['msg'] = "邀请人不是VIP";
$res['msg'] = '邀请人不是VIP';
return $response->getBody()->write(json_encode($res));
} else if ($gift_user->invite_num == 0) {
}
if ($gift_user->invite_num == 0 && MalioConfig::get('code_required') == true) {
$res['ret'] = 0;
$res['msg'] = "邀请人可用邀请次数为0";
$res['msg'] = '邀请人可用邀请次数为0';
return $response->getBody()->write(json_encode($res));
}
}
// check email format
if (!Check::isEmailLegal($email)) {
$res['ret'] = 0;
$res['msg'] = "邮箱无效";
$res['msg'] = '邮箱无效';
return $response->getBody()->write(json_encode($res));
}
$email_postfix = '@'.(explode("@",$email)[1]);
if (in_array($email_postfix, MalioConfig::get('register_email_black_list')) == true) {
$res['ret'] = 0;
$res['msg'] = '邮箱后缀已被拉黑';
return $response->getBody()->write(json_encode($res));
}
if (MalioConfig::get('enable_register_email_restrict') == true) {
if (in_array($email_postfix, MalioConfig::get('register_email_white_list')) == false) {
$res['ret'] = 0;
$res['msg'] = '小老弟还会发送post请求啊';
return $response->getBody()->write(json_encode($res));
}
}
// check email
$user = User::where('email', $email)->first();
if ($user != null) {
$res['ret'] = 0;
$res['msg'] = "邮箱已经被注册了";
$res['msg'] = '邮箱已经被注册了';
return $response->getBody()->write(json_encode($res));
}
if (Config::get('enable_email_verify') == 'true') {
if (Config::get('enable_email_verify') == true) {
$mailcount = EmailVerify::where('email', '=', $email)->where('code', '=', $emailcode)->where('expire_in', '>', time())->first();
if ($mailcount == null) {
$res['ret'] = 0;
$res['msg'] = "您的邮箱验证码不正确";
$res['msg'] = '您的邮箱验证码不正确';
return $response->getBody()->write(json_encode($res));
}
}
if (MalioConfig::get('enable_sms_verify') == true) {
$smscount = SmsVerify::where('phone', '=', $full_phone)->where('code', '=', $sms_code)->where('expire_in', '>', time())->first();
if ($smscount == null) {
$res['ret'] = 0;
$res['msg'] = '您的短信验证码不正确';
return $response->getBody()->write(json_encode($res));
}
}
@ -348,32 +557,39 @@ class AuthController extends BaseController
// check pwd length
if (strlen($passwd) < 8) {
$res['ret'] = 0;
$res['msg'] = "密码请大于8位";
$res['msg'] = '密码请大于8位';
return $response->getBody()->write(json_encode($res));
}
// check pwd re
if ($passwd != $repasswd) {
$res['ret'] = 0;
$res['msg'] = "两次密码输入不符";
$res['msg'] = '两次密码输入不符';
return $response->getBody()->write(json_encode($res));
}
if ($imtype == "" || $wechat == "") {
/*
if ($imtype == '' || $wechat == '') {
$res['ret'] = 0;
$res['msg'] = "请填上你的联络方式";
$res['msg'] = '请填上你的联络方式';
return $response->getBody()->write(json_encode($res));
}
$user = User::where('im_value', $wechat)->where('im_type', $imtype)->first();
if ($user != null) {
$res['ret'] = 0;
$res['msg'] = "此联络方式已注册";
$res['msg'] = '此联络方式已注册';
return $response->getBody()->write(json_encode($res));
}
if (Config::get('enable_email_verify') == 'true') {
*/
if (Config::get('enable_email_verify') == true) {
EmailVerify::where('email', '=', $email)->delete();
}
if (MalioConfig::get('enable_sms_verify') == true) {
SmsVerify::where('phone', '=', $full_phone)->delete();
}
// do reg user
$user = new User();
@ -402,35 +618,39 @@ class AuthController extends BaseController
$user->auto_reset_day = Config::get('reg_auto_reset_day');
$user->auto_reset_bandwidth = Config::get('reg_auto_reset_bandwidth');
$user->money = 0;
if ($full_phone == '') {
$user->phone = null;
} else {
$user->phone = $full_phone;
}
//dumplin:填写邀请人,写入邀请奖励
$user->ref_by = 0;
if ($c != null) {
if ($c->user_id != 0) {
$gift_user = User::where("id", "=", $c->user_id)->first();
if (($c != null) && $c->user_id != 0) {
$gift_user = User::where('id', '=', $c->user_id)->first();
if ($gift_user->invite_num != 0) {
$user->ref_by = $c->user_id;
$user->money = Config::get('invite_get_money');
$gift_user->transfer_enable = ($gift_user->transfer_enable + Config::get('invite_gift') * 1024 * 1024 * 1024);
$gift_user->invite_num -= 1;
$gift_user->transfer_enable += Config::get('invite_gift') * 1024 * 1024 * 1024;
--$gift_user->invite_num;
$gift_user->save();
}
};
}
$user->class_expire = date("Y-m-d H:i:s", time() + Config::get('user_class_expire_default') * 3600);
$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');
$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->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->plan = 'A';
$user->theme = Config::get('theme');
$group = Config::get('ramdom_group');
$Garray = explode(",", $group);
$groups = explode(',', Config::get('ramdom_group'));
$user->node_group = $Garray[rand(0, count($Garray) - 1)];
$user->node_group = $groups[array_rand($groups)];
$ga = new GA();
$secret = $ga->createSecret();
@ -439,53 +659,61 @@ class AuthController extends BaseController
$user->ga_enable = 0;
/* malio 增加UUID */
$user->uuid = Uuid::uuid3(Uuid::NAMESPACE_DNS, ($user->passwd) . Config::get('key') . $user->id)->toString();
/* malio end */
if ($user->save()) {
$res['ret'] = 1;
$res['msg'] = "注册成功!正在进入登录界面";
Duoshuo::add($user);
$res['msg'] = '注册成功!正在进入登录界面';
Radius::Add($user, $user->passwd);
return $response->getBody()->write(json_encode($res));
}
$res['ret'] = 0;
$res['msg'] = "未知错误";
$res['msg'] = '未知错误';
return $response->getBody()->write(json_encode($res));
}
public function logout($request, $response, $next)
{
Auth::logout();
$newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login');
return $newResponse;
return $response->withStatus(302)->withHeader('Location', '/auth/login');
}
public function qrcode_check($request, $response, $args)
{
$token = $request->getQueryParams()["token"];
$number = $request->getQueryParams()["number"];
$token = $request->getParam('token');
$number = $request->getParam('number');
$user = Auth::getUser();
if ($user->isLogin) {
$res['ret'] = 0;
return $response->getBody()->write(json_encode($res));
}
if (Config::get('enable_telegram') == 'true') {
if (Config::get('enable_telegram') === true) {
$ret = TelegramSessionManager::check_login_session($token, $number);
$res['ret'] = $ret;
return $response->getBody()->write(json_encode($res));
} else {
$res['ret'] = 0;
return $response->getBody()->write(json_encode($res));
}
$res['ret'] = 0;
return $response->getBody()->write(json_encode($res));
}
public function telegram_oauth($request, $response, $args)
{
if (Config::get('enable_telegram') == 'true') {
if (Config::get('enable_telegram') === true) {
$auth_data = $request->getQueryParams();
if ($this->telegram_oauth_check($auth_data) === true) { // Looks good, proceed.
$telegram_id = $auth_data['id'];
$user = User::query()->where('telegram_id', $telegram_id)->firstOrFail(); // Welcome Back :)
if($user == null){
if ($user == null) {
return $this->view()->assign('title', '您需要先进行邮箱注册后绑定Telegram才能使用授权登录')->assign('message', '很抱歉带来的不便,请重新试试')->assign('redirect', '/auth/login')->display('telegram_error.tpl');
}
Auth::login($user->id, 3600);
$this->logUserIp($user->id, $_SERVER["REMOTE_ADDR"]);
$this->logUserIp($user->id, $_SERVER['REMOTE_ADDR']);
// 登陆成功!
return $this->view()->assign('title', '登录成功')->assign('message', '正在前往仪表盘')->assign('redirect', '/user')->display('telegram_success.tpl');
@ -499,7 +727,7 @@ class AuthController extends BaseController
private function telegram_oauth_check($auth_data)
{
$check_hash = $auth_data['hash'];
$bot_token = Config::get('telegram_token');;
$bot_token = Config::get('telegram_token');
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {

@ -2,41 +2,60 @@
namespace App\Controllers;
use App\Services\Auth;
use App\Models\User;
use App\Services\View;
use App\Services\Auth;
use Slim\Http\Response;
use Psr\Http\Message\ResponseInterface;
use Smarty;
use App\Services\Internationalization;
/**
* BaseController
*/
class BaseController
{
public $view;
/**
* @var Smarty
*/
protected $view;
public $smarty;
public function construct__()
{
}
/**
* @var User
*/
protected $user;
public function smarty()
/**
* Construct page renderer
*/
public function __construct()
{
$this->smarty = View::getSmarty();
return $this->smarty;
$this->view = View::getSmarty();
$this->user = Auth::getUser();
$this->i18n = new Internationalization();
}
/**
* Get smarty
*
* @return Smarty
*/
public function view()
{
return $this->smarty();
return $this->view;
}
// TODO: remove
/**
* @param $response
* @param $res
* @return mixed
* Output JSON
*
* @param Response $response
* @param array|object $resource
*
* @return ResponseInterface
*/
public function echoJson($response, $res)
public function echoJson(Response $response, $resource)
{
return $response->getBody()->write(json_encode($res));
return $response->withJson($resource);
}
}

@ -1,71 +0,0 @@
<?php
/**
* Created by PhpStorm.
* User: kaguya
* Date: 2018/06/30
* Time: 21:40
*/
namespace App\Controllers\Client;
use App\Controllers\BaseController;
use App\Controllers\LinkController;
use App\Models\Ann;
use App\Models\User;
use App\Services\Auth;
use App\Services\Config;
use App\Services\Factory;
use App\Utils\Helper;
class ClientApiController extends BaseController
{
public function GetAnnouncement($request, $response, $args)
{
$accessToken = Helper::getTokenFromReq($request);
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
$user = User::find($token->userId);
$Anns = Ann::orderBy('date', 'desc')->first();
$res['ret'] = 1;
$res['msg'] = "ok";
$res['data'] = $Anns;
return $this->echoJson($response, $res);
}
public function Redirect($request, $response, $args){
$user = Auth::getUser();
$url = $request->getQueryParams()["target"];
if(!$user->isLogin){
$accessToken = Helper::getTokenFromReq($request);
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($token==null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
return $this->echoJson($response, $res);
}
$user = User::find($token->userId);
$time = 3600*24;
Auth::login($user->id, $time);
}
return $response->withRedirect($url);
}
public function GetSubLink($request, $response, $args)
{
$accessToken = Helper::getTokenFromReq($request);
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
$user = User::find($token->userId);
$ssr_sub_token = LinkController::GenerateSSRSubCode($user->id, 0);
$mu = 0;
if($request->getQueryParams()["mu"]!=""){
$mu = $request->getQueryParams()["mu"];
}
$res['ret'] = 1;
$res['msg'] = "ok";
$res['data'] = Config::get('baseUrl').'/link/'.$ssr_sub_token.'?mu='.$mu;
return $this->echoJson($response, $res);
}
}

@ -0,0 +1,591 @@
<?php
/**
* 部分应用自定义配置
*
* PHP version 7.2+
*
* @category GeekQu
* @package App/Controllers/ConfController
* @author GeekQu <iloves@live.com>
* @license MIT https://github.com/GeekQu/ss-panel-v3-mod_Uim/blob/dev/LICENSE
* @link https://github.com/GeekQu
*/
namespace App\Controllers;
use App\Models\User;
use App\Services\Config;
use App\Utils\ConfRender;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Yaml\Exception\ParseException;
/**
* ConfController
*
* @category GeekQu
* @package App/Controllers/ConfController
* @author GeekQu <iloves@live.com>
* @license MIT https://github.com/GeekQu/ss-panel-v3-mod_Uim/blob/dev/LICENSE
* @link https://github.com/GeekQu
*/
class ConfController extends BaseController
{
/**
* YAML 转数组
*
* @param string $Content YAML 字符串
*
* @return string
*/
public static function YAML2Array($Content)
{
try {
return Yaml::parse($Content);
} catch (ParseException $exception) {
return printf('无法解析 YAML 字符串: %s', $exception->getMessage());
}
}
/**
* 从远端自定义配置文件生成 Surge 托管配置
*
* @param object $User 用户
* @param string $AllProxys Surge 格式的全部节点
* @param array $Nodes 全部节点数组
* @param string $SourceContent 远程配置内容
*
* @return string
*/
public static function getSurgeConfs($User, $AllProxys, $Nodes, $Configs, $local = false)
{
$General = self::getSurgeConfGeneral($Configs['General']);
$Proxys = (isset($Configs['Proxy'])
? self::getSurgeConfProxy($Configs['Proxy'])
: '');
if (isset($Configs['Proxy Group'])) {
$Configs['ProxyGroup'] = $Configs['Proxy Group'];
}
$ProxyGroups = self::getSurgeConfProxyGroup(
$Nodes,
$Configs['ProxyGroup']
);
$ProxyGroup = self::getSurgeProxyGroup2String($ProxyGroups);
$Rule = self::getSurgeConfRule($Configs['Rule'], $local);
$Conf = '#!MANAGED-CONFIG '
. Config::get('baseUrl') . $_SERVER['REQUEST_URI'] .
"\n\n#---------------------------------------------------#" .
"\n## 上次更新于:" . date("Y-m-d h:i:s") .
"\n#---------------------------------------------------#" .
"\n\n[General]"
. $General .
"\n\n[Proxy]\n"
. $AllProxys . $Proxys .
"\n\n[Proxy Group]"
. $ProxyGroup .
"\n\n[Rule]\n"
. $Rule;
return $Conf;
}
/**
* Surge 配置中的 General
*
* @param array $General Surge General 定义
*
* @return string
*/
public static function getSurgeConfGeneral($General)
{
$return = '';
if (count($General) != 0) {
foreach ($General as $key => $value) {
$return .= "\n$key = $value";
}
}
return $return;
}
/**
* Surge 配置中的 Proxy
*
* @param array $Proxys 自定义配置中的额外 Proxy
*
* @return string
*/
public static function getSurgeConfProxy($Proxys)
{
$return = '';
if (count($Proxys) != 0) {
foreach ($Proxys as $value) {
if (!preg_match('/(\[General|Replica|Proxy|Proxy\sGroup|Rule|Host|URL\sRewrite|Header\sRewrite|MITM|Script\])/', $value)) {
$return .= "\n$value";
}
}
}
return $return;
}
/**
* Surge 配置中的 ProxyGroup
*
* @param array $Nodes 全部节点数组
* @param array $ProxyGroups Surge 策略组定义
*
* @return array
*/
public static function getSurgeConfProxyGroup($Nodes, $ProxyGroups)
{
$return = [];
foreach ($ProxyGroups as $ProxyGroup) {
if (in_array($ProxyGroup['type'], ['select', 'url-test', 'fallback'])) {
$proxies = [];
if (
isset($ProxyGroup['content']['left-proxies'])
&& count($ProxyGroup['content']['left-proxies']) != 0
) {
$proxies = $ProxyGroup['content']['left-proxies'];
}
foreach ($Nodes as $item) {
$item = self::getMatchProxy($item, $ProxyGroup);
if ($item !== null && !in_array($item['remark'], $proxies)) {
$proxies[] = $item['remark'];
}
}
if (isset($ProxyGroup['content']['right-proxies'])) {
$proxies = array_merge($proxies, $ProxyGroup['content']['right-proxies']);
}
$ProxyGroup['proxies'] = $proxies;
}
$return[] = $ProxyGroup;
}
return $return;
}
/**
* 获取匹配的节点
*
* @param array $Proxy 节点
* @param array $Rule 匹配规则
*
* @return array
*/
public static function getMatchProxy($Proxy, $Rule)
{
$return = null;
switch (true) {
case (isset($Rule['content']['class'])):
if (in_array($Proxy['class'], $Rule['content']['class'])) {
if (isset($Rule['content']['regex'])) {
if (preg_match('/' . $Rule['content']['regex'] . '/i', $Proxy['remark'])) {
$return = $Proxy;
}
} else {
$return = $Proxy;
}
}
break;
case (isset($Rule['content']['noclass'])):
if (!in_array($Proxy['class'], $Rule['content']['noclass'])) {
if (isset($Rule['content']['regex'])) {
if (preg_match('/' . $Rule['content']['regex'] . '/i', $Proxy['remark'])) {
$return = $Proxy;
}
} else {
$return = $Proxy;
}
}
break;
case (!isset($Rule['content']['class'])
&& !isset($Rule['content']['noclass'])
&& isset($Rule['content']['regex'])
&& preg_match('/' . $Rule['content']['regex'] . '/i', $Proxy['remark'])
):
$return = $Proxy;
break;
}
return $return;
}
/**
* Surge ProxyGroup 去除无用策略组
*
* @param array $ProxyGroups 策略组
* @param array $checks 要检查的策略组名
*
* @return array
*/
public static function fixSurgeProxyGroup($ProxyGroups, $checks)
{
if (count($checks) == 0) {
return $ProxyGroups;
}
$clean_names = [];
$newProxyGroups = [];
foreach ($ProxyGroups as $ProxyGroup) {
if (in_array($ProxyGroup['name'], $checks) && count($ProxyGroup['proxies']) == 0) {
$clean_names[] = $ProxyGroup['name'];
continue;
}
$newProxyGroups[] = $ProxyGroup;
}
if (count($clean_names) >= 1) {
$ProxyGroups = $newProxyGroups;
$newProxyGroups = [];
foreach ($ProxyGroups as $ProxyGroup) {
if (!in_array($ProxyGroup['name'], $checks) && $ProxyGroup['type'] != 'ssid') {
$newProxies = [];
foreach ($ProxyGroup['proxies'] as $proxie) {
if (!in_array($proxie, $clean_names)) {
$newProxies[] = $proxie;
}
}
$ProxyGroup['proxies'] = $newProxies;
}
$newProxyGroups[] = $ProxyGroup;
}
}
return $newProxyGroups;
}
/**
* Surge ProxyGroup 转字符串
*
* @param array $ProxyGroups Surge 策略组定义
*
* @return string
*/
public static function getSurgeProxyGroup2String($ProxyGroups)
{
$return = '';
foreach ($ProxyGroups as $ProxyGroup) {
$str = '';
if (in_array($ProxyGroup['type'], ['select', 'url-test', 'fallback'])) {
$proxies = implode(', ', $ProxyGroup['proxies']);
if (in_array($ProxyGroup['type'], ['url-test', 'fallback'])) {
$str .= ($ProxyGroup['name']
. ' = '
. $ProxyGroup['type']
. ', '
. $proxies
. ', url = ' . $ProxyGroup['url']
. ', interval = ' . $ProxyGroup['interval']);
} else {
$str .= ($ProxyGroup['name']
. ' = '
. $ProxyGroup['type']
. ', '
. $proxies);
}
} elseif ($ProxyGroup['type'] == 'ssid') {
$wifi = '';
foreach ($ProxyGroup['content'] as $key => $value) {
$wifi .= ', "' . $key . '" = ' . $value;
}
$cellular = (isset($ProxyGroup['cellular'])
? ', cellular = ' . $ProxyGroup['cellular']
: '');
$str .= ($ProxyGroup['name']
. ' = '
. $ProxyGroup['type']
. ', default = '
. $ProxyGroup['default']
. $cellular
. $wifi);
} else {
$str .= '';
}
$return .= "\n$str";
}
return $return;
}
/**
* Surge 配置中的 Rule
*
* @param array $Rules Surge 规则加载地址
*
* @return string
*/
public static function getSurgeConfRule($Rules, $local)
{
// 加载本地规则文件
if ($local) {
$render = ConfRender::getTemplateRender();
return $render->fetch(trim($Rules['source']));
}
// 加载远程规则文件
$return = '';
if (isset($Rules['source']) && $Rules['source'] != '') {
$sourceURL = trim($Rules['source']);
// 远程规则仅支持 github 以及 gitlab
if (preg_match('/^https:\/\/((gist\.)?github\.com|raw\.githubusercontent\.com|gitlab\.com)/i', $sourceURL)) {
$return = @file_get_contents($sourceURL);
if (!$return) {
$return = ('// 远程规则加载失败'
. PHP_EOL
. 'GEOIP,CN,DIRECT'
. PHP_EOL
. 'FINAL,DIRECT,dns-failed');
}
} else {
$return = ('// 远程规则仅支持 github 以及 gitlab'
. PHP_EOL
. 'GEOIP,CN,DIRECT'
. PHP_EOL
. 'FINAL,DIRECT,dns-failed');
}
}
return $return;
}
/**
* 从远端自定义配置文件生成 Clash 配置
*
* @param object $User 用户
* @param array $AllProxys 全部节点数组
* @param string $SourceContent 远程配置内容
*
* @return string
*/
public static function getClashConfs($User, $AllProxys, $Configs, $local = false)
{
$confStr = [
'Proxy' => 'proxies',
'ProxyGroup' => 'proxy-groups',
];
if (isset($_GET['newconf']) && (int) $_GET['newconf'] == 0) {
$confStr = [
'Proxy' => 'Proxy',
'ProxyGroup' => 'Proxy Group',
];
}
if (isset($Configs['Proxy']) || count($Configs['Proxy']) != 0) {
$tmpProxys = array_merge($AllProxys, $Configs['Proxy']);
} else {
$tmpProxys = $AllProxys;
}
$Proxys = [];
foreach ($tmpProxys as $Proxy) {
unset($Proxy['class']);
$Proxys[] = $Proxy;
}
$tmp = self::getClashConfGeneral($Configs['General']);
$tmp[$confStr['Proxy']] = $Proxys;
if (isset($Configs['ProxyGroup'])) {
$tmp[$confStr['ProxyGroup']] = self::getClashConfProxyGroup(
$AllProxys,
$Configs['ProxyGroup']
);
} else {
$tmp[$confStr['ProxyGroup']] = self::getClashConfProxyGroup(
$AllProxys,
$Configs['Proxy Group']
);
}
$Conf = '#!MANAGED-CONFIG '
. Config::get('baseUrl') . $_SERVER['REQUEST_URI'] .
"\n\n#---------------------------------------------------#" .
"\n## 上次更新于:" . date("Y-m-d h:i:s") .
"\n#---------------------------------------------------#" .
"\n\n"
. Yaml::dump($tmp, 4, 2) .
"\n\n"
. self::getClashConfRule($Configs['Rule'], $local);
return $Conf;
}
/**
* Clash 配置中的 General
*
* @param array $General Clash General 定义
*
* @return array
*/
public static function getClashConfGeneral($General)
{
if (count($General) != 0) {
foreach ($General as $key) {
if (in_array(
$key,
[
'Proxy',
'Proxy Group',
'Rule'
]
)) {
unset($key);
}
}
}
return $General;
}
/**
* Clash 配置中的 ProxyGroup
*
* @param array $Nodes 全部节点数组
* @param array $ProxyGroups Clash 策略组定义
*
* @return array
*/
public static function getClashConfProxyGroup($Nodes, $ProxyGroups)
{
$return = [];
foreach ($ProxyGroups as $ProxyGroup) {
$tmp = [];
if (in_array($ProxyGroup['type'], ['select', 'url-test', 'fallback', 'load-balance'])) {
$proxies = [];
if (
isset($ProxyGroup['content']['left-proxies'])
&& count($ProxyGroup['content']['left-proxies']) != 0
) {
$proxies = $ProxyGroup['content']['left-proxies'];
}
foreach ($Nodes as $item) {
$item['remark'] = $item['name'];
$item = self::getMatchProxy($item, $ProxyGroup);
if ($item !== null && !in_array($item['name'], $proxies)) {
$proxies[] = $item['name'];
}
}
if (isset($ProxyGroup['content']['right-proxies'])) {
$proxies = array_merge($proxies, $ProxyGroup['content']['right-proxies']);
}
$tmp = [
'name' => $ProxyGroup['name'],
'type' => $ProxyGroup['type'],
'proxies' => $proxies
];
if ($ProxyGroup['type'] != 'select') {
$tmp['url'] = $ProxyGroup['url'];
$tmp['interval'] = $ProxyGroup['interval'];
}
$return[] = $tmp;
}
}
return $return;
}
/**
* Clash 配置中的 Rule
*
* @param array $Rules Clash 规则加载地址
*
* @return string
*/
public static function getClashConfRule($Rules, $local)
{
$confStr = 'rules';
if (isset($_GET['newconf']) && (int) $_GET['newconf'] == 0) {
$confStr = 'Rule';
}
$return = ($confStr . ':' . PHP_EOL);
// 加载本地规则文件
if ($local) {
$render = ConfRender::getTemplateRender();
return $return . $render->fetch(trim($Rules['source']));
}
// 加载远程规则文件
if (isset($Rules['source']) && $Rules['source'] != '') {
$sourceURL = trim($Rules['source']);
// 远程规则仅支持 github 以及 gitlab
if (preg_match('/^https:\/\/((gist\.)?github\.com|raw\.githubusercontent\.com|gitlab\.com)/i', $sourceURL)) {
$sourceContent = @file_get_contents($sourceURL);
if (!$sourceContent) {
$return .= ('// 远程规则加载失败'
. PHP_EOL
. 'GEOIP,CN,DIRECT'
. PHP_EOL
. 'MATCH,DIRECT');
} else {
try {
$sourceRule = Yaml::parse($sourceContent);
} catch (ParseException $exception) {
$sourceRule['error'] = printf('无法解析 YAML 字符串: %s', $exception->getMessage());
}
if (isset($sourceRule['error']) || !isset($sourceRule[$confStr])) {
$return .= $sourceContent;
} else {
$return .= Yaml::dump($sourceRule[$confStr], 4, 2);
}
}
} else {
$return .= ('// 远程规则仅支持 github 以及 gitlab'
. PHP_EOL
. 'GEOIP,CN,DIRECT'
. PHP_EOL
. 'MATCH,DIRECT');
}
}
return $return;
}
/**
* Clash ProxyGroup 去除无用策略组
*
* @param array $ProxyGroups 策略组
* @param array $checks 要检查的策略组名
*
* @return array
*/
public static function fixClashProxyGroup($ProxyGroups, $checks)
{
if (count($checks) == 0) {
return $ProxyGroups;
}
$clean_names = [];
$newProxyGroups = [];
foreach ($ProxyGroups as $ProxyGroup) {
if (in_array($ProxyGroup['name'], $checks) && count($ProxyGroup['proxies']) == 0) {
$clean_names[] = $ProxyGroup['name'];
continue;
}
$newProxyGroups[] = $ProxyGroup;
}
if (count($clean_names) >= 1) {
$ProxyGroups = $newProxyGroups;
$newProxyGroups = [];
foreach ($ProxyGroups as $ProxyGroup) {
if (!in_array($ProxyGroup['name'], $checks)) {
$newProxies = [];
foreach ($ProxyGroup['proxies'] as $proxie) {
if (!in_array($proxie, $clean_names)) {
$newProxies[] = $proxie;
}
}
$ProxyGroup['proxies'] = $newProxies;
}
$newProxyGroups[] = $ProxyGroup;
}
}
return $newProxyGroups;
}
/**
* Clash ProxyGroup 转字符串
*
* @param array $ProxyGroups ProxyGroup
*
* @return string
*/
public static function getClashProxyGroup2String($ProxyGroups)
{
return Yaml::dump($ProxyGroups, 4, 2);
}
// 待续 Quantumult...
}

@ -3,123 +3,361 @@
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\Services\MalioConfig;
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 App\Utils\Tools;
use App\Services\Internationalization;
use App\Utils\Telegram\Process;
use Slim\Http\{Request, Response};
use Psr\Http\Message\ResponseInterface;
/**
* HomeController
*/
class HomeController extends BaseController
{
public function index()
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function index($request, $response, $args): ResponseInterface
{
return $this->view()->display('index.tpl');
$GtSdk = null;
$recaptcha_sitekey = null;
if (Config::get('captcha_provider') != '') {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
$uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
break;
}
}
if (Config::get('enable_telegram') == true) {
$login_text = TelegramSessionManager::add_login_session();
$login = explode('|', $login_text);
$login_token = $login[0];
$login_number = $login[1];
} else {
$login_token = '';
$login_number = '';
}
if (Config::get('newIndex') === false && Config::get('theme') == 'material') {
return $response->write($this->view()->fetch('indexold.tpl'));
} else {
if (!Auth::getUser()->isLogin) {
$i18n = new Internationalization();
if (MalioConfig::get('only_one_lang') != 'none') {
$i18n->lang = MalioConfig::get('only_one_lang');
} else {
$i18n->detectLang($request, $response, $args);
}
return $response->write($this->view()
->assign('i18n', $i18n)
->assign('geetest_html', $GtSdk)
->assign('login_token', $login_token)
->assign('login_number', $login_number)
->assign('telegram_bot', Config::get('telegram_bot'))
->assign('enable_logincaptcha', Config::get('enable_login_captcha'))
->assign('enable_regcaptcha', Config::get('enable_reg_captcha'))
->assign('base_url', Config::get('baseUrl'))
->assign('recaptcha_sitekey', $recaptcha_sitekey)
->display('index.tpl'));
} else {
return $response->write($this->view()
->assign('geetest_html', $GtSdk)
->assign('login_token', $login_token)
->assign('login_number', $login_number)
->assign('telegram_bot', Config::get('telegram_bot'))
->assign('enable_logincaptcha', Config::get('enable_login_captcha'))
->assign('enable_regcaptcha', Config::get('enable_reg_captcha'))
->assign('base_url', Config::get('baseUrl'))
->assign('recaptcha_sitekey', $recaptcha_sitekey)
->display('index.tpl')
);
}
}
}
public function code()
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function indexold($request, $response, $args): ResponseInterface
{
$codes = InviteCode::where('user_id', '=', '0')->take(10)->get();
return $this->view()->assign('codes', $codes)->display('code.tpl');
return $response->write($this->view()->fetch('indexold.tpl'));
}
public function down()
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function code($request, $response, $args): ResponseInterface
{
$codes = InviteCode::where('user_id', '=', '0')->take(10)->get();
return $response->write($this->view()->assign('codes', $codes)->fetch('code.tpl'));
}
public function tos()
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function tos($request, $response, $args): ResponseInterface
{
return $this->view()->display('tos.tpl');
return $response->write($this->view()->fetch('tos.tpl'));
}
public function staff()
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function staff($request, $response, $args): ResponseInterface
{
return $this->view()->display('staff.tpl');
return $response->write($this->view()->fetch('staff.tpl'));
}
public function telegram($request, $response, $args)
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function telegram($request, $response, $args): ResponseInterface
{
$token = "";
if (isset($request->getQueryParams()["token"])) {
$token = $request->getQueryParams()["token"];
}
$token = $request->getQueryParam('token');
if ($token == Config::get('telegram_request_token')) {
TelegramProcess::process();
$result = '1';
} else {
echo("不正确请求!");
$result = '0';
}
return $response->write($result);
}
public function page404($request, $response, $args)
{
return $this->view()->display('404.tpl');
}
public function page405($request, $response, $args)
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function NewTelegram($request, $response, $args): ResponseInterface
{
return $this->view()->display('405.tpl');
$token = $request->getQueryParam('token');
if ($token == Config::get('telegram_request_token')) {
Process::index();
$result = '1';
} else {
$result = '0';
}
return $response->write($result);
}
public function page500($request, $response, $args)
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function page404($request, $response, $args): ResponseInterface
{
return $this->view()->display('500.tpl');
return $response->write($this->view()->fetch('404.tpl'));
}
//@todo: Will be abandoned in future.
public function codepay_callback($request, $response, $args)
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function page405($request, $response, $args): ResponseInterface
{
echo '
<script>
window.location.href="/user/code";
</script>
';
return;
return $response->write($this->view()->fetch('405.tpl'));
}
//@todo: Will be abandoned in future.
public function pay_callback($request, $response, $args)
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function page500($request, $response, $args): ResponseInterface
{
Pay::callback($request);
return $response->write($this->view()->fetch('500.tpl'));
}
public function getOrderList($request, $response, $args)
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function getOrderList($request, $response, $args): ResponseInterface
{
$key = $request->getParam('key');
if (!$key || $key != Config::get('key')) {
$res['ret'] = 0;
$res['msg'] = "错误";
return $response->getBody()->write(json_encode($res));
$res['msg'] = '错误';
return $response->write(json_encode($res));
}
return $response->getBody()->write(json_encode(['data' => AliPay::getList()]));
return $response->write(json_encode(['data' => AliPay::getList()]));
}
public function setOrder($request, $response, $args)
/**
* @param Request $request
* @param Response $response
* @param array $args
*/
public function setOrder($request, $response, $args): ResponseInterface
{
$key = $request->getParam('key');
$sn = $request->getParam('sn');
$url = $request->getParam('url');
if (!$key || $key != Config::get('key')) {
$res['ret'] = 0;
$res['msg'] = "错误";
return $response->getBody()->write(json_encode($res));
$res['msg'] = '错误';
return $response->write(json_encode($res));
}
return $response->write(json_encode(['res' => AliPay::setOrder($sn, $url)]));
}
public function getDocCenter($request, $response, $args)
{
$user = Auth::getUser();
if (!$user->isLogin && Config::get('enable_documents') === false) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/');
return $newResponse;
}
$basePath = Config::get('remote_documents') === true ? Config::get('documents_source') : '/docs/GeekQu';
return $this->view()
->assign('appName', Config::get('documents_name'))
->assign('basePath', $basePath)
->fetch('doc/index.tpl');
}
public function getSubLink($request, $response, $args)
{
$type = trim($request->getParam('type'));
$user = Auth::getUser();
if (!$user->isLogin) {
return $msg = '!> ₍₍ ◝(・ω・)◟ ⁾⁾ 您没有登录噢,[点击此处登录](/auth/login \':ignore target=_blank\') 之后再刷新就阔以了啦';
} else {
$subInfo = LinkController::getSubinfo($user, 0);
switch ($type) {
case 'ssr':
$msg = [
'**订阅链接:**',
'```',
$subInfo['ssr'],
'```'
];
break;
case 'v2ray':
$msg = [
'**订阅链接:**',
'```',
$subInfo['v2ray'],
'```'
];
break;
case 'ssd':
$msg = [
'**订阅链接:**',
'```',
$subInfo['ssd'],
'```'
];
break;
case 'clash':
$msg = [
'**订阅链接:**[[点击下载配置]](' . $subInfo['clash'] . ')',
'```',
$subInfo['clash'],
'```'
];
break;
case 'surge':
$msg = [
'**Surge Version 2.x 托管配置链接:**[[iOS 点击此处一键添加]](surge:///install-config?url=' . urlencode($subInfo['surge2']) . ')',
'```',
$subInfo['surge2'],
'```',
'**Surge Version 3.x 托管配置链接:**[[iOS 点击此处一键添加]](surge3:///install-config?url=' . urlencode($subInfo['surge3']) . ')',
'```',
$subInfo['surge3'],
'```'
];
break;
case 'kitsunebi':
$msg = [
'**包含 ss、v2ray 的合并订阅链接:**',
'```',
$subInfo['kitsunebi'],
'```'
];
break;
case 'surfboard':
$msg = [
'**托管配置链接:**',
'```',
$subInfo['surfboard'],
'```'
];
break;
case 'quantumult_sub':
$msg = [
'**ssr 订阅链接:**[[iOS 点击此处一键添加]](quantumult://configuration?server=' . Tools::base64_url_encode($subInfo['ssr']) . ')',
'```',
$subInfo['ssr'],
'```',
'**V2ray 订阅链接:**[[iOS 点击此处一键添加]](quantumult://configuration?server=' . Tools::base64_url_encode($subInfo['quantumult_v2']) . ')',
'```',
$subInfo['quantumult_v2'],
'```'
];
break;
case 'quantumult_conf':
$msg = [
'**导入 ss、ssr、v2ray 以及分流规则的配置链接:**',
'```',
$subInfo['quantumult_sub'],
'```',
'**导入类似 Surge、Clash 使用自定义策略组的配置链接:**',
'```',
$subInfo['quantumult_conf'],
'```'
];
break;
case 'shadowrocket':
$msg = [
'**包含 ss、ssr、v2ray 的合并订阅链接:**[[iOS 点击此处一键添加]](sub://' . base64_encode($subInfo['shadowrocket']) . ')',
'```',
$subInfo['shadowrocket'],
'```'
];
break;
default:
if (in_array($type, $subInfo)) {
$msg = [
'```',
$subInfo[$type],
'```'
];
} else {
$msg = [
'获取失败了呢...,请联系管理员。'
];
}
break;
}
}
return $response->getBody()->write(json_encode(['res' => AliPay::setOrder($sn, $url)]));
return implode(PHP_EOL, $msg);
}
}

File diff suppressed because it is too large Load Diff

@ -9,16 +9,18 @@ use App\Models\UnblockIp;
use App\Models\Speedtest;
use App\Models\Node;
use App\Models\Auto;
use App\Models\User;
use App\Controllers\BaseController;
use App\Utils\Tools;
use App\Services\Config;
class FuncController extends BaseController
{
public function ping($request, $response, $args)
{
$res = [
"ret" => 1,
"data" => 'pong'
'ret' => 1,
'data' => 'pong'
];
return $this->echoJson($response, $res);
}
@ -28,26 +30,62 @@ class FuncController extends BaseController
$rules = DetectRule::all();
$res = [
"ret" => 1,
"data" => $rules
'ret' => 1,
'data' => $rules
];
return $this->echoJson($response, $res);
}
public function get_dis_node_info($nodeid)
{
$node = Node::where('id', $nodeid)->first();
if ($node == null) {
return null;
}
return $node;
}
public function get_relay_rules($request, $response, $args)
{
$params = $request->getQueryParams();
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
} else {
$node = Node::where('id', $node_id)->first();
}
$rules = Relay::Where('source_node_id', $node_id)->get();
if (count($rules) > 0) {
if ($rules[0]['dist_node_id'] == -1) {
$server = null;
}
foreach ($rules as $rule) {
$dis = $this->get_dis_node_info($rule['dist_node_id']);
if ($dis != null) {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = $dis->sort;
$rule['dist_node_server'] = $dis->server;
} else {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = null;
$rule['dist_node_server'] = null;
}
}
$res = [
'ret' => 1,
'data' => $rules,
];
} else {
$res = [
'ret' => 1,
'data' => array(),
];
}
$res = [
"ret" => 1,
"data" => $rules
];
return $this->echoJson($response, $res);
}
@ -56,8 +94,8 @@ class FuncController extends BaseController
$block_ips = BlockIp::Where('datetime', '>', time() - 60)->get();
$res = [
"ret" => 1,
"data" => $block_ips
'ret' => 1,
'data' => $block_ips
];
return $this->echoJson($response, $res);
}
@ -67,8 +105,8 @@ class FuncController extends BaseController
$unblock_ips = UnblockIp::Where('datetime', '>', time() - 60)->get();
$res = [
"ret" => 1,
"data" => $unblock_ips
'ret' => 1,
'data' => $unblock_ips
];
return $this->echoJson($response, $res);
}
@ -79,14 +117,14 @@ class FuncController extends BaseController
$data = $request->getParam('data');
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
@ -110,8 +148,8 @@ class FuncController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -122,14 +160,14 @@ class FuncController extends BaseController
$data = $request->getParam('data');
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
@ -156,8 +194,8 @@ class FuncController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -167,14 +205,14 @@ class FuncController extends BaseController
$params = $request->getQueryParams();
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
@ -184,15 +222,15 @@ class FuncController extends BaseController
$autos = array();
foreach ($autos_raw as $auto_raw) {
$has_exec = Auto::where('sign', $node_id.'-'.$auto_raw->id)->where('type', '2')->first();
$has_exec = Auto::where('sign', $node_id . '-' . $auto_raw->id)->where('type', '2')->first();
if ($has_exec == null) {
array_push($autos, $auto_raw);
$autos[] = $auto_raw;
}
}
$res = [
"ret" => 1,
"data" => $autos,
'ret' => 1,
'data' => $autos,
];
return $this->echoJson($response, $res);
}
@ -203,14 +241,14 @@ class FuncController extends BaseController
$data = $request->getParam('data');
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
@ -228,8 +266,8 @@ class FuncController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}

@ -4,19 +4,19 @@
namespace App\Controllers\Mod_Mu;
use App\Controllers\BaseController;
use App\Models\NodeOnlineLog;
use App\Models\NodeInfoLog;
use App\Models\Node;
use App\Services\Config;
class NodeController extends BaseController
{
public function info($request, $response, $args)
{
$node_id = $args['id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$load = $request->getParam('load');
$uptime = $request->getParam('uptime');
$log = new NodeInfoLog();
@ -26,14 +26,14 @@ class NodeController extends BaseController
$log->log_time = time();
if (!$log->save()) {
$res = [
"ret" => 0,
"data" => "update failed",
'ret' => 0,
'data' => 'update failed',
];
return $this->echoJson($response, $res);
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -41,28 +41,45 @@ class NodeController extends BaseController
public function get_info($request, $response, $args)
{
$node_id = $args['id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id = $node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
if (in_array($node->sort, [0, 10])) {
$node_explode = explode(';', $node->server);
$node_server = $node_explode[0];
} else {
$node_server = $node->server;
}
// 0: new node; -1: offline; 1: online
$node_heartbeat = $node->node_heartbeat + 300;
$node_online = -1;
if ($node_heartbeat == 300) {
$node_online = 0;
} elseif ($node_heartbeat > time()) {
$node_online = 1;
}
$res = [
"ret" => 1,
"data" => [
"node_group" => $node->node_group,
"node_class" => $node->node_class,
"node_speedlimit" => $node->node_speedlimit,
"traffic_rate" => $node->traffic_rate,
"mu_only" => $node->mu_only,
"sort" => $node->sort,
"server" => $node->server,
"type" => "ss-panel-v3-mod_Uim"
'ret' => 1,
'data' => [
'node_group' => $node->node_group,
'node_class' => $node->node_class,
'node_speedlimit' => $node->node_speedlimit,
'traffic_rate' => $node->traffic_rate,
'mu_only' => $node->mu_only,
'sort' => $node->sort,
'server' => $node_server,
'type' => 'ss-panel-v3-mod_Uim',
'online' => $node_online
],
];
return $this->echoJson($response, $res);
@ -71,15 +88,50 @@ class NodeController extends BaseController
public function get_all_info($request, $response, $args)
{
$nodes = Node::where('node_ip', '<>', null)->where(
function ($query) {
$query->where("sort", "=", 0)
->orWhere("sort", "=", 10);
static function ($query) {
$query->where('sort', '=', 0)
->orWhere('sort', '=', 10)
->orWhere('sort', '=', 12)
->orWhere('sort', '=', 13);
}
)->get();
$res = [
"ret" => 1,
"data" => $nodes
'ret' => 1,
'data' => $nodes
];
return $this->echoJson($response, $res);
}
public function getConfig($request, $response, $args)
{
$data = $request->getParsedBody();
switch ($data['type']) {
case ('database'):
$db_config = Config::getDbConfig();
$db_config['host'] = $this->getServerIP();
$res = [
'ret' => 1,
'data' => $db_config,
];
break;
case ('webapi'):
$webapiConfig = [];
#todo
}
return $this->echoJson($response, $res);
}
private function getServerIP()
{
if (isset($_SERVER)) {
if ($_SERVER['SERVER_ADDR']) {
$serverIP = $_SERVER['SERVER_ADDR'];
} else {
$serverIP = $_SERVER['LOCAL_ADDR'];
}
} else {
$serverIP = getenv('SERVER_ADDR');
}
return $serverIP;
}
}

@ -8,9 +8,12 @@ use App\Models\User;
use App\Models\NodeOnlineLog;
use App\Models\Ip;
use App\Models\DetectLog;
use App\Models\DetectBanLog;
use App\Controllers\BaseController;
use App\Services\Config;
use App\Utils\Tools;
use Ramsey\Uuid\Uuid;
use App\Utils\URL;
use App\Services\MalioConfig;
class UserController extends BaseController
{
@ -20,75 +23,138 @@ class UserController extends BaseController
$params = $request->getQueryParams();
$node_id = $params['node_id'];
$node=new Node();
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
else{
$node = Node::where("id", "=", $node_id)->first();
if ($node == null) {
$res = [
"ret" => 0
];
return $this->echoJson($response, $res);
}
}
$node->node_heartbeat=time();
$node = new Node();
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
} else {
$node = Node::where('id', '=', $node_id)->first();
if ($node == null) {
$res = [
'ret' => 0
];
return $this->echoJson($response, $res);
}
}
$node->node_heartbeat = time();
$node->save();
if ($node->node_group!=0) {
$users_raw = User::where(
function ($query) use ($node){
// 节点流量耗尽则返回 null
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);
}
if (in_array($node->sort, [0, 10]) && $node->mu_only != -1) {
$mu_port_migration = Config::get('mu_port_migration');
} else {
$mu_port_migration = false;
}
/*
* 1. 请不要把管理员作为单端口承载用户
* 2. 请不要把真实用户作为单端口承载用户
*/
$users_raw = User::where(
static function ($query) use ($node, $mu_port_migration) {
if ($mu_port_migration === true) {
$query->where(
function ($query1) use ($node){
$query1->where("class", ">=", $node->node_class)
->where("node_group", "=", $node->node_group);
}
static function ($query1) use ($node) {
if ($node->node_group != 0) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group)
->where('is_multi_user', '=', 0)
->where('is_admin', 0);
} else {
$query1->where('class', '>=', $node->node_class)
->where('is_multi_user', '=', 0)
->where('is_admin', 0);
}
}
);
} else {
$query->where(
static function ($query1) use ($node) {
if ($node->node_group != 0) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group);
} else {
$query1->where('class', '>=', $node->node_class);
}
}
)->orwhere('is_admin', 1);
}
)
->where("enable", 1)->where("expire_in", ">", date("Y-m-d H:i:s"))->get();
} else {
$users_raw = User::where(
function ($query) use ($node){
}
)->where('enable', 1)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
// 单端口承载用户
if ($mu_port_migration === true) {
$mu_users_raw = User::where(
static function ($query) use ($node) {
$query->where(
function ($query1) use ($node){
$query1->where("class", ">=", $node->node_class);
}
static function ($query1) use ($node) {
if ($node->node_group != 0) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group)
->where('is_multi_user', '>', 0);
} else {
$query1->where('class', '>=', $node->node_class)
->where('is_multi_user', '>', 0);
}
}
)->orwhere('is_admin', 1);
}
)->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);
)->where('enable', 1)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
$muPort = Tools::get_MuOutPortArray($node->server);
if ($muPort['type'] == 0) {
foreach ($mu_users_raw as $user_raw) {
if ($user_raw->is_multi_user != 0 && in_array($user_raw->port, array_keys($muPort['port']))) {
$user_raw->port = $muPort['port'][$user_raw->port];
}
$users_raw[] = $user_raw;
}
} else {
foreach ($mu_users_raw as $user_raw) {
if ($user_raw->is_multi_user != 0) {
$user_raw->port = ($user_raw->port + $muPort['type']);
}
$users_raw[] = $user_raw;
}
}
}
$users = array();
$key_list = array('email', 'method', 'obfs', 'obfs_param', 'protocol', 'protocol_param',
'forbidden_ip', 'forbidden_port', 'node_speedlimit', 'disconnect_ip',
'is_multi_user', 'id', 'port', 'passwd', 'u', 'd');
'forbidden_ip', 'forbidden_port', 'node_speedlimit', 'disconnect_ip',
'is_multi_user', 'id', 'port', 'passwd', 'u', 'd', 'node_connector',
'sort', 'uuid', 'sha224uuid');
$users = array();
foreach ($users_raw as $user_raw) {
if ($node->sort == 14) {
$user_raw->sha224uuid = hash('sha224', $user_raw->uuid);
}
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
$user_raw->uuid = $user_raw->getUuid();
array_push($users, $user_raw);
$user_raw = Tools::keyFilter($user_raw, $key_list);
$users[] = $user_raw;
} else if (Config::get('keep_connect') === true) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
// 流量耗尽用户限速至 1Mbps
$user_raw->node_speedlimit = 1;
$users[] = $user_raw;
}
}
$res = [
"ret" => 1,
"data" => $users
'ret' => 1,
'data' => $users
];
return $this->echoJson($response, $res);
}
@ -101,15 +167,15 @@ class UserController extends BaseController
$data = $request->getParam('data');
$this_time_total_bandwidth = 0;
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
@ -122,7 +188,7 @@ class UserController extends BaseController
$user = User::find($user_id);
if($user == NULL) {
if ($user == null) {
continue;
}
@ -132,8 +198,8 @@ class UserController extends BaseController
$this_time_total_bandwidth += $u + $d;
if (!$user->save()) {
$res = [
"ret" => 0,
"data" => "update failed",
'ret' => 0,
'data' => 'update failed',
];
return $this->echoJson($response, $res);
}
@ -161,8 +227,8 @@ class UserController extends BaseController
$online_log->save();
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -173,15 +239,15 @@ class UserController extends BaseController
$data = $request->getParam('data');
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
@ -201,8 +267,8 @@ class UserController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -213,15 +279,15 @@ class UserController extends BaseController
$data = $request->getParam('data');
$node_id = $params['node_id'];
if($node_id=='0'){
$node = Node::where("node_ip",$_SERVER["REMOTE_ADDR"])->first();
$node_id=$node->id;
}
if ($node_id == '0') {
$node = Node::where('node_ip', $_SERVER['REMOTE_ADDR'])->first();
$node_id = $node->id;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
"ret" => 0
'ret' => 0
];
return $this->echoJson($response, $res);
}
@ -242,8 +308,8 @@ class UserController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}

@ -1,57 +0,0 @@
<?php
namespace App\Controllers\Mu;
use App\Controllers\BaseController;
use App\Models\NodeOnlineLog;
use App\Models\NodeInfoLog;
class NodeController extends BaseController
{
public function onlineUserLog($request, $response, $args)
{
$node_id = $args['id'];
$count = $request->getParam('count');
$log = new NodeOnlineLog();
$log->node_id = $node_id;
$log->online_user = $count;
$log->log_time = time();
if (!$log->save()) {
$res = [
"ret" => 0,
"msg" => "update failed",
];
return $this->echoJson($response, $res);
}
$res = [
"ret" => 1,
"msg" => "ok",
];
return $this->echoJson($response, $res);
}
public function info($request, $response, $args)
{
$node_id = $args['id'];
$load = $request->getParam('load');
$uptime = $request->getParam('uptime');
$log = new NodeInfoLog();
$log->node_id = $node_id;
$log->load = $load;
$log->uptime = $uptime;
$log->log_time = time();
if (!$log->save()) {
$res = [
"ret" => 0,
"msg" => "update failed",
];
return $this->echoJson($response, $res);
}
$res = [
"ret" => 1,
"msg" => "ok",
];
return $this->echoJson($response, $res);
}
}

@ -1,124 +0,0 @@
<?php
namespace App\Controllers\Mu;
use App\Models\Node;
use App\Models\TrafficLog;
use App\Models\User;
use App\Controllers\BaseController;
use App\Utils\Tools;
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);
}
)->first();
$node->node_heartbeat=time();
$node->save();
if ($node->node_group!=0) {
$users_raw = User::where(
function ($query) use ($node){
$query->where(
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();
} else {
$users_raw = User::where(
function ($query) use ($node){
$query->where(
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();
}
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);
}
}
$key_list = array('method', 'id', 'port', 'passwd', 'u', 'd', 'enable',
't', 'transfer_enable', 'switch', 'email');
$users_output = array();
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);
}
}
$res = [
"ret" => 1,
"msg" => "ok",
"data" => $users_output
];
return $this->echoJson($response, $res);
}
// Update Traffic
public function addTraffic($request, $response, $args)
{
$id = $args['id'];
$u = $request->getParam('u');
$d = $request->getParam('d');
$nodeId = $request->getParam('node_id');
$node = Node::find($nodeId);
$node->node_bandwidth=$node->node_bandwidth+$d+$u;
$node->save();
$rate = $node->traffic_rate;
$user = User::find($id);
$user->t = time();
$user->u = $user->u + ($u * $rate);
$user->d = $user->d + ($d * $rate);
if (!$user->save()) {
$res = [
"ret" => 0,
"msg" => "update failed",
];
//return $this->echoJson($response, $res);
}
// log
$traffic = new TrafficLog();
$traffic->user_id = $id;
$traffic->u = $u;
$traffic->d = $d;
$traffic->node_id = $nodeId;
$traffic->rate = $rate;
$traffic->traffic = Tools::flowAutoShow(($u + $d) * $rate);
$traffic->log_time = time();
$traffic->save();
$res = [
"ret" => 1,
"msg" => "ok",
];
return $this->echoJson($response, $res);
}
}

@ -12,7 +12,6 @@ use App\Utils\Hash;
* @package App\Controllers
* 密码重置
*/
class PasswordController extends BaseController
{
public function reset()
@ -22,7 +21,7 @@ class PasswordController extends BaseController
public function handleReset($request, $response, $args)
{
$email = $request->getParam('email');
$email = $request->getParam('email');
// check limit
// send email
@ -32,9 +31,12 @@ class PasswordController extends BaseController
$rs['msg'] = '此邮箱不存在.';
return $response->getBody()->write(json_encode($rs));
}
Password::sendResetEmail($email);
$rs['ret'] = 1;
$rs['msg'] = '重置邮件已经发送,请检查邮箱.';
if (Password::sendResetEmail($email)) {
$res['msg'] = '邮件发送失败,请联系网站管理员。';
}
return $response->getBody()->write(json_encode($rs));
}
@ -47,23 +49,23 @@ class PasswordController extends BaseController
public function handleToken($request, $response, $args)
{
$tokenStr = $args['token'];
$password = $request->getParam('password');
$repasswd = $request->getParam('repasswd');
$password = $request->getParam('password');
$repasswd = $request->getParam('repasswd');
if ($password != $repasswd) {
$res['ret'] = 0;
$res['msg'] = "两次输入不符合";
$res['msg'] = '两次输入不符合';
return $response->getBody()->write(json_encode($res));
}
if (strlen($password) < 8) {
$res['ret'] = 0;
$res['msg'] = "密码太短啦";
$res['msg'] = '密码太短啦';
return $response->getBody()->write(json_encode($res));
}
// check token
$token = PasswordReset::where('token', $tokenStr)->first();
$token = PasswordReset::where('token', $tokenStr)->orderBy('id', 'desc')->first();
if ($token == null || $token->expire_time < time()) {
$rs['ret'] = 0;
$rs['msg'] = '链接已经失效,请重新获取';
@ -88,9 +90,9 @@ class PasswordController extends BaseController
}
$rs['ret'] = 1;
$rs['msg'] = '重置成功';
$user->clean_link();
return $response->getBody()->write(json_encode($rs));
}
}

@ -6,9 +6,9 @@ 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;
class RelayController extends UserController
{
@ -16,8 +16,8 @@ class RelayController extends UserController
{
$pageNum = 1;
$user = Auth::getUser();
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
if (isset($request->getQueryParams()['page'])) {
$pageNum = $request->getQueryParams()['page'];
}
$logs = Relay::where('user_id', $user->id)->orwhere('user_id', 0)->paginate(15, ['*'], 'page', $pageNum);
$logs->setPath('/user/relay');
@ -27,19 +27,24 @@ class RelayController extends UserController
//链路表部分
$nodes = Node::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("sort", "=", 10)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('type', 1)->where(
static function ($query) {
$query->Where('sort', 10)
->orWhere('sort', 12);
}
)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$pathset = new \ArrayObject();
$pathset = new ArrayObject();
$relay_rules = Relay::where('user_id', $user->id)->orwhere('user_id', 0)->get();
$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);
$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();
@ -81,11 +86,11 @@ class RelayController extends UserController
if ($single_path->end_node->id == $path->begin_node->id) {
$path->begin_node = $single_path->begin_node;
if ($path->begin_node->isNodeAccessable() == false) {
$path->path = '<font color="#FF0000">'.$single_path->begin_node->name.'</font>'." → ".$path->path;
$path->status = "阻断";
$path->path = '' . $single_path->begin_node->name . '' . ' <i class="fas fa-long-arrow-alt-right"></i> ' . $path->path;
$path->status = '阻断';
} else {
$path->path = $single_path->begin_node->name." → ".$path->path;
$path->status = "通畅";
$path->path = $single_path->begin_node->name . ' <i class="fas fa-long-arrow-alt-right"></i> ' . $path->path;
$path->status = '通畅';
}
$pathset->offsetUnset($index);
@ -95,10 +100,10 @@ class RelayController extends UserController
if ($path->end_node->id == $single_path->begin_node->id) {
$path->end_node = $single_path->end_node;
if ($single_path->end_node->isNodeAccessable() == false) {
$path->path = $path->path." → ".'<font color="#FF0000">'.$single_path->end_node->name.'</font>';
$path->status = "阻断";
$path->path = $path->path . ' <i class="fas fa-long-arrow-alt-right"></i> ' . '' . $single_path->end_node->name . '';
$path->status = '阻断';
} else {
$path->path = $path->path." → ".$single_path->end_node->name;
$path->path = $path->path . ' <i class="fas fa-long-arrow-alt-right"></i> ' . $single_path->end_node->name;
}
$pathset->offsetUnset($index);
@ -115,41 +120,45 @@ class RelayController extends UserController
{
$user = Auth::getUser();
$source_nodes = Node::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(
static function ($query) {
$query->Where('sort', 10);
}
)->where('type', 1)->where('sort', 10)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$dist_nodes = Node::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(
function ($query) {
static function ($query) {
$query->Where('sort', 0)
->orWhere('sort', 10);
}
)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$ports_raw = Node::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('sort', 9)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('type', 1)->where('sort', 9)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$ports = array();
foreach ($ports_raw as $port_raw) {
$mu_user = User::where('port', $port_raw->server)->first();
if ($mu_user->is_multi_user == 1) {
array_push($ports, $port_raw->server);
$ports[] = $port_raw->server;
}
}
array_push($ports, $user->port);
$ports[] = $user->port;
$ports = array_unique($ports);
return $this->view()->assign('source_nodes', $source_nodes)->assign('dist_nodes', $dist_nodes)->assign('ports', $ports)->display('user/relay/add.tpl');
}
@ -163,51 +172,65 @@ class RelayController extends UserController
$priority = $request->getParam('priority');
$source_node = Node::where('id', $source_node_id)->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('sort', 10)->where("node_class", "<=", $user->class)->first();
)->where('type', 1)->where(
static function ($query) {
$query->Where('sort', 10);
}
)->where('node_class', '<=', $user->class)->first();
if ($source_node == null) {
$rs['ret'] = 0;
$rs['msg'] = "美国的华莱士";
$rs['msg'] = '起源节点错误';
return $response->getBody()->write(json_encode($rs));
}
if ($source_node->sort == 12) {
$rules = Relay::Where('source_node_id', $source_node_id)->get();
foreach ($rules as $rule) {
if ($rule['user_id'] == 0 || $rule['user_id'] = $user->id) {
$rs['ret'] = 0;
$rs['msg'] = 'v2ray中转一个起点一个rule';
return $response->getBody()->write(json_encode($rs));
}
}
}
$dist_node = Node::where('id', $dist_node_id)->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(
function ($query) {
static function ($query) {
$query->Where('sort', 0)
->orWhere('sort', 10);
->orWhere('sort', 10)
->orWhere('sort', 11);
}
)->where("node_class", "<=", $user->class)->first();
)->where('node_class', '<=', $user->class)->first();
if ($dist_node_id == -1) {
$dist_node = new Node();
$dist_node->id = -1;
$dist_node->node_ip = "0.0.0.0";
$dist_node->node_ip = '0.0.0.0';
$dist_node->sort = 10;
}
if ($dist_node == null) {
$rs['ret'] = 0;
$rs['msg'] = "不知道比你们高到哪里去了";
$rs['msg'] = '目标节点错误';
return $response->getBody()->write(json_encode($rs));
}
$port_raw = Node::where('server', $port)->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('sort', 9)->where("node_class", "<=", $user->class)->first();
if ($port_raw == null && $port != $user->port) {
)->where('type', 1)->where('sort', 9)->where('node_class', '<=', $user->class)->first();
if (($port_raw == null && $port != $user->port)) {
$rs['ret'] = 0;
$rs['msg'] = "我和他谈笑风生";
$rs['msg'] = '端口错误';
return $response->getBody()->write(json_encode($rs));
}
@ -232,21 +255,23 @@ class RelayController extends UserController
$maybe_rule_id = Tools::has_conflict_rule($rule, $ruleset, 0, $rule->source_node_id);
if ($maybe_rule_id != 0) {
$rs['ret'] = 0;
$rs['msg'] = "您即将添加的规则与规则 ID:".$maybe_rule_id." 冲突!";
$rs['msg'] = '您即将添加的规则与规则 ID:' . $maybe_rule_id . ' 冲突!';
if ($maybe_rule_id == -1) {
$rs['msg'] = "您即将添加的规则可能会造成冲突!";
$rs['msg'] = '您即将添加的规则可能会造成冲突!';
}
return $response->getBody()->write(json_encode($rs));
}
if (!$rule->save()) {
$rs['ret'] = 0;
$rs['msg'] = "添加失败";
$rs['msg'] = '添加失败';
return $response->getBody()->write(json_encode($rs));
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -263,41 +288,47 @@ class RelayController extends UserController
$user = Auth::getUser();
$source_nodes = Node::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(
static function ($query) {
$query->Where('sort', 10);
}
)->where('type', 1)->where('sort', 10)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$dist_nodes = Node::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(
function ($query) {
static function ($query) {
$query->Where('sort', 0)
->orWhere('sort', 10);
->orWhere('sort', 10)
->orWhere('sort', 11);
}
)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$ports_raw = Node::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('sort', 9)->where("node_class", "<=", $user->class)->orderBy('name')->get();
)->where('type', 1)->where('sort', 9)->where('node_class', '<=', $user->class)->orderBy('name')->get();
$ports = array();
foreach ($ports_raw as $port_raw) {
$mu_user = User::where('port', $port_raw->server)->first();
if ($mu_user->is_multi_user == 1) {
array_push($ports, $port_raw->server);
$ports[] = $port_raw->server;
}
}
array_push($ports, $user->port);
$ports[] = $user->port;
$ports = array_unique($ports);
return $this->view()->assign('rule', $rule)->assign('source_nodes', $source_nodes)->assign('dist_nodes', $dist_nodes)->assign('ports', $ports)->display('user/relay/edit.tpl');
}
@ -317,51 +348,56 @@ class RelayController extends UserController
$priority = $request->getParam('priority');
$source_node = Node::where('id', $source_node_id)->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('sort', 10)->where("node_class", "<=", $user->class)->first();
)->where('type', 1)->where(
static function ($query) {
$query->Where('sort', 10);
}
)->where('node_class', '<=', $user->class)->first();
if ($source_node == null) {
$rs['ret'] = 0;
$rs['msg'] = "我告诉你们我是身经百战了";
$rs['msg'] = '起源节点错误';
return $response->getBody()->write(json_encode($rs));
}
$dist_node = Node::where('id', $dist_node_id)->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(
function ($query) {
static function ($query) {
$query->Where('sort', 0)
->orWhere('sort', 10);
->orWhere('sort', 10)
->orWhere('sort', 11);
}
)->where("node_class", "<=", $user->class)->first();
)->where('node_class', '<=', $user->class)->first();
if ($dist_node_id == -1) {
$dist_node = new Node();
$dist_node->id = -1;
$dist_node->node_ip = "0.0.0.0";
$dist_node->node_ip = '0.0.0.0';
$dist_node->sort = 10;
}
if ($dist_node == null) {
$rs['ret'] = 0;
$rs['msg'] = "见得多了";
$rs['msg'] = '目标节点错误';
return $response->getBody()->write(json_encode($rs));
}
$port_raw = Node::where('server', $port)->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('sort', 9)->where("node_class", "<=", $user->class)->first();
if ($port_raw == null && $port != $user->port) {
)->where('type', 1)->where('sort', 9)->where('node_class', '<=', $user->class)->first();
if (($port_raw == null && $port != $user->port)) {
$rs['ret'] = 0;
$rs['msg'] = "西方的哪个国家我没去过";
$rs['msg'] = '端口错误';
return $response->getBody()->write(json_encode($rs));
}
@ -385,21 +421,23 @@ class RelayController extends UserController
$maybe_rule_id = Tools::has_conflict_rule($rule, $ruleset, $rule->id, $rule->source_node_id);
if ($maybe_rule_id != 0) {
$rs['ret'] = 0;
$rs['msg'] = "您即将添加的规则与规则 ID:".$maybe_rule_id." 冲突!";
$rs['msg'] = '您即将添加的规则与规则 ID:' . $maybe_rule_id . ' 冲突!';
if ($maybe_rule_id == -1) {
$rs['msg'] = "您即将添加的规则可能会造成冲突!";
$rs['msg'] = '您即将添加的规则可能会造成冲突!';
}
return $response->getBody()->write(json_encode($rs));
}
if (!$rule->save()) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败";
$rs['msg'] = '修改失败';
return $response->getBody()->write(json_encode($rs));
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -416,11 +454,14 @@ class RelayController extends UserController
if (!$rule->delete()) {
$rs['ret'] = 0;
$rs['msg'] = "删除失败";
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
Tools::delSubCache();
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
}

@ -10,7 +10,7 @@ class ResController
public function captcha($request, $response, $args)
{
$id = $args['id'];
$builder = new CaptchaBuilder;
$builder = new CaptchaBuilder();
$builder->build();
//$builder->getPhrase();
$newResponse = $response->withHeader('Content-type', ' image/jpeg');//->getBody()->write($builder->output());

File diff suppressed because it is too large Load Diff

@ -0,0 +1,563 @@
<?php
namespace App\Controllers;
use App\Models\InviteCode;
use App\Models\User;
use App\Models\Code;
use App\Models\Payback;
use App\Models\Ann;
use App\Models\Shop;
use App\Services\Auth;
use App\Services\Config;
use App\Utils\Tools;
use App\Utils\TelegramSessionManager;
use App\Utils\Geetest;
use App\Utils\URL;
use App\Models\Node;
use App\Models\Relay;
use Slim\Http\{Request, Response};
use Psr\Http\Message\ResponseInterface;
class VueController extends BaseController
{
public function getGlobalConfig($request, $response, $args)
{
$GtSdk = null;
$recaptcha_sitekey = null;
$user = $this->user;
if (Config::get('captcha_provider') != '') {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
$uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
break;
}
}
if (Config::get('enable_telegram') == true) {
$login_text = TelegramSessionManager::add_login_session();
$login = explode('|', $login_text);
$login_token = $login[0];
$login_number = $login[1];
} else {
$login_token = '';
$login_number = '';
}
$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'),
'enable_flag' => Config::get('enable_flag'),
'payment_type' => Config::get('payment_system'),
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function vuelogout($request, $response, $args)
{
Auth::logout();
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getUserInfo($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$pre_user = URL::cloneUser($user);
$user->ssr_url_all = URL::getAllUrl($pre_user, 0, 0);
$user->ssr_url_all_mu = URL::getAllUrl($pre_user, 1, 0);
$user->ss_url_all = URL::getAllUrl($pre_user, 0, 2);
$ssinfo = URL::getSSConnectInfo($pre_user);
$user->ssd_url_all = URL::getAllSSDUrl($ssinfo);
$user->isAbleToCheckin = $user->isAbleToCheckin();
$ssr_sub_token = LinkController::GenerateSSRSubCode($this->user->id, 0);
$GtSdk = null;
$recaptcha_sitekey = null;
if (Config::get('captcha_provider') != '') {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
$uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
break;
}
}
$Ann = Ann::orderBy('date', 'desc')->first();
$display_ios_class = Config::get('display_ios_class');
$ios_account = Config::get('ios_account');
$ios_password = Config::get('ios_password');
$mergeSub = Config::get('mergeSub');
$subUrl = Config::get('subUrl');
$baseUrl = Config::get('baseUrl');
$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,
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getUserInviteInfo($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$code = InviteCode::where('user_id', $user->id)->first();
if ($code == null) {
$user->addInviteCode();
$code = InviteCode::where('user_id', $user->id)->first();
}
$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_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'),
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getUserShops($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$shops = Shop::where('status', 1)->orderBy('name')->get();
$res['arr'] = array(
'shops' => $shops,
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getAllResourse($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$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,
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getNewSubToken($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$user->clean_link();
$ssr_sub_token = LinkController::GenerateSSRSubCode($this->user->id, 0);
$res['arr'] = array(
'ssr_sub_token' => $ssr_sub_token,
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getNewInviteCode($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$user->clear_inviteCodes();
$code = InviteCode::where('user_id', $this->user->id)->first();
if ($code == null) {
$this->user->addInviteCode();
$code = InviteCode::where('user_id', $this->user->id)->first();
}
$res['arr'] = array(
'code' => $code,
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getTransfer($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$res['arr'] = array(
'todayUsedTraffic' => $user->TodayusedTraffic(),
'lastUsedTraffic' => $user->LastusedTraffic(),
'unUsedTraffic' => $user->unusedTraffic(),
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getCaptcha($request, $response, $args)
{
$GtSdk = null;
$recaptcha_sitekey = null;
if (Config::get('captcha_provider') != '') {
switch (Config::get('captcha_provider')) {
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
$res['recaptchaKey'] = $recaptcha_sitekey;
break;
case 'geetest':
$uid = time() . random_int(1, 10000);
$GtSdk = Geetest::get($uid);
$res['GtSdk'] = $GtSdk;
break;
}
}
$res['respon'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getChargeLog($request, $response, $args)
{
$user = $this->user;
if (!$user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$pageNum = $request->getParam('current');
$codes = Code::where('type', '<>', '-2')->where('userid', '=', $user->id)->orderBy('id', 'desc')->paginate(15, ['*'], 'page', $pageNum);
$codes->setPath('/#/user/code');
$res['codes'] = $codes;
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
public function getNodeList($request, $response, $args)
{
$user = Auth::getUser();
if (!$this->user->isLogin) {
$res['ret'] = -1;
return $response->getBody()->write(json_encode($res));
}
$nodes = Node::where('type', 1)->orderBy('node_class')->orderBy('name')->get();
$relay_rules = Relay::where('user_id', $this->user->id)->orwhere('user_id', 0)->orderBy('id', 'asc')->get();
if (!Tools::is_protocol_relay($user)) {
$relay_rules = array();
}
$array_nodes = array();
$nodes_muport = array();
foreach ($nodes as $node) {
if ($node->node_group != $user->node_group && $node->node_group != 0) {
continue;
}
if ($node->sort == 9) {
$mu_user = User::where('port', '=', $node->server)->first();
$mu_user->obfs_param = $this->user->getMuMd5();
$nodes_muport[] = array('server' => $node, 'user' => $mu_user);
continue;
}
$array_node = array();
$array_node['id'] = $node->id;
$array_node['class'] = $node->node_class;
$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 {
$array_node['server'] = $node->server;
}
$array_node['sort'] = $node->sort;
$array_node['info'] = $node->info;
$array_node['mu_only'] = $node->mu_only;
$array_node['group'] = $node->node_group;
$array_node['raw_node'] = $node;
$regex = Config::get('flag_regex');
$matches = array();
preg_match($regex, $node->name, $matches);
if (isset($matches[0])) {
$array_node['flag'] = $matches[0] . '.png';
} else {
$array_node['flag'] = 'unknown.png';
}
$node_online = $node->isNodeOnline();
if ($node_online === null) {
$array_node['online'] = 0;
} elseif ($node_online === true) {
$array_node['online'] = 1;
} elseif ($node_online === false) {
$array_node['online'] = -1;
}
if (in_array($node->sort, array(0, 7, 8, 10, 11, 12, 13))) {
$array_node['online_user'] = $node->getOnlineUserCount();
} else {
$array_node['online_user'] = -1;
}
$nodeLoad = $node->getNodeLoad();
if (isset($nodeLoad[0]['load'])) {
$array_node['latest_load'] = (explode(' ', $nodeLoad[0]['load']))[0] * 100;
} else {
$array_node['latest_load'] = -1;
}
$array_node['traffic_used'] = (int)Tools::flowToGB($node->node_bandwidth);
$array_node['traffic_limit'] = (int)Tools::flowToGB($node->node_bandwidth_limit);
if ($node->node_speedlimit == 0.0) {
$array_node['bandwidth'] = 0;
} 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';
}
$array_node['traffic_rate'] = $node->traffic_rate;
$array_node['status'] = $node->status;
$array_nodes[] = $array_node;
}
$res['nodeinfo'] = array(
'nodes' => $array_nodes,
'nodes_muport' => $nodes_muport,
'relay_rules' => $relay_rules,
'user' => $user,
'tools' => new Tools(),
);
$res['ret'] = 1;
return $response->getBody()->write(json_encode($res));
}
/**
* @param Request $requesr
* @param Response $response
* @param array $args
*/
public function getNodeInfo($request, $response, $args): ResponseInterface
{
$user = $this->user;
$id = $args['id'];
$mu = $request->getQueryParam('ismu');
$relay_rule_id = $request->getQueryParam('relay_rule');
$node = Node::find($id);
if ($node == null) {
return $response->withJson([null]);
}
switch ($node->sort) {
case 0:
if ((($user->class >= $node->node_class
&& ($user->node_group == $node->node_group || $node->node_group == 0)) || $user->is_admin)
&& ($node->node_bandwidth_limit == 0 || $node->node_bandwidth < $node->node_bandwidth_limit)
) {
return $response->withJson([
'ret' => 1,
'nodeInfo' => [
'node' => $node,
'user' => $user,
'mu' => $mu,
'relay_rule_id' => $relay_rule_id,
'URL' => URL::class,
],
]);
}
break;
case 1:
if ($user->class >= $node->node_class
&& ($user->node_group == $node->node_group || $node->node_group == 0)
) {
$email = $user->email;
$email = Radius::GetUserName($email);
$json_show = 'VPN 信息<br>地址:' . $node->server
. '<br>用户名:' . $email . '<br>密码:' . $this->user->passwd
. '<br>支持方式:' . $node->method . '<br>备注:' . $node->info;
return $response->write(
$this->view()->assign('json_show', $json_show)->fetch('user/nodeinfovpn.tpl')
);
}
break;
case 2:
if ($user->class >= $node->node_class
&& ($user->node_group == $node->node_group || $node->node_group == 0)) {
$email = $user->email;
$email = Radius::GetUserName($email);
$json_show = 'SSH 信息<br>地址:' . $node->server
. '<br>用户名:' . $email . '<br>密码:' . $this->user->passwd
. '<br>支持方式:' . $node->method . '<br>备注:' . $node->info;
return $response->write(
$this->view()->assign('json_show', $json_show)->fetch('user/nodeinfossh.tpl')
);
}
break;
case 5:
if ($user->class >= $node->node_class
&& ($user->node_group == $node->node_group || $node->node_group == 0)) {
$email = $user->email;
$email = Radius::GetUserName($email);
$json_show = 'Anyconnect 信息<br>地址:' . $node->server
. '<br>用户名:' . $email . '<br>密码:' . $this->user->passwd
. '<br>支持方式:' . $node->method . '<br>备注:' . $node->info;
return $response->write(
$this->view()->assign('json_show', $json_show)->fetch('user/nodeinfoanyconnect.tpl')
);
}
break;
case 10:
if ((($user->class >= $node->node_class
&& ($user->node_group == $node->node_group || $node->node_group == 0)) || $user->is_admin)
&& ($node->node_bandwidth_limit == 0 || $node->node_bandwidth < $node->node_bandwidth_limit)) {
return $response->withJson([
'ret' => 1,
'nodeInfo' => [
'node' => $node,
'user' => $user,
'mu' => $mu,
'relay_rule_id' => $relay_rule_id,
'URL' => URL::class,
],
]);
}
break;
case 13:
if ((($user->class >= $node->node_class
&& ($user->node_group == $node->node_group || $node->node_group == 0)) || $user->is_admin)
&& ($node->node_bandwidth_limit == 0 || $node->node_bandwidth < $node->node_bandwidth_limit)) {
return $response->withJson([
'ret' => 1,
'nodeInfo' => [
'node' => $node,
'user' => $user,
'mu' => $mu,
'relay_rule_id' => $relay_rule_id,
'URL' => URL::class,
],
]);
}
break;
}
// Default and judgement fail return
return $response->withJson([
'ret' => 0,
'nodeInfo' => [
'message' => ':)',
],
]);
}
}

@ -2,28 +2,26 @@
namespace App\Middleware;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use App\Services\Auth as AuthService;
use App\Services\Config;
class Admin
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
/**
* @param \Slim\Http\Request $request
* @param \Slim\Http\Response $response
* @param callable $next
*
* @return \Slim\Http\Response
*/
public function __invoke($request, $response, $next)
{
//$response->getBody()->write('BEFORE');
$user = AuthService::getUser();
if (!$user->isLogin) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login');
return $newResponse;
return $response->withStatus(302)->withHeader('Location', '/auth/login');
}
if (!$user->isAdmin()) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/user');
return $newResponse;
return $response->withStatus(302)->withHeader('Location', '/user');
}
$response = $next($request, $response);
return $response;
return $next($request, $response);
}
}

@ -1,38 +0,0 @@
<?php
namespace App\Middleware;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use App\Services\Factory;
use App\Utils\Helper;
class Api
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
{
$accessToken = Helper::getTokenFromReq($request);
if ($accessToken==null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
$response->getBody()->write(json_encode($res));
return $response;
}
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($token==null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
$response->getBody()->write(json_encode($res));
return $response;
}
if ($token->expireTime < time()) {
$res['ret'] = 0;
$res['msg'] = "token is expire";
$response->getBody()->write(json_encode($res));
return $response;
}
$response = $next($request, $response);
return $response;
}
}

@ -2,45 +2,27 @@
namespace App\Middleware;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use App\Services\Auth as AuthService;
use App\Services\Config;
use App\Services\Jwt;
class Auth
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
/**
* @param \Slim\Http\Request $request
* @param \Slim\Http\Response $response
* @param callable $next
*
* @return \Slim\Http\Response
*/
public function __invoke($request, $response, $next)
{
$user = AuthService::getUser();
if (!$user->isLogin) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login');
return $newResponse;
}
if ($user->enable == 0 && $_SERVER["REQUEST_URI"] != "/user/disable") {
$newResponse = $response->withStatus(302)->withHeader('Location', '/user/disable');
return $newResponse;
return $response->withStatus(302)->withHeader('Location', '/auth/login');
}
if (Config::get('enable_duoshuo')=='true') {
$token = array(
"short_name"=>Config::get('duoshuo_shortname'),
"user_key"=>$user->id,
"name"=>$user->user_name,
"email"=>$user->email
);
$duoshuoToken = JWT::encode_withkey($token, Config::get('duoshuo_apptoken'));
setcookie('duoshuo_token', $duoshuoToken);
$enablePages = array('/user/disable', '/user/backtoadmin', '/user/logout');
if ($user->enable == 0 && !in_array($_SERVER['REQUEST_URI'], $enablePages)) {
return $response->withStatus(302)->withHeader('Location', '/user/disable');
}
$response = $next($request, $response);
return $response;
return $next($request, $response);
}
}

@ -2,20 +2,23 @@
namespace App\Middleware;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use App\Services\Auth as AuthService;
class Guest
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
/**
* @param \Slim\Http\Request $request
* @param \Slim\Http\Response $response
* @param callable $next
*
* @return \Slim\Http\Response
*/
public function __invoke($request, $response, $next)
{
$user = AuthService::getUser();
if ($user->isLogin) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/user');
return $newResponse;
return $response->withStatus(302)->withHeader('Location', '/user');
}
$response = $next($request, $response);
return $response;
return $next($request, $response);
}
}

@ -1,52 +1,50 @@
<?php
namespace App\Middleware;
use App\Services\Config;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use App\Services\Factory;
use App\Utils\Helper;
use App\Models\Node;
use App\Services\MalioConfig;
class Mod_Mu
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
/**
* @param \Slim\Http\Request $request
* @param \Slim\Http\Response $response
* @param callable $next
*
* @return \Slim\Http\Response
*/
public function __invoke($request, $response, $next)
{
$key = Helper::getMuKeyFromReq($request);
if ($key == null) {
$res['ret'] = 0;
$res['data'] = "key is null";
$response->getBody()->write(json_encode($res));
return $response;
$key = $request->getQueryParam('key');
if ($key === null) {
return $response->withjson([
'ret' => 0,
'data' => 'Your key is null.'
]);
}
$auth=false;
$keyset=explode(",", Config::get('muKey'));
foreach ($keyset as $sinkey) {
if ($key==$sinkey) {
$auth=true;
break;
}
}
$keys = Config::getMuKey();
$auth = in_array($key, $keys);
if ($auth==false) {
if ($auth == false) {
$res['ret'] = 0;
$res['data'] = "token or source is invalid";
$res['data'] = 'token is invalid';
$response->getBody()->write(json_encode($res));
return $response;
}
$node = Node::where("node_ip", "LIKE", $_SERVER["REMOTE_ADDR"].'%')->first();
if ($node==null && $_SERVER["REMOTE_ADDR"] != '127.0.0.1') {
$res['ret'] = 0;
$res['data'] = "token or source is invalid";
$response->getBody()->write(json_encode($res));
return $response;
if (Config::get('checkNodeIp') === true){
$node = Node::where('node_ip', 'LIKE', $_SERVER['REMOTE_ADDR'] . '%')->first();
if ($auth === false || ($node === null && $_SERVER['REMOTE_ADDR'] != '127.0.0.1')) {
return $response->withJson([
'ret' => 0,
'data' => 'Token or IP is invalid. Now, your IP address is ' . $_SERVER['REMOTE_ADDR']
]);
}
}
$response = $next($request, $response);
return $response;
return $next($request, $response);
}
}

@ -1,52 +0,0 @@
<?php
namespace App\Middleware;
use App\Services\Config;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use App\Services\Factory;
use App\Utils\Helper;
use App\Models\Node;
class Mu
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
{
$key = Helper::getMuKeyFromReq($request);
if ($key == null) {
$res['ret'] = 0;
$res['msg'] = "key is null";
$response->getBody()->write(json_encode($res));
return $response;
}
$auth=false;
$keyset=explode(",", Config::get('muKey'));
foreach ($keyset as $sinkey) {
if ($key==$sinkey) {
$auth=true;
break;
}
}
if ($auth==false) {
$res['ret'] = 0;
$res['msg'] = "token or source is invalid";
$response->getBody()->write(json_encode($res));
return $response;
}
$node = Node::where("node_ip", "LIKE", $_SERVER["REMOTE_ADDR"].'%')->first();
if ($node==null && $_SERVER["REMOTE_ADDR"] != '127.0.0.1') {
$res['ret'] = 0;
$res['msg'] = "token or source is invalid";
$response->getBody()->write(json_encode($res));
return $response;
}
$response = $next($request, $response);
return $response;
}
}

@ -5,11 +5,8 @@ namespace App\Models;
/**
* Ann Model
*/
use App\Utils\Tools;
class Ann extends Model
{
protected $connection = "default";
protected $table = "announcement";
protected $connection = 'default';
protected $table = 'announcement';
}

@ -2,20 +2,17 @@
namespace App\Models;
use App\Utils\Tools;
class Auto extends Model
{
protected $connection = "default";
protected $table = "auto";
protected $connection = 'default';
protected $table = 'auto';
public function datetime()
{
return date("Y-m-d H:i:s", $this->attributes['datetime']);
return date('Y-m-d H:i:s', $this->attributes['datetime']);
}
public function content()
{
return str_replace(PHP_EOL, '<br>', $this->attributes['value']);

@ -3,22 +3,19 @@
namespace App\Models;
use App\Utils\Tools;
class BlockIp extends Model
{
protected $connection = "default";
protected $table = "blockip";
protected $connection = 'default';
protected $table = 'blockip';
public function node()
{
return Node::where("id", $this->attributes['nodeid'])->first();
return Node::where('id', $this->attributes['nodeid'])->first();
}
public function time()
{
return date("Y-m-d H:i:s", $this->attributes['datetime']);
return date('Y-m-d H:i:s', $this->attributes['datetime']);
}
}

@ -4,32 +4,93 @@ namespace App\Models;
class Bought extends Model
{
protected $connection = "default";
protected $table = "bought";
protected $connection = 'default';
protected $table = 'bought';
public function renew_date()
{
return date("Y-m-d H:i:s", $this->attributes['renew']);
return date('Y-m-d H:i:s', $this->attributes['renew']);
}
public function datetime()
{
return date("Y-m-d H:i:s", $this->attributes['datetime']);
return date('Y-m-d H:i:s', $this->attributes['datetime']);
}
public function user()
{
$user = User::where("id", $this->attributes['userid'])->first();
$user = User::where('id', $this->attributes['userid'])->first();
if ($user == null) {
Bought::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
public function shop()
{
return Shop::where("id", $this->attributes['shopid'])->first();
return Shop::where('id', $this->attributes['shopid'])->first();
}
/*
* 套餐已使用的天数
*
*/
public function used_days()
{
return (int) ((strtotime(date('Y-m-d')) - $this->datetime) / 86400);
}
/*
* 是否有效期内
*
*/
public function valid()
{
$shop = $this->shop();
if ($this->use_loop()) {
return (time() - $shop->reset_exp() * 86400 < $this->datetime);
}
return false;
}
/*
* 是否周期性商品
*
*/
public function use_loop()
{
$shop = $this->shop();
return ($shop->reset() != 0 && $shop->reset_value() != 0 && $shop->reset_exp() != 0);
}
/*
* 下一次流量重置时间
*
*/
public function reset_time($unix = false)
{
$shop = $this->shop();
if ($this->use_loop()) {
$day = $shop->reset() - ($this->used_days() % $shop->reset());
$time = time() + ($day * 86400);
return ($unix == false ? date('Y-m-d', $time) : $time);
}
return ($unix == false ? '-' : 0);
}
/*
* 过期时间
*
*/
public function exp_time($unix = false)
{
$shop = $this->shop();
if ($this->use_loop()) {
$time = $this->datetime + ($shop->reset_exp() * 86400);
return ($unix == false ? date('Y-m-d H:i:s', $time) : $time);
}
return ($unix == false ? '-' : 0);
}
}

@ -5,6 +5,6 @@ namespace App\Models;
class CheckInLog
{
protected $connection = "default";
protected $table = "ss_checkin_log";
protected $connection = 'default';
protected $table = 'ss_checkin_log';
}

@ -5,18 +5,14 @@ namespace App\Models;
/**
* Code Model
*/
use App\Utils\Tools;
class Code extends Model
{
protected $connection = "default";
protected $table = "code";
protected $connection = 'default';
protected $table = 'code';
public function user()
{
return User::where("id", $this->attributes['userid'])->first();
return User::where('id', $this->attributes['userid'])->first();
}
}

@ -4,6 +4,6 @@ namespace App\Models;
class Config extends Model
{
protected $connection = "default";
protected $connection = 'default';
protected $table = 'config';
}

@ -4,28 +4,28 @@ namespace App\Models;
class Coupon extends Model
{
protected $connection = "default";
protected $table = "coupon";
protected $connection = 'default';
protected $table = 'coupon';
public function expire()
{
return date("Y-m-d H:i:s", $this->attributes['expire']);
return date('Y-m-d H:i:s', $this->attributes['expire']);
}
public function order($shop)
{
if ($this->attributes['shop']=="") {
if ($this->attributes['shop'] == '') {
return true;
}
$shop_array=explode(",", $this->attributes['shop']);
$shop_array = explode(',', $this->attributes['shop']);
foreach ($shop_array as $shopid) {
if ($shopid==$shop) {
if ($shopid == $shop) {
return true;
}
}
return false;
}
}

@ -0,0 +1,9 @@
<?php
namespace App\Models;
class DetectBanLog extends Model
{
protected $connection = "default";
protected $table = "detect_ban_log";
}

@ -2,47 +2,41 @@
namespace App\Models;
/**
* DetectLog Model
*/
use App\Utils\Tools;
class DetectLog extends Model
{
protected $connection = "default";
protected $table = "detect_log";
protected $connection = 'default';
protected $table = 'detect_log';
public function DetectRule()
{
$rule = DetectRule::where("id", $this->attributes['list_id'])->first();
$rule = DetectRule::where('id', $this->attributes['list_id'])->first();
if ($rule == null) {
DetectLog::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $rule;
}
return $rule;
}
public function User()
{
$user = User::where("id", $this->attributes['user_id'])->first();
$user = User::where('id', $this->attributes['user_id'])->first();
if ($user == null) {
DetectLog::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
public function Node()
{
$node = Node::where("id", $this->attributes['node_id'])->first();
$node = Node::where('id', $this->attributes['node_id'])->first();
if ($node == null) {
DetectLog::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $node;
}
return $node;
}
}

@ -5,9 +5,8 @@ namespace App\Models;
/**
* DetectLog Model
*/
class DetectRule extends Model
{
protected $connection = "default";
protected $table = "detect_list";
protected $connection = 'default';
protected $table = 'detect_list';
}

@ -5,9 +5,8 @@ namespace App\Models;
/**
* Disconnect Model
*/
class Disconnect extends Model
{
protected $connection = "default";
protected $table = "disconnect_ip";
protected $connection = 'default';
protected $table = 'disconnect_ip';
}

@ -5,9 +5,8 @@ namespace App\Models;
/**
* EmailVerify Model
*/
class EmailVerify extends Model
{
protected $connection = "default";
protected $table = "email_verify";
protected $connection = 'default';
protected $table = 'email_verify';
}

@ -0,0 +1,55 @@
<?php
namespace App\Models;
use App\Services\DefaultConfig;
class GConfig extends Model
{
/**
* The connection name for the model.
*
* @var string
*/
protected $connection = 'default';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'gconfig';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'key';
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'string';
public static function recover($user)
{
$this->oldvalue = $this->value;
$this->value = DefaultConfig::default_value($this->key)['value'];
$this->operator_id = $user->id;
$this->operator_name = ('[恢复默认] - ' . $user->user_name);
$this->operator_email = $user->email;
$this->last_update = time();
$this->save();
}
}

@ -5,9 +5,8 @@ namespace App\Models;
/**
* InviteCode Model
*/
class InviteCode extends Model
{
protected $connection = "default";
protected $table = "ss_invite_code";
protected $connection = 'default';
protected $table = 'ss_invite_code';
}

@ -5,39 +5,36 @@ namespace App\Models;
/**
* Ip Model
*/
use App\Utils\Tools;
class Ip extends Model
{
protected $connection = "default";
protected $table = "alive_ip";
protected $connection = 'default';
protected $table = 'alive_ip';
public function user()
{
$user = User::where("id", $this->attributes['userid'])->first();
$user = User::where('id', $this->attributes['userid'])->first();
if ($user == null) {
Ip::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
public function Node()
{
$node = Node::where("id", $this->attributes['nodeid'])->first();
$node = Node::where('id', $this->attributes['nodeid'])->first();
if ($node == null) {
Ip::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $node;
}
return $node;
}
public function ip()
{
return str_replace("::ffff:", "", $this->attributes['ip']);
return str_replace('::ffff:', '', $this->attributes['ip']);
}
}

@ -4,6 +4,6 @@ namespace App\Models;
class Link extends Model
{
protected $connection = "default";
protected $table = "link";
protected $connection = 'default';
protected $table = 'link';
}

@ -5,27 +5,24 @@ namespace App\Models;
/**
* Ip Model
*/
use App\Utils\Tools;
class LoginIp extends Model
{
protected $connection = "default";
protected $table = "login_ip";
protected $connection = 'default';
protected $table = 'login_ip';
public function user()
{
$user = User::where("id", $this->attributes['userid'])->first();
$user = User::where('id', $this->attributes['userid'])->first();
if ($user == null) {
LoginIp::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
public function datetime()
{
return date("Y-m-d H:i:s", $this->attributes['datetime']);
return date('Y-m-d H:i:s', $this->attributes['datetime']);
}
}

@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model as EloquentMedel;
/**
* Base Model
*/
class Model extends EloquentMedel
{
public $timestamps = false;

@ -6,12 +6,13 @@ namespace App\Models;
* Node Model
*/
use App\Utils\Tools;
use App\Utils\{Tools, URL};
use App\Utils\DNSoverHTTPS;
class Node extends Model
{
protected $connection = "default";
protected $table = "ss_node";
protected $connection = 'default';
protected $table = 'ss_node';
protected $casts = [
'node_speedlimit' => 'float',
@ -34,7 +35,7 @@ class Node extends Model
{
$log = $this->getLastNodeInfoLog();
if ($log == null) {
return "暂无数据";
return '暂无数据';
}
return Tools::secondsToTime((int)$log->uptime);
}
@ -43,31 +44,40 @@ class Node extends Model
public function getNodeUpRate()
{
$id = $this->attributes['id'];
$log = NodeOnlineLog::where('node_id', $id)->where('log_time', '>=', time()-86400)->count();
$log = NodeOnlineLog::where('node_id', $id)->where('log_time', '>=', time() - 86400)->count();
return $log/1440;
return $log / 1440;
}
public function getNodeLoad()
{
$id = $this->attributes['id'];
$log = NodeInfoLog::where('node_id', $id)->orderBy('id', 'desc')->whereRaw('`log_time`%1800<60')->limit(48)->get();
$log = NodeInfoLog::where('node_id', $id)->orderBy(
'id',
'desc'
)->whereRaw('`log_time`%1800<60')->limit(48)->get();
return $log;
}
public function getNodeAlive()
{
$id = $this->attributes['id'];
$log = NodeOnlineLog::where('node_id', $id)->orderBy('id', 'desc')->whereRaw('`log_time`%1800<60')->limit(48)->get();
$log = NodeOnlineLog::where('node_id', $id)->orderBy(
'id',
'desc'
)->whereRaw('`log_time`%1800<60')->limit(48)->get();
return $log;
}
public function getOnlineUserCount()
{
$id = $this->attributes['id'];
$log = NodeOnlineLog::where('node_id', $id)->orderBy('id', 'desc')->first();
$log = NodeOnlineLog::where('node_id', $id)->where('log_time', '>', time() - 300)->orderBy(
'id',
'desc'
)->first();
if ($log == null) {
return "暂无数据";
return 0;
}
return $log->online_user;
}
@ -77,13 +87,13 @@ class Node extends Model
$id = $this->attributes['id'];
$log = Speedtest::where('nodeid', $id)->orderBy('datetime', 'desc')->first();
if ($log == null) {
return "暂无数据";
return '暂无数据';
}
return "电信延迟:".$log->telecomping." 下载:".$log->telecomeupload." 上传:".$log->telecomedownload."<br>
联通延迟:".$log->unicomping." 下载:".$log->unicomupload." 上传:".$log->unicomdownload."<br>
移动延迟:".$log->cmccping." 下载:".$log->cmccupload." 上传:".$log->cmccdownload."<br>定时测试,仅供参考";
return '电信延迟:' . $log->telecomping . ' 下载:' . $log->telecomeupload . ' 上传:' . $log->telecomedownload . '<br>
联通延迟:' . $log->unicomping . ' 下载:' . $log->unicomupload . ' 上传:' . $log->unicomdownload . '<br>
移动延迟:' . $log->cmccping . ' 下载:' . $log->cmccupload . ' 上传:' . $log->cmccdownload . '<br>定时测试,仅供参考';
}
public function getSpeedtestResult()
@ -91,7 +101,7 @@ class Node extends Model
$id = $this->attributes['id'];
$log = Speedtest::where('nodeid', $id)->orderBy('id', 'desc')->limit(48)->get();
if ($log == null) {
return "暂无数据";
return '暂无数据';
}
@ -105,7 +115,7 @@ class Node extends Model
$traffic = TrafficLog::where('node_id', $id)->sum('u') + TrafficLog::where('node_id', $id)->sum('d');
if ($traffic == 0) {
return "暂无数据";
return '暂无数据';
}
return Tools::flowAutoShow($traffic);
@ -113,22 +123,19 @@ class Node extends Model
public function isNodeOnline()
{
$node_heartbeat = $this->attributes['node_heartbeat'];
$sort = $this->attributes['sort'];
if (!($sort == 0 || $sort == 7 || $sort == 8 || $sort==10 || $sort==11)) {
return null;
$delay = 300;
if ($this->attributes['node_heartbeat'] === 0) {
return false;
}
if ($node_heartbeat == 0) {
if (!in_array($this->attributes['sort'], [0, 7, 8, 10, 11, 12, 13])) {
return null;
}
if (time() - $node_heartbeat > 300) {
return false;
} else {
if ($this->attributes['node_heartbeat'] > time() - $delay) {
return true;
}
return false;
}
public function isNodeTrafficOut()
@ -136,37 +143,26 @@ class Node extends Model
$node_bandwidth = $this->attributes['node_bandwidth'];
$node_bandwidth_limit = $this->attributes['node_bandwidth_limit'];
if ($node_bandwidth_limit == 0 || $node_bandwidth < $node_bandwidth_limit) {
return false;
} else {
return true;
}
return !($node_bandwidth_limit == 0 || $node_bandwidth < $node_bandwidth_limit);
}
public function isNodeAccessable()
{
if ($this->isNodeTrafficOut() == false && $this->isNodeOnline() == true) {
return true;
} else {
return false;
}
return $this->isNodeTrafficOut() == false && $this->isNodeOnline() == true;
}
public function changeNodeIp($server_name)
{
$ip = gethostbyname($server_name);
if ($ip=="127.0.0.1"){
$ip = DNSoverHTTPS::gethostbyName($server_name);
}
$node_id = $this->attributes['id'];
if ($ip == "") {
if ($ip == '') {
return false;
}
$relay_rules = Relay::where('dist_node_id', $node_id)->get();
foreach ($relay_rules as $relay_rule) {
$relay_rule->dist_ip = $ip;
$relay_rule->save();
}
$this->attributes['node_ip'] = $ip;
return true;
}
@ -177,4 +173,21 @@ class Node extends Model
$node_ip_array = explode(',', $node_ip_str);
return $node_ip_array[0];
}
public function getServer()
{
$out = '';
$explode = explode(';', $this->attributes['server']);
if (in_array($this->attributes['sort'], [0, 10])) {
if (isset($explode[1]) && stripos($explode[1], 'server=') !== false) {
$out = URL::parse_args($explode[1])['server'];
}
}
return ($out != '' ? $out : $explode[0]);
}
public function getOffsetPort($port)
{
return Tools::OutPort($this->attributes['server'], $this->attributes['name'], $port)['port'];
}
}

@ -1,18 +1,19 @@
<?php
namespace App\Models;
class NodeInfoLog extends Model
{
protected $connection = "default";
protected $table = "ss_node_info";
protected $connection = 'default';
protected $table = 'ss_node_info';
public function getNodeLoad()
{
$load = $this->attributes['load'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getTime()
{
$time = $this->attributes['log_time'];

@ -5,6 +5,6 @@ namespace App\Models;
class NodeOnlineLog extends Model
{
protected $connection = "default";
protected $table = "ss_node_online_log";
protected $connection = 'default';
protected $table = 'ss_node_online_log';
}

@ -4,6 +4,6 @@ namespace App\Models;
class PasswordReset extends Model
{
protected $connection = "default";
protected $connection = 'default';
protected $table = 'ss_password_reset';
}

@ -4,17 +4,17 @@ namespace App\Models;
class Payback extends Model
{
protected $connection = "default";
protected $connection = 'default';
protected $table = 'payback';
public function user()
{
$user = User::where("id", $this->attributes['userid'])->first();
$user = User::where('id', $this->attributes['userid'])->first();
if ($user == null) {
Bought::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
}

@ -4,6 +4,6 @@ namespace App\Models;
class Paylist extends Model
{
protected $connection = "default";
protected $connection = 'default';
protected $table = 'paylist';
}

@ -4,6 +4,6 @@ namespace App\Models;
class RadiusBan extends Model
{
protected $connection = "default";
protected $table = "radius_ban";
protected $connection = 'default';
protected $table = 'radius_ban';
}

@ -4,6 +4,6 @@ namespace App\Models;
class RadiusNas extends Model
{
protected $connection = "radius";
protected $table = "nas";
protected $connection = 'radius';
protected $table = 'nas';
}

@ -4,6 +4,6 @@ namespace App\Models;
class RadiusRadAcct extends Model
{
protected $connection = "radius";
protected $table = "radacct";
protected $connection = 'radius';
protected $table = 'radacct';
}

@ -4,6 +4,6 @@ namespace App\Models;
class RadiusRadCheck extends Model
{
protected $connection = "radius";
protected $table = "radcheck";
protected $connection = 'radius';
protected $table = 'radcheck';
}

@ -4,6 +4,6 @@ namespace App\Models;
class RadiusRadPostauth extends Model
{
protected $connection = "radius";
protected $table = "radpostauth";
protected $connection = 'radius';
protected $table = 'radpostauth';
}

@ -4,6 +4,6 @@ namespace App\Models;
class RadiusRadUserGroup extends Model
{
protected $connection = "radius";
protected $table = "radusergroup";
protected $connection = 'radius';
protected $table = 'radusergroup';
}

@ -5,32 +5,31 @@ namespace App\Models;
/**
* DetectLog Model
*/
class Relay extends Model
{
protected $connection = "default";
protected $table = "relay";
protected $connection = 'default';
protected $table = 'relay';
public function User()
{
$user = User::where("id", $this->attributes['user_id'])->first();
$user = User::where('id', $this->attributes['user_id'])->first();
if ($user == null) {
Relay::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
public function Source_Node()
{
$node = Node::where("id", $this->attributes['source_node_id'])->first();
$node = Node::where('id', $this->attributes['source_node_id'])->first();
if ($node == null && $this->attributes['source_node_id'] != 0) {
Relay::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $node;
}
return $node;
}
public function Dist_Node()
@ -39,12 +38,12 @@ class Relay extends Model
return null;
}
$node = Node::where("id", $this->attributes['dist_node_id'])->first();
$node = Node::where('id', $this->attributes['dist_node_id'])->first();
if ($node == null) {
Relay::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $node;
}
return $node;
}
}

@ -5,9 +5,8 @@ namespace App\Models;
/**
* Node Model
*/
class Role extends Model
{
protected $connection = "default";
protected $table = "user_role";
protected $connection = 'default';
protected $table = 'user_role';
}

@ -3,196 +3,186 @@
namespace App\Models;
use App\Services\Config;
use App\Services\MalioConfig;
class Shop extends Model
{
protected $connection = "default";
protected $table = "shop";
protected $connection = 'default';
protected $table = 'shop';
public function content()
{
$content = json_decode($this->attributes['content'], true);
$content_text="";
$content_text = '';
$i = 0;
foreach ($content as $key=>$value) {
foreach ($content as $key => $value) {
switch ($key) {
case "bandwidth":
$content_text .= "添加流量 ".$value." G ";
case 'bandwidth':
$content_text .= '添加流量 ' . $value . ' G ';
break;
case "expire":
$content_text .= ", 为账号的有效期添加 ".$value." 天 ";
case 'expire':
$content_text .= ', 为账号的有效期添加 ' . $value . ' 天 ';
break;
case "class":
$content_text .= ", 为账号升级为等级 ".$value." , 有效期 ".$content["class_expire"]." 天 ";
case 'class':
$content_text .= ', 为账号升级为等级 ' . $value . ' , 有效期 ' . $content['class_expire'] . ' 天 ';
break;
case "reset":
$content_text .= ", 在 ".$content["reset_exp"]." 天内 ,每 ".$value." 天重置流量为 ".$content["reset_value"]." G ";
case 'reset':
$content_text .= ', 在 ' . $content['reset_exp'] . ' 天内 ,每 ' . $value . ' 天重置流量为 ' . $content['reset_value'] . ' G ';
break;
case "speedlimit":
if ($value == 0){
$content_text .= ", 用户端口不限速 " ;
}else{
$content_text .= ", 用户端口限速变为".$value." Mbps ";
case 'speedlimit':
if ($value == 0) {
$content_text .= ', 用户端口不限速 ';
} else {
$content_text .= ', 用户端口限速变为' . $value . ' Mbps ';
}
break;
case "connector":
if ($value == 0){
$content_text .= ", 用户IP不限制";
}else{
$content_text .= ", 用户IP限制变为 ".$value." 个";
case 'connector':
if ($value == 0) {
$content_text .= ', 用户IP不限制';
} else {
$content_text .= ', 用户IP限制变为 ' . $value . ' 个';
}
break;
default:
}
//if ($i<count($content)&&$key!="connector") {
//$content_text .= ",";
//}
$i++;
}
if (substr($content_text, -1, 1)==",") {
$content_text=substr($content_text, 0, -1);
}
$content_text = rtrim($content_text, ',');
return $content_text;
}
public function bandwidth()
{
$content = json_decode($this->attributes['content']);
if (isset($content->bandwidth)) {
return $content->bandwidth;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->bandwidth ?? 0;
}
public function expire()
{
$content = json_decode($this->attributes['content']);
if (isset($content->expire)) {
return $content->expire;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->expire ?? 0;
}
public function reset()
{
$content = json_decode($this->attributes['content']);
if (isset($content->reset)) {
return $content->reset;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->reset ?? 0;
}
public function reset_value()
{
$content = json_decode($this->attributes['content']);
if (isset($content->reset_value)) {
return $content->reset_value;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->reset_value ?? 0;
}
public function reset_exp()
{
$content = json_decode($this->attributes['content']);
if (isset($content->reset_exp)) {
return $content->reset_exp;
} else {
return 0;
$content = json_decode($this->attributes['content']);
return $content->reset_exp ?? 0;
}
public function content_extra()
{
$content = json_decode($this->attributes['content']);
if (isset($content->content_extra)) {
$content_extra = $content->content_extra;
$content_extra = explode(';', $content_extra);
$content_extra_new = array();
foreach ($content_extra as $innerContent) {
if (false === strpos($innerContent, '-')) {
$innerContent = 'check-' . $innerContent;
}
$innerContent = explode('-', $innerContent);
$content_extra_new[] = $innerContent;
}
$content_extra = $content_extra_new;
return $content_extra;
}
return 0;
}
public function user_class()
{
$content = json_decode($this->attributes['content']);
if (isset($content->class)) {
return $content->class;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->class ?? 0;
}
public function class_expire()
{
$content = json_decode($this->attributes['content']);
if (isset($content->class_expire)) {
return $content->class_expire;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->class_expire ?? 0;
}
public function speedlimit()
{
$content = json_decode($this->attributes['content']);
if (isset($content->speedlimit)) {
return $content->speedlimit;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->speedlimit ?? 0;
}
public function connector()
{
$content = json_decode($this->attributes['content']);
if (isset($content->connector)) {
return $content->connector;
} else {
return 0;
}
$content = json_decode($this->attributes['content']);
return $content->connector ?? 0;
}
public function buy($user, $is_renew = 0)
{
$content = json_decode($this->attributes['content'], true);
$content_text="";
$content_text = '';
foreach ($content as $key=>$value) {
foreach ($content as $key => $value) {
switch ($key) {
case "bandwidth":
case 'bandwidth':
if ($is_renew == 0) {
if (Config::get('enable_bought_reset') == 'true') {
$user->transfer_enable=$value*1024*1024*1024;
if (Config::get('enable_bought_reset') == true) {
$user->transfer_enable = $value * 1024 * 1024 * 1024;
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
} elseif (MalioConfig::get('reset_bandwidth_and_expire_date_when_change_class') == true && $user->class != $content['class']) {
$user->transfer_enable = $value * 1024 * 1024 * 1024;
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
} else {
$user->transfer_enable=$user->transfer_enable+$value*1024*1024*1024;
$user->transfer_enable += $value * 1024 * 1024 * 1024;
}
} elseif ($this->attributes['auto_reset_bandwidth'] == 1) {
$user->transfer_enable = $value * 1024 * 1024 * 1024;
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
} else {
if ($this->attributes['auto_reset_bandwidth'] == 1) {
$user->transfer_enable=$value*1024*1024*1024;
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
} else {
$user->transfer_enable=$user->transfer_enable+$value*1024*1024*1024;
}
$user->transfer_enable += $value * 1024 * 1024 * 1024;
}
break;
case "expire":
if (time()>strtotime($user->expire_in)) {
$user->expire_in=date("Y-m-d H:i:s", time()+$value*86400);
case 'expire':
if (time() > strtotime($user->expire_in)) {
$user->expire_in = date('Y-m-d H:i:s', time() + $value * 86400);
} else {
$user->expire_in=date("Y-m-d H:i:s", strtotime($user->expire_in)+$value*86400);
$user->expire_in = date('Y-m-d H:i:s', strtotime($user->expire_in) + $value * 86400);
}
break;
case "class":
$user->class=$value;
$user->class_expire=date("Y-m-d H:i:s", time()+$content["class_expire"]*86400);
break;
case "speedlimit":
$user->node_speedlimit=$value;
case 'class':
if (Config::get('enable_bought_extend') == true) {
if ($user->class == $value) {
$user->class_expire = date('Y-m-d H:i:s', strtotime($user->class_expire) + $content['class_expire'] * 86400);
} else {
$user->class_expire = date('Y-m-d H:i:s', time() + $content['class_expire'] * 86400);
}
$user->class = $value;
} else {
$user->class = $value;
$user->class_expire = date('Y-m-d H:i:s', time() + $content['class_expire'] * 86400);
break;
}
case 'speedlimit':
$user->node_speedlimit = $value;
break;
case "connector":
$user->node_connector=$value;
case 'connector':
$user->node_connector = $value;
break;
default:
}

@ -0,0 +1,12 @@
<?php
namespace App\Models;
/**
* SmsVerify Model
*/
class SmsVerify extends Model
{
protected $connection = 'default';
protected $table = 'sms_verify';
}

@ -2,84 +2,78 @@
namespace App\Models;
/**
* Node Model
*/
use App\Utils\Tools;
class Speedtest extends Model
{
protected $connection = "default";
protected $table = "speedtest";
protected $connection = 'default';
protected $table = 'speedtest';
public function node()
{
return Node::find($this->attributes['nodeid']);
}
public function getTelecomPing()
{
$load = $this->attributes['telecomping'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getUnicomPing()
{
$load = $this->attributes['unicomping'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getCmccPing()
{
$load = $this->attributes['cmccping'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getTelecomUpload()
{
$load = $this->attributes['telecomeupload'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getTelecomDownload()
{
$load = $this->attributes['telecomedownload'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getUnicomUpload()
{
$load = $this->attributes['unicomupload'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getUnicomDownload()
{
$load = $this->attributes['unicomdownload'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getCmccDownload()
{
$load = $this->attributes['cmccdownload'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
public function getCmccUpload()
{
$load = $this->attributes['cmccupload'];
$exp = explode(" ", $load);
$exp = explode(' ', $load);
return $exp[0];
}
}

@ -5,25 +5,24 @@ namespace App\Models;
/**
* TelegramSession Model
*/
class TelegramSession extends Model
{
protected $connection = "default";
protected $table = "telegram_session";
protected $connection = 'default';
protected $table = 'telegram_session';
public function datetime()
{
return date("Y-m-d H:i:s", $this->attributes['datetime']);
return date('Y-m-d H:i:s', $this->attributes['datetime']);
}
public function User()
{
$user = User::where("id", $this->attributes['user_id'])->first();
$user = User::where('id', $this->attributes['user_id'])->first();
if ($user == null) {
Ticket::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
}

@ -0,0 +1,36 @@
<?php
namespace App\Models;
/**
* TelegramTasks Model
*
* 请勿重复使用 type
*
* type:
* = 1 删除消息
* = 2 储存 /setuser 操作产生的 messageid
*
*/
class TelegramTasks extends Model
{
protected $connection = 'default';
protected $table = 'telegram_tasks';
protected $casts = [
'type' => 'int',
'status' => 'int',
'chatid' => 'int',
'messageid' => 'int',
'userid' => 'int',
'tguserid' => 'int',
'executetime' => 'int',
'datetime' => 'int',
];
public function datetime()
{
return date('Y-m-d H:i:s', $this->attributes['datetime']);
}
}

@ -5,25 +5,24 @@ namespace App\Models;
/**
* Ticket Model
*/
class Ticket extends Model
{
protected $connection = "default";
protected $table = "ticket";
protected $connection = 'default';
protected $table = 'ticket';
public function datetime()
{
return date("Y-m-d H:i:s", $this->attributes['datetime']);
return date('Y-m-d H:i:s', $this->attributes['datetime']);
}
public function User()
{
$user = User::where("id", $this->attributes['userid'])->first();
$user = User::where('id', $this->attributes['userid'])->first();
if ($user == null) {
Ticket::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
}

@ -4,6 +4,6 @@ namespace App\Models;
class Token extends Model
{
protected $connection = "default";
protected $table = "user_token";
protected $connection = 'default';
protected $table = 'user_token';
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save