Compare commits

...

1700 Commits
v2.2.0 ... dev

Author SHA1 Message Date
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
GeekQu 42cf1b8749 Create README.md 7 years ago
GeekQu 31b53a0052 getPcClient 7 years ago
GeekQu f955323d3c getPcClient 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
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
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
GeekQu 53c9578796 解决 Quantumult SS 订阅提示无 group 的问题 7 years ago
GeekQu 6dab034a26 emoji 7 years ago
TheCGDF 275941191f V2rayU -> ssr-download 7 years ago
GeekQu 4a5b63fcfa Surge 4 以及 ClashR 显示 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
錢爸爸 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
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 2135c4c300 从 getAllItems 分离 SS V2RayPlugin 节点 7 years ago
GeekQu 8648e42477 加入用户订阅记录清理 7 years ago
GeekQu 5b3a57c5cc 优化可读性 7 years ago
GeekQu c29c14930a 修复使用 noclass 的问题 7 years ago
GeekQu db63baeb47 ??? 7 years ago
GeekQu 2373a4557a fix 7 years ago
GeekQu 6ecf279774 订阅可通过正则筛选节点 7 years ago
GeekQu 90fe6def61 ClashR 兼容性,用户手动修改订阅链接 clash=2 即可 7 years ago
GeekQu 11353c5364 Merge branch 'pr/39' into dev 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
Anankke 0619513890
fix: 修复不能识别$debug字段, 本地开发环境无法进入index的bug
py(划掉)pr
7 years ago
czn ecf3f67d04 fix: 修复不能识别$debug字段, 本地开发环境无法进入index的bug 7 years ago
GeekQu 99c70fa767 修改默认策略组更适合新手 7 years ago
GeekQu 10cc5c8764 fixed 7 years ago
GeekQu ec5091080f 修改 Surge、Clash、Surfboard 策略组 7 years ago
GeekQu e5f760e873 优化 Kitsunebi 订阅 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 00eaeaf7b4
Merge branch 'dev' into dev 7 years ago
GeekQu 39d22fc924 用户订阅日志可选是否开启,开启请注意导入 user_subscribe_log.sql 7 years ago
GeekQu 175de83e40 用户可查询订阅记录 7 years ago
GeekQu 8b7258e25a Merge branch 'pr/38' into dev 7 years ago
Rico 8fbc2c8118
Update README.md 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
wewall f850afdc2a
refactor(config): Use existing define 7 years ago
围墙 36bd068e58 fix: Telegram webhook not refreshing IP cache (#778) 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
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
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
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
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
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
SukkaW c1462619a9 docs(README): update
Change wiki url
7 years ago
TheCGDF 91f64376d0 mini修复:点击复制ios账户会提示“已拷贝订阅链接” 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
SukkaW b96873308c refactor(console): use console.table to show performance 7 years ago
SukkaW f4af6091cc fix(ticket/view): datetime container padding 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
imjonat 3dfcf13da2 fix: to fix server酱 恢复上线标题有误 (#736) 7 years ago
micll 4125b1cb4c fix Zxing_local (#728) 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
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
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
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
GeekQu 043bf5c0c3
Merge pull request #42 from GeekQu/dev
部分修改以及增加对 NAT 节点端口偏移支持
7 years ago
GeekQu 06595e2abd
Merge branch 'dev' into dev 7 years ago
GeekQu d4cb600d0e 再次 7 years ago
GeekQu a9104e94e4 修复233 7 years ago
GeekQu 7666bc7a09 +1s 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
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
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 7 years ago
GeekQu 24e4cbdd5e
Merge pull request #36 from Anankke/dev
Merge dev 20190628
7 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 f201f3f2d1 优化+1 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 d2592ed0d0 修复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 7d8014907c
fix nodeinfo 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
chen 379c5a8f1e chenPay中支付二维码窗口直接单击空白处产生问题 bug处理 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
围墙 17172e7554
使用本地 js 8 years ago
chen f399c539ef chenPay 付款二维码采用QrCode.js生成 bug修复 8 years ago
chen 1b0928e536 chenPay 付款二维码采用QrCode.js生成 8 years ago
chen 4ec61be187 chenPay bug处理 支付网页包含jquery 必须提前加载jquery。 8 years ago
chen 5133efd13c 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
围墙 a73065cb5e
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
NimaQu ac3f8e33ed
修复 smtp 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
NimaQu dc8364825d
update default value 8 years ago
NimaQu 42f74c5e32
update .config.php 8 years ago
NimaQu dd4c3497ec
change default value 8 years ago
laurier 7c82a16d59 修复部分响应式问题 8 years ago
NimaQu cd21fb91f8
fix premisson 8 years ago
laurier 643ccab5a6 修复select箭头及input颜色 8 years ago
围墙 845eea7c88
修正 Telegram 授权登陆逻辑错误 8 years ago
围墙 a107377b17
不再与上游 Surge 规则同步,感谢 @lhie1 提供规则的支持 8 years ago
laurier acab5bdb77 修复部分响应式问题 8 years ago
Tony Zou fc31826bee fix: cdn 8 years ago
Tony Zou 2739fe63ea Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev
# Conflicts:
#	resources/views/material/user/trimepay.tpl
8 years ago
Tony Zou b565275386 fix: payment success notification for trimepay 8 years ago
围墙 b830ab2082
Update README.md 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
NimaQu 2579f2a63d
typo 8 years ago
NimaQu 7be8cfda27
fix jscdn 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
NimaQu 887b780279 Update issue templates 8 years ago
NimaQu a357ccb313 Update issue templates 8 years ago
NimaQu 1908524f49 Update issue templates 8 years ago
NimaQu da310859be
fix premisson 8 years ago
Tony Zou 1bfcbbce04 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Tony Zou a7574adf4a fix: codepay 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
CGDF 9947a93d5a 删除行末句号,统一格式 8 years ago
CGDF ac1282e9b1 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 25aac78bfd 合并[SS/SSD]选项卡。删除旧版无用user表。 8 years ago
围墙 e29f13eddc
fix bug with #341 8 years ago
CGDF ab53cd15bb Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 12cfc06ca0 删除无用的node_admin 8 years ago
NimaQu 9d80f64911
typo 8 years ago
NimaQu 859c5b5ef0
fix default type 8 years ago
laurier 6f9234d103 VIP等级自动化显示 8 years ago
laurier 5d3610cb0c VIP等级自动化显示 8 years ago
laurier 04761668e7 “VIP等级自动化显示” 8 years ago
CGDF 20a1d863c9 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 49a734780d 加回smtp_username 8 years ago
围墙 427708e466
修复逻辑错误 8 years ago
Indexyz e385265281
fix: fix v2ray node display and traffice reset 8 years ago
Tony Zou c3137325dc fix: invoice number too long error&codepay. 8 years ago
laurier 6fa50ed3b2 删除多余代码 8 years ago
laurier 8c712ed0ae 重置邀请链接 8 years ago
錢爸爸 d3144e29f1
Console增加版權
log輸出站名與Github倉庫鏈接
8 years ago
chen a20b3e8ef4 ChenPay 修复bug 8 years ago
laurier c982daee87 config.php控制商店默认样式 8 years ago
chen 10c76aedc8 ChenPay 更改为Crontab似乎更加可控性与方便 8 years ago
Tony Zou 9109a90f79 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Tony Zou ac3ac996da fix: doiampay 8 years ago
NimaQu 4bb326bcc3
update 时清除 smarty 缓存 8 years ago
laurier ba4c1acdb5 样式位置调整 8 years ago
CGDF b14fe05fee 修复【修改商品价格后,自动续费时新价格不生效】的BUG 8 years ago
laurier fd73eda5b8 canvasJS样式修正 8 years ago
Tony Zou 97b5797881 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev
# Conflicts:
#	resources/views/material/user/aopf2f.tpl
8 years ago
Tony Zou a1543457ea fix: notification of payment success. 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
CGDF 8156b5be94 update composer 8 years ago
lifespy@qq.com 791b5a59a4 修复易付通支付 8 years ago
lifespy@qq.com fad57cbe95 Merge remote-tracking branch 'origin/dev' into dev 8 years ago
chen 79585e0b3b ChenPay 支付宝频繁问题更新
- log文件夹路径问题
8 years ago
chen c368d4e44c ChenPay 支付宝频繁问题更新
- 有订单情况下才是10秒一次的频率 杜绝支付宝风控
- 无订单情况下2分钟一次
8 years ago
NimaQu d8a6ff6fd2
update composer.lock 8 years ago
laurier b1312c5a84 fix flexbug 8 years ago
NimaQu 61bdad040a
typo 8 years ago
laurier 185310642a 卡片式商店 切换列表和卡片按钮 8 years ago
laurier d33960859e 卡片式商店 8 years ago
Tony Zou 68e5552ccd fix: generation of qrcode for f2f and trimepay. 8 years ago
NimaQu 97e86d96a0
fix payment none error 8 years ago
CGDF 8e5669986b 清理job重复代码 8 years ago
CGDF 20422bf3d3 config整理 8 years ago
CGDF 8122117979 合并account_expire_delete_days 8 years ago
CGDF 13d6132d9e 修复重置流量BUG 8 years ago
围墙 a55dc42bcd
一键替换了 35 - 1 个 抓不住的 Exception 8 years ago
CGDF 4e84af8505 合并auto_clean_uncheck_days 8 years ago
CGDF d337ab0d0f 修复job删除用户时的BUG。合并auto_clean_unused_days。 8 years ago
CGDF 709fc1093b 优化smtp配置。合并register_mode。 8 years ago
CGDF 22027a151d css调整 8 years ago
NimaQu 59fd73cd23
update composer.json 8 years ago
NimaQu db4adf11be
update composer.lock 8 years ago
CGDF 2143a1da4c 更新update 8 years ago
lifespy@qq.com 86050a031e 修复易付通支付 8 years ago
CGDF 3165707175 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 1baab50fb9 修复用户列表今日流量显示异常 8 years ago
lifespy@qq.com 43ef3c88c1 修复易付通支付 8 years ago
lifespy@qq.com d200ec664d 修复易付通支付 8 years ago
lifespy@qq.com bbe9741cab 修复易付通支付管理员查看 8 years ago
CGDF a832cffb2e 修复用户列表排序 8 years ago
CGDF a1521085a9 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 17d295e063 修复商品销量排序。修复用户列表随机性异常 8 years ago
xferget 511e6c266e 增加两步验证码输入框 (#335)
* 增加两步验证码输入框

* Update login.tpl
8 years ago
CGDF ae6bb0a5fd Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 84a9f92022 新增【周期销量统计】 8 years ago
lifespy@qq.com bd3cf637c3 修复易付通支付 8 years ago
CGDF 91b9ac4a3a Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 3f2bc28b88 完善分页。xcat update搬家。 8 years ago
lifespy@qq.com 0b81706fda 修复易付通支付 8 years ago
CGDF d78d066f37 清理残余config 8 years ago
CGDF 04fa1cd725 解除自删账户时的多余限制 8 years ago
CGDF 7c10f2564c Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 6e447a6f1e 用户列表改为分页加载。删除【查找用户】功能。 8 years ago
Tony Zou 2d0fec5910 fix: AopF2F notify error&TrimePay Wechat Pay purchasing error. 8 years ago
CGDF 23476f090c 调整cat update composer 8 years ago
CGDF f7aa824d8c Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF f7d49c80fc xcat update加入升级composer。SSD混淆字段调整 8 years ago
chen 5bedc82384 chenpay 支付宝多接口轮流切换以防被检查频繁封接口&log日志地址更改 8 years ago
Indexyz 9bc93031d1
fix(v2ray): fix transport enable in Quantumult 8 years ago
Indexyz ac381ec657
feat(v2ray): add json gentaure support for ws and tls 8 years ago
Indexyz d694ef61e6
Merge branch 'dev' of github.com:NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Indexyz 46cc4f6407
fix(v2ray): fix node template problem 8 years ago
围墙 eebf98cb25
fix bug 8 years ago
Indexyz fe3c5df2b2
feat(v2ray): redesign server and add extra args 8 years ago
NimaQu 10e0f717e1
add v2ray flag 8 years ago
CGDF 4a5940ebbe
Merge pull request #327 from kkren/patch-1
allow sync node ip for v2ray node
8 years ago
NimaQu 9dfeb73304
fix icon font 8 years ago
CGDF f565bad364
Merge pull request #330 from ithg/dev
fix checkjob
8 years ago
ithg 455d27f58b fix Job bug 8 years ago
Ti afbb00d080
Merge pull request #3 from NimaQu/dev
update
8 years ago
Tony Zou 622d7a8b8e fix: parameter error. 8 years ago
Tony Zou 24c92cad8a Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Tony Zou b2f39d9217 fix: Alipay F2F notify failed
feat: Added WechatPay support for Trime Pay
	Changed Alipay SDK to Omnipay-alipay
8 years ago
kkren 1b441ed450
allow sync node ip for v2ray node 8 years ago
CGDF a9f19bc0df 完善SSD混淆订阅 8 years ago
CGDF ac8d676f1f 修改SSD支持协议,修复混淆方式ajaxBUG 8 years ago
CGDF 91147c3df1 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF c7030d723d SSD订阅排序 8 years ago
chen 77619e410c chenpay email删减多余文字 8 years ago
CGDF da697aa981
Merge pull request #325 from ithg/dev
fix checkjob
8 years ago
Ti 2a43c2b258
Update Job.php
remove else{}
8 years ago
ithg afbb714c63 fix checkjob 8 years ago
Ti 779d48027e
Merge pull request #2 from NimaQu/dev
update
8 years ago
CGDF c1f108fca8 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 717850b968 为SSD新增混淆支持 8 years ago
chen 2d75b793dc chenpay 倒计时10秒多个0 8 years ago
chen 5b6b7d4905 chenpay jquery加载问题&log 时间 8 years ago
chen 9dd25235a6 chenpay 友好的log提示 8 years ago
chen 5ab635abef chenpay 样式问题 8 years ago
chen 4d4d3fa673 chenpay 重复提醒问题2&无法实时更新cookie问题 8 years ago
chen e64b16805f chenpay 重复提醒问题 8 years ago
chen fb6cf1573d chenpay支付重构 减少内存消耗 8 years ago
围墙 1ba343eb2a
邮件发送请求异常继续发送, 防止500 8 years ago
CGDF 91c95fb05e Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF ce214a2f33 修复【剩余流量不足】提醒BUG 8 years ago
chen 187ac7b81f chenpay支付重构 清除不必要&修复报错 8 years ago
NimaQu 9df7ebd23e Update issue templates 8 years ago
chen 8cace47ba0 chenpay支付重构 xcat监听更改 8 years ago
chen 4d0b3a9461 chenpay支付重构 删除订单 8 years ago
围墙 e3af9fa7a7
趁没人注意, 修复自己的写的 bug 8 years ago
chen 99aedf0a69 chenpay支付重构 修复&重构 8 years ago
chen 59e9787d79 chenpay支付重构 闭包问题 8 years ago
chen 8fa4caad35 chenpay支付重构 更改排队机制 可同时支付不同金额同支付方式,支付同金额不同支付方式 8 years ago
CGDF 28601a13fe SSD Android订阅教程 8 years ago
CGDF 98d2e20a37 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 9bd97c1c4e 补上use LinkController 8 years ago
chen b3f8512cd9 Merge remote-tracking branch 'NimaQu/dev' into dev 8 years ago
chen 2763fb32f1 chenpay支付重构 改用依赖 新监听方法 详细请看packagist chen-see/chen-pay 优化发送email部分【未测试】。。 8 years ago
dumplin233 30f6204f1b
Update LinkController.php 8 years ago
围墙 2e94b4713d
fix error 8 years ago
Tony Zou baf1b498aa feat: finishing reconstruction of payment gateway 8 years ago
NimaQu 483da09343
update gitignore 8 years ago
Tony Zou 1ad28d06cc
fix: type error. 8 years ago
CGDF 68c0351ad9 补充SSD订阅 8 years ago
CGDF 5317ba6a90 GFW检测config调整 8 years ago
CGDF 672850617c config对齐 8 years ago
CGDF 5ba2577eda Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF ec40a253ce 简化迁移附注 8 years ago
CGDF c16ec17ed5
Merge pull request #315 from wewall/patch-14
fix error
8 years ago
围墙 ceb4e08a59
fix error 8 years ago
CGDF 3f552e3627
Merge pull request #314 from wewall/patch-13
enable obfs
8 years ago
围墙 c1363f1eac
enable obfs 8 years ago
CGDF c24c1c7f86
Merge pull request #309 from lhie1/dev
Surge managed:Compatible with no obfs nodes
8 years ago
CGDF 1e22eedcf0
Update bug_report.md 8 years ago
CGDF 397f71b7a8
Merge pull request #311 from wewall/patch-11
Update AbstractPayment.php
8 years ago
围墙 fa5203ffca
Update AbstractPayment.php 8 years ago
Tony Zou 3d00db045b fix: class reference 8 years ago
Tony Zou 0582d79891 fix: Generate trade_no by uuid. 8 years ago
Tony Zou f23dc2968e refactor&fix&feat:
Add AopWapPay support for TrimePay.
Reduce function in class AbstractPayment.
8 years ago
Tony Zou ba2a25629d fix: Final. 8 years ago
Tony Zou 492226f6f2 fix: Authentication error. 8 years ago
Tony Zou f7bb67a10e fix: file privileges 8 years ago
Tony Zou 53bf4553ed fix: notify post method&payment success page 8 years ago
Tony Zou 12c5817b35 fix: data type 8 years ago
Tony Zou fd875d007e Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Tony Zou 98715ac796 新重构两个网关&TrimePay内测版接入 8 years ago
CGDF 98906feb35 修复【余量检测】BUG 8 years ago
lhie1 fde0cb81eb
Surge managed:Compatible with no obfs nodes
兼容无混淆节点
修改某个 Proxy Gourp 名称以得到更好的理解
增加 Auto 判断条件减少节点变动的可能性
8 years ago
CGDF cfa9d8c075 footer置底 8 years ago
CGDF bf811d5861
Merge pull request #306 from ithg/dev
Fix icon
8 years ago
ithg ec54f2b7e6 fix icon font 8 years ago
ithg 78eda400df fix icon font 8 years ago
CGDF ecfcf07598 修复config BUG 8 years ago
CGDF 34b135aca8 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF e2a9d615ad 可选加载JS模式 8 years ago
chen 788bad0251 chenpay支付响应重构 - 私有问题 8 years ago
chen 7d6873c33a chenpay支付响应重构 8 years ago
Tony Zou aba5eda22f 开始重构支付系统 8 years ago
CGDF 8692b8389d Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 4df9f98b10 【余量检测】迁移至CheckJob 8 years ago
Sukka 549da97968 Refactor: remove duplicate Material Icons (#299)
* Feat: add public cdn support for editor.md

* Feat: add public cdn support for shake & clipboard

* Refactor: update jquery, validation and dataTables

* Refactor: remove duplicated Material Icons

As it has already import by Google Fonts
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
CGDF 4467c1dc3d 修复【流量不足】bug 8 years ago
CGDF 968c975fba Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 9ddfa02f1d 重写【流量不足】提醒 8 years ago
NimaQu b76851c5ec
update Group link 8 years ago
CGDF 25f30bb27b 修复job.php的bug 8 years ago
CGDF 347df01125 修复firefox显示footer异常 8 years ago
CGDF 61a4cc293e Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 0df2cc9212 抽离【gfw被墙】判断代码 8 years ago
CGDF 62dc4853fb
Merge pull request #295 from ChenSee/dev
chenpay修复输入金额充值&手机刷新状态问题
8 years ago
chen 8f06e7b532 输入充值问题 8 years ago
chen b0cbb4ef09 手机端充值成功没提示问题 8 years ago
Sukka 9d98848584
merge(#3): from NimaQu/dev 8 years ago
Sukka f8803ed15d Feat/Refactor: add public cdn support & updates (#291)
* Feat: add public cdn support for editor.md

* Feat: add public cdn support for shake & clipboard

* Refactor: update jquery, validation and dataTables
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
chen a52e11068f 友好的提示(#289) 8 years ago
CGDF 71fdb9a479
Merge pull request #288 from ChenSee/dev
bug guzzlehttp/guzzle 5.3请求模式更改
8 years ago
chen 17fb3a9db6 Merge branch 'master' of https://github.com/ChenSee/ss-panel-v3-mod_Uim-alipay into dev 8 years ago
chen 4ccf47d450 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim 8 years ago
chen c06ef56e4a 修复新版6.6.2网络请求bug 8 years ago
chen 3c4a4dc664 修复新版6.6.2网络请求bug 8 years ago
chen b86ef10a67 Merge branch 'dev' of https://github.com/ChenSee/ss-panel-v3-mod_Uim-alipay 8 years ago
chen ac80a4d24b xposed获取修复 8 years ago
NimaQu 879b127a02
Merge pull request #278 from code-mx/dev
修复mu协议bug。
8 years ago
NimaQu 6b37fd6515
Merge pull request #282 from wewall/patch-7
fix Surge obfs error
8 years ago
NimaQu f86ed79392
Merge pull request #286 from SukkaW/dev
Feat/Refactor: Muilt minor changes
8 years ago
CGDF 544f6c3a51
Merge pull request #284 from ChenSee/dev
chenpay免签约支付宝与微信双支付,无需第三方软件支持
8 years ago
SukkaW 9e4af63c9d Feat: add public cdn support for font-awesome 8 years ago
SukkaW f5b44b5ad6 Refactor: remove useless file in editor.md lib 8 years ago
SukkaW 8b1f1cae7c Feat: add cdn support for emoji 8 years ago
chen 8c7cd6afea Merge branch 'dev' of https://github.com/ChenSee/ss-panel-v3-mod_Uim-alipay
# Conflicts:
#	README.md
8 years ago
chen 2c97344dcc Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Sukka 228b7a8cb1
Merge pull request #1 from NimaQu/dev 8 years ago
chen 948a633a7c readme 合并一行 8 years ago
Yihan Huang 3316130a7c Update ip database (#285) 8 years ago
chen e06e04987d Merge branch 'dev' of https://github.com/ChenSee/ss-panel-v3-mod_Uim-alipay 8 years ago
chen cc90683cce chenPay 其他支付问题 8 years ago
chen a4d9e88981 chenPay config 8 years ago
chen ece48618f8 Merge branch 'dev' of https://github.com/ChenSee/ss-panel-v3-mod_Uim-alipay 8 years ago
chen 9039870bad chenPay sql 8 years ago
chen beac750c8e chenPay 说明 8 years ago
chen 41206baea6 chenPay 说明 8 years ago
chen 530e687e34 Merge branch 'dev' of https://github.com/ChenSee/ss-panel-v3-mod_Uim-alipay into dev 8 years ago
chen ac0d27be2e chenPay 8 years ago
围墙 8855c3561f
fix Surge obfs error 8 years ago
NimaQu bf332be818
Merge pull request #281 from wewall/patch-6
/prpr@kotomei
8 years ago
围墙 3eec7faf6b
prpr 8 years ago
围墙 8819a6e75c
prpr 8 years ago
Mx 8a8b7243d0 修复mu协议bug。 8 years ago
CGDF 6a27b55f0f
Update README.md 8 years ago
mxihan e6c1a8d52d 优化config并添加注释(没错我就是来水的 8 years ago
NimaQu 15b57af3fc
Merge pull request #271 from SukkaW/dev
Feat: add public cdn support for javascript lib
8 years ago
SukkaW 058ad8fe38 Feat: add public cdn support for javascript lib 8 years ago
CGDF 6484671eeb 优化xcat update正则 8 years ago
CGDF f314649f10 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 1f371ad7d0 修复财务日报tg机器人显示错误 8 years ago
Tony Zou 90711ae9e0 no message 8 years ago
Tony Zou 1c068848bf Cloudflare支持,添加节点时自动更新记录 8 years ago
CGDF 9b787804b8 修复xcat update的一个神奇BUG 8 years ago
CGDF 72ff2a9f8e 修复中转规则排序 8 years ago
CGDF 1403f71ed9 修复中转节点显示bug。完善ssd中转节点支持。 8 years ago
CGDF 37e17f25cb 简化流量提醒config 8 years ago
CGDF 892bf6e31a 手动revert【一键倍增debug复杂度】 8 years ago
Tony Zou 05c7c40bec 修复无法注册的bug 8 years ago
CGDF 28ba2b4d14 修复未使用易付通时不能正常接收财务报表的BUG 8 years ago
CGDF 440b5c2179 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 9f7b54af3a 修复订阅分组BUG 8 years ago
Tony Zou ba4621a5ab 防止config文件更新 无法获取参数 8 years ago
Tony Zou 62fecf3ec0 新增机器人欢迎语 8 years ago
NimaQu feaaae0e6e
增加注册功能开关 8 years ago
Tony Zou da7d8dd99b config迁移备注 8 years ago
Tony Zou e23791ad7e fix: bug fix 8 years ago
Tony Zou 55ddf4df5c 新增用户流量过低邮件提醒,支持百分比/MB阀值。 8 years ago
CGDF b7213c6c42 国旗调整 8 years ago
CGDF 4fc7ced98a 修复smtp无法使用ssl的bug 8 years ago
CGDF c52963d821 修改email_nrcy.jpg 8 years ago

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

@ -0,0 +1,22 @@
# https://editorconfig.org/
root = true
[*]
tab_width = 4
[*.php]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
charset = utf-8
end_of_line = lf
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80

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

@ -1,11 +0,0 @@
---
name: Bug report
about: Bug 反馈
---
1.此项目为前端,不解决任何后端对接相关问题
2.提问前请先阅读 wiki,否则将会 close 并 block
3.有问题先去 https://demo.nimaqu.com 测试,再写明如何复现这个问题,否则按上条处理
4,issues 是反馈 bug / 提供建议的,不是问问题的,不会装自己去交流群花钱请人装
5.发 issues 之前麻烦把这些东西删了再发

@ -0,0 +1,49 @@
---
name: issue
about: temlpate
---
<!--
如果你不仔细填写下面的内容,我们可能会直接关闭你的 issue。
如果你没有仔细阅读 Wiki ,或者无关问题,我们可能会直接关闭你的 issue。
注意:Wiki 可能随时都会更新。在提交一个 issue 前,请重新查看相关内容。
如果你还有什么别的小问题请加入群组 https://t.me/SSUnion
不要用你的 issue 污染几百个 watchers 的邮箱
-->
**我确认我已经阅读了** (使用 "x" 选择)
- [ ] [项目 Wiki ](https://github.com/Anankke/SSPanel-Uim/wiki)
- [ ] [项目其他 issue](https://github.com/Anankke/SSPanel-Uim/issues?utf8=%E2%9C%93&q=is%3Aissue)
**我确认我做到了** (使用 "x" 选择)
- [ ] [将项目升级到当前分支最新版本](https://github.com/Anankke/SSPanel-Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC)
- [ ] 在[项目演示站](https://demo.nimaqu.com)成功复现问题
**我正在申请** (使用 "x" 选择)
- [ ] 反馈一个 bug
- [ ] 申请添加新的特性或功能或者好的想法
<!--
**反馈BUG**
1. 反馈之前先升级到分支的最新版本。
2.如果是页面问题(500 或 Slim Application Error ),请在 config 开启 debug 模式后截图或贴出输出内容,如果是某个按钮点击没反应,请打开浏览器开发者控制台(通常为 F12 ) ,贴出 console 输出内容。
-->
<!--从这一行往下写--我是分割线-->

43
.gitignore vendored

@ -1,9 +1,38 @@
.idea
.vs/
.htaccess
*/.DS_Store
.DS_Store
/vendor
/config/.config.php
/public/images/*.*
/public/theme/material/css/images/bg
/.idea
storage/qqwry.md5
.vs/
composer.lock
.php_cs.cache
.env
vendor
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/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
test/tpl_files.txt

@ -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,44 @@
# 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.
## 简体中文
### 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 消息必须简洁地包含你所有的修改。请不要仅使用「修复」、「改进」等字样。

@ -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,19 @@
根据时间从 2018 年 12 月始...
- 支持 Quantumult 格式的 V2Ray 订阅以及策略组配置导出
- 支持 Surge 2 & 3 的托管配置以及 policy group
- 支持 SurfBoard 的托管配置
- 支持 Shadowrocket 支持的 Shadowsocks(R) & VMess 合并订阅
- 提供用户使用文档
- 完全合并普通端口和单端口的订阅及托管
- ShadowsocksR 订阅中的账户及流量信息改为可选
- ~~一键切换 SS/SSR 加密、协议、混淆~~ (已废弃)
- 订阅链接兼容 Anankke
- ~~支持 ss-v2ray-plugin 类型节点~~ (已合并到 Anankke)
- V2Ray 订阅可选支持显示账户及流量信息
- 可选使用预定义的加密、协议、混淆配置方案
- 支持用户自定义 Surge 托管配置
- 支持用户自定义 Clash 托管配置
……

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 NimaQu
Copyright (c) 2019 Anankke
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

@ -1,41 +1,101 @@
# 欢迎使用ss panel v3 mod 再次修改版
<img src="https://cdn.jsdelivr.net/npm/skx@0.1.3/img/uim-logo-round.png" alt="logo" width="130" height="130" align="left" />
<h1>SSPanel UIM</h1>
**ss-panel-v3-mod**是一款专为shadowsocks设计的web前端面板,再次感谢ss-panel-v3-mod 的制作者,修改后的功能简介:
> Across the Great Wall we can reach every corner in the world
- **支付系统集成**:集成 支付宝当面付 黛米付 易付通 码支付等多种支付系统,使用方法见项目[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-%E5%AF%B9%E6%8E%A5%E6%95%99%E7%A8%8B)
<br/>
telegram水群:https://t.me/joinchat/GQehSEV7LEU1Z6E8aQ4z3w 参考91yun管理,除非是 bug ,各种疑难杂症提问请先带价(抱歉我们跟你不熟不会帮你免费解决)不然请自行离开
[![License](https://img.shields.io/github/license/Anankke/SSPanel-Uim?style=flat-square)](https://github.com/Anankke/SSPanel-Uim/blob/dev/LICENSE)
[![Travis Build Status](https://img.shields.io/travis/Anankke/SSPanel-UIM/master.svg?style=flat-square)](https://travis-ci.org/Anankke/SSPanel-Uim)
![GitHub repo size](https://img.shields.io/github/repo-size/anankke/sspanel-uim?style=flat-square&color=328657)
[![Telegram Channel](https://img.shields.io/badge/news-t.me%2Fsspanel_uim-0d86d7?style=flat-square)](https://t.me/sspanel_uim)
[![Telegram Chat](https://img.shields.io/badge/chat-t.me%2Fssunion-0d86d7?style=flat-square)](https://t.me/ssunion)
telegtam 频道 :https://t.me/sspanel_Uim
[演示站点](https://sspanel.host) | [使用文档](https://wiki.sspanel.host) | [更新日志](https://github.com/Anankke/SSPanel-Uim/releases) | [Telegram 频道](https://t.me/sspanel_uim) | [Telegram 水群](https://t.me/ssunion)
演示站: [demo.nimaqu.com](https://demo.nimaqu.com) 账号和密码都是 admin 对接节点的 mukey=NimaQu
## 简介
**原作者** [galaxychuck](https://github.com/galaxychuck)
SSPanel UIM 是一款专为 Shadowsocks / ShadowsocksR / V2Ray 设计的多用户管理面板,基于 ss-panel-v3-mod 开发。
[支持开发者请点我](https://github.com/NimaQu/ss-panel-v3-mod_UIM#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
## AD
## 搭建教程
**特别优惠 Malio SSPANEL 主题 + Rico V2Ray 后端,原价 1000 CNY,现在只需 899 CNY,👉[查看详情](https://malio.fxxkmy.life/)**
GitHub Wiki : https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%89%8D%E7%AB%AF%E5%AE%89%E8%A3%85
## 特性
Wiki已经启用,欢迎为此面板维护wiki
- 集成超过 8 种支付系统
- 重构面板首页、节点列表、商品列表;新增 SPA(Single Page Apps)版 UI
- 商品增加同时连接设备数,用户限速属性
- 新用户注册现金奖励、用户常规端口切换与指定
- 公共库文件加载使用 jsDelivr
- 支持 V2Ray
- 巨量性能优化
- 更多新功能写不下了
#### 鸣谢
## 安装
##### [galaxychuck](https://github.com/galaxychuck)
SSPanel UIM 的需要以下程序才能正常的安装和运行:
- 面板**原作者**
- Git
- MySQL
- PHP 7.2+
- Composer
#####[hkserversolution](https://www.hkserversolution.com/cart.php)
- Demo 演示站服务器赞助
SSPanel UIM 支持安装在 LNMP、宝塔面板、Plesk 面板、oneinstack 等集成环境中。安装教程请参阅 [文档](https://wiki.sspanel.host)。
##### [dumplin](https://github.com/dumplin233)
## 演示
[演示站](https://sspanel.host) 每天更新 `dev` 分支最新源码。
```
账号:admin
密码:admin
mukey ShirakamiFubuki
```
## 文档
> 我们安装,我们更新,我们开发
[SSPanel UIM 的文档](https://wiki.sspanel.host),在这里你可以找到大部分问题的解答。
## 贡献
[提出新想法 & 提交 Bug](https://github.com/Anankke/SSPanel-Uim/issues/new) | [改善文档 & 投稿](https://github.com/sspanel-uim/Wiki) | [Fork & Pull Request](https://github.com/Anankke/SSPanel-Uim/fork)
SSPanel UIM 欢迎各种贡献,包括但不限于改进,新功能,文档和代码改进,问题和错误报告。
## 协议
SSPanel UIM 使用 MIT License 开源、不提供任何担保。使用 SSPanel UIM 即表明,您知情并同意:
- 您在使用 SSPanel UIM 时,必须保留 Staff 页面(该页面包含了 MIT License)和页脚的 Staff 入口
- SSPanel UIM 不会对您的任何损失负责,包括但不限于服务中断、Kernel Panic、机器无法开机或正常使用、数据丢失或硬件损坏、原子弹爆炸、第三次世界大战、SCP 基金会无法阻止 SCP-3125 引发的全球 MK 级现实重构等
## 鸣谢
### [HKServerSolution](https://www.hkserversolution.com/cart.php)
Demo 演示站服务器赞助。
### [贡献者](https://github.com/Anankke/SSPanel-Uim/graphs/contributors)
SSPanel UIM 离不开所有 [贡献代码](https://github.com/Anankke/SSPanel-Uim/graphs/contributors) 和提交 Issue 的人。
<details>
<summary>查看贡献者</summary>
#### [Anankke](https://github.com/Anankke)
- 面板现 **维护者**
#### [galaxychuck](https://github.com/galaxychuck)
- 面板 **原作者**
##### [dumplin](https://github.com/dumplin233)
- 码支付对接 + 码支付当面付二合一
- 为面板加入 AFF 链接功能
@ -59,7 +119,7 @@ Wiki已经启用,欢迎为此面板维护wiki
- 节点负载情况显示&用户账户过期在首页弹窗提醒
- 增加返利列表
[**indexyz**](https://github.com/Indexyz)
[**Indexyz**](https://github.com/Indexyz)
- 为面板增加 v2Ray 功能
@ -67,33 +127,48 @@ Wiki已经启用,欢迎为此面板维护wiki
- 添加 Telegram OAuth
[**SoDa**](https://github.com/SoDa-GitHub)
[**CGDF**](https://github.com/CGDF-GitHub)
- 一键国旗
- 财务报表
- xcat一键update
- 被墙检测
- 适配SSD
- xcat 一键 update
- 适配 SSD
- 用户列表分页加载
##### 还有所有被引用过代码的同学,以及所有提交过issue的同学。
[**CHEN**](https://github.com/ChenSee)
#### 关于捐赠
- 免签约支付宝与微信,自带监听,不需第三方软件,直接到个人账户
您对我们的帮助将是支持我们做下去的动力,只需您在购买部分产品或向他人推荐产品时从我们的返利链接购买,这就是对我们很大的支持了。~~没有钱了,肯定要做啊,不做没有钱用啊,打工是不可能打工的,这辈子不可能打工的~~
[**laurieryayoi**](https://github.com/laurieryayoi)
##### dumplin
- 重做美化UI(~~援交~~圆角化)
- 新版 Vue(SPA) 版界面
- 重写节点列表,支持分级显示所有级别节点
- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
[**Sukka**](https://github.com/SukkaW)
- Travis CI 持续集成
- 单元测试
- 全站 JavaScript 重写
- 新版 Wiki 的搭建和维护
##### NimaQu
</details>
## 捐赠
您对我们的帮助将是支持我们做下去的动力。您可以直接进行捐赠,也可以在购买部分产品或向他人推荐产品时从我们的返利链接购买。
#### Anankke
- [Anankke 很可爱请给 Anankke 钱](https://t.me/anankke/5)
#### dumplin
- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
#### galaxychuck
- [魔方云 - 低成本极速高效 专属您的私有云](https://www.cubecloud.net/aff.php?aff=796)
- [hkserversolution-推荐UIM面板服务器放置](https://www.hkserversolution.com/aff.php?aff=60)
#### laurieryayoi
##### galaxychuck
[laurieryayoi 的前端课程报名](https://t.me/kinokonominoco)
- [黛米付-支付接入](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) {
echo $e->getMessage();
}
$text="";
$text = '';
}
}
$sts = new Analytics();
Telegram::Send("各位老爷少奶奶,我来为大家报告一下系统今天的运行状况哈~".
PHP_EOL.
"今日签到人数:".$sts->getTodayCheckinUser().PHP_EOL.
"今日使用总流量:".Tools::flowAutoShow($lastday_total).PHP_EOL.
"晚安~"
);
if (Config::get('sendDiary_Telegram') == 'true') {
Telegram::Send(
str_replace(
array(
'%getTodayCheckinUser%',
'%lastday_total%'
),
array(
$sts->getTodayCheckinUser(),
Tools::flowAutoShow($lastday_total)
),
Config::get('sendDiary_Msg')
)
);
}
}
@ -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,16 +14,16 @@ 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
], [
]);
'user' => $user, 'text' => $text
], [
]);
} catch (Exception $e) {
echo $e->getMessage();
}
@ -34,14 +35,14 @@ 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) {

@ -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,192 +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 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.
"昨日总收入笔数:".$sts->getTodayCheckinUser().PHP_EOL.
"昨日总收入金额:".Tools::flowAutoShow($lastday_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 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'];
}
$text_html.='<br>上周总收入笔数:'.$income_count.'<br>上周总收入金额:'.$income_total;
'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'];
}
}
$adminUser = User::where("is_admin", "=", "1")->get();
$text_html .= '<br>上周总收入笔数:' . $income_count . '<br>上周总收入金额:' . $income_total;
$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.
"上周总收入笔数:".$sts->getTodayCheckinUser().PHP_EOL.
"上周总收入金额:".Tools::flowAutoShow($lastday_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 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.
"上月总收入笔数:".$sts->getTodayCheckinUser().PHP_EOL.
"上月总收入金额:".Tools::flowAutoShow($lastday_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

@ -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,31 +147,31 @@ 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) {
@ -182,44 +179,44 @@ class SyncRadius
}
}
}
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);
}
}
}

@ -0,0 +1,141 @@
<?php
namespace App\Command;
use App\Services\Config;
class Update
{
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('开始升级客户端...' . 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);
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) {
echo('执行升级:0 -> 1');
$conn = mysqli_connect(Config::get('db_host'), Config::get('db_username'), Config::get('db_password'), Config::get('db_database'));
mysqli_query($conn, 'ALTER TABLE user ADD discord BIGINT NULL AFTER telegram_id');
}
}
}

@ -9,13 +9,17 @@ namespace App\Command;
use App\Models\User;
use App\Models\Relay;
use App\Services\Gateway\ChenPay;
use App\Utils\Hash;
use App\Utils\Tools;
use App\Utils\Discord;
use App\Services\Config;
use App\Utils\GA;
use App\Utils\QRcode;
use App\Utils\Update;
use App\Models\Node;
use App\Utils\DNSoverHTTPS;
use Exception;
use TelegramBot\Api\BotApi;
class XCat
{
@ -29,68 +33,80 @@ class XCat
public function boot()
{
switch ($this->argv[1]) {
case("install"):
return $this->install();
case("createAdmin"):
case ('alipay'):
return (new ChenPay())->AliPayListen();
case ('wxpay'):
return (new ChenPay())->WxPayListen();
case ('createAdmin'):
return $this->createAdmin();
case("resetTraffic"):
case ('resetTraffic'):
return $this->resetTraffic();
case("setTelegram"):
case ('setDiscord'):
return Discord::set();
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();
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();
default:
return $this->defaultAction();
}
@ -98,23 +114,25 @@ class XCat
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(' setDiscord - 设置 Discord 机器人' . 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();
@ -124,35 +142,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;
}
@ -160,48 +173,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;
@ -209,82 +227,146 @@ 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("设置成功!");
$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('设置成功!' . 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";
}
echo("finish....");
}
}
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;
}
}
}

@ -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,39 +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;
$text = $ann->content;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
echo $e;
}
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));
}
@ -70,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');
}
@ -80,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));
}
@ -104,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));
}
@ -117,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']);
});

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

@ -7,25 +7,27 @@ use App\Utils\Radius;
use App\Utils\Telegram;
use App\Utils\Tools;
use App\Controllers\AdminController;
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' => '节点地址', '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');
@ -39,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');
@ -52,40 +54,61 @@ 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;
}
Telegram::Send("新节点添加~".$request->getParam('name'));
$node->save();
$domain_name = explode('.' . Config::get('cloudflare_name'), $node->server);
if (Config::get('cloudflare_enable') == 'true') {
CloudflareDriver::updateRecord($domain_name[0], $node->node_ip);
}
if (Config::get('sendAddNode_Telegram') == 'true') {
Telegram::Send(
str_replace(
'%node_name%',
$request->getParam('name'),
Config::get('sendAddNode_Msg')
)
);
}
$rs['ret'] = 1;
$rs['msg'] = "节点添加成功";
$rs['msg'] = '节点添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -93,8 +116,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');
}
@ -103,87 +124,88 @@ 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 (!$success) {
$rs['ret'] = 0;
$rs['msg'] = '更新节点IP失败,请检查您输入的节点地址是否正确!';
return $response->getBody()->write(json_encode($rs));
}
if ($node->sort == 0 || $node->sort == 10) {
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 {
$ip = gethostbyname($request->getParam('server'));
if ($ip == "127.0.0.1") {
$ip = DNSoverHTTPS::gethostbyName($request->getParam('server'));
}
}
else {
Radius::AddNas(gethostbyname($request->getParam('server')), $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::get('sendUpdateNode_Telegram') == 'true') {
Telegram::Send(
str_replace(
'%node_name%',
$request->getParam('name'),
Config::get('sendUpdateNode_Msg')
)
);
}
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -192,22 +214,28 @@ 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::get('sendDeleteNode_Telegram') == 'true') {
Telegram::Send(
str_replace(
'%node_name%',
$node->name,
Config::get('sendDeleteNode_Msg')
)
);
}
$rs['ret'] = 1;
$rs['msg'] = "删除成功";
$rs['msg'] = '删除成功';
return $response->getBody()->write(json_encode($rs));
}
@ -216,107 +244,98 @@ 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' => '节点地址', '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;
}
$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', 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', 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('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;
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后端 ';
}
}
$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后端 请设置成 ' . $node_explode['port'];
} 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 (count($rules) > 0) {
$rs['ret'] = 0;
$rs['msg'] = 'v2ray中转一个起点一个rule';
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,21 @@ 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));
}
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -113,15 +140,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后端 请设置成' . $node_explode['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 +191,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 +220,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 +230,12 @@ class RelayController extends AdminController
if (!$rule->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));
}
@ -204,39 +252,44 @@ class RelayController extends AdminController
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));
}
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 +331,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 +345,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 +366,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']);
});

@ -5,7 +5,7 @@ namespace App\Controllers\Admin;
use App\Models\Shop;
use App\Models\Bought;
use App\Controllers\AdminController;
use App\Services\Config;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
@ -13,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" => "状态");
$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');
@ -33,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));
}
@ -92,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');
}
@ -102,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');
@ -211,48 +216,61 @@ 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));
}
public function ajax_shop($request, $response, $args)
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select id as op,id,name,price,content,auto_renew,auto_reset_bandwidth,status from shop');
$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', static function ($data) {
$shop = Shop::find($data['id']);
$period = Config::get('sales_period');
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;
});
$body = $response->getBody();
$body->write($datatables->generate());
}
@ -260,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;
@ -20,17 +21,16 @@ 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 +38,54 @@ 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();
$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();
}
$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();
}
}
}
$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 +93,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 +107,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 ? '开启' : '关闭';
});

@ -4,131 +4,263 @@ namespace App\Controllers\Admin;
use App\Models\User;
use App\Models\Ip;
use App\Models\RadiusBan;
use App\Models\Bought;
use App\Models\Relay;
use App\Models\DetectBanLog;
use App\Controllers\AdminController;
use App\Services\Config;
use App\Services\Auth;
use App\Services\Mail;
use App\Utils;
use App\Utils\Hash;
use App\Utils\Radius;
use App\Utils\QQWry;
use App\Utils\Wecenter;
use App\Utils\Check;
use App\Utils\Tools;
use App\Utils\GA;
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" => "群组", "account_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",
"is_enable" => "是否启用", "reg_date" => "注册时间",
"reg_location" => "注册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' => '连接混淆方式',
'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 createNewUser($request, $response, $args)
{
# 需要一个 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));
}
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"];
$text = $args['text'];
if (isset($request->getQueryParams()['page'])) {
$pageNum = $request->getQueryParams()['page'];
}
$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);
$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();
$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');
}
@ -136,8 +268,6 @@ class UserController extends AdminController
{
$id = $args['id'];
$user = User::find($id);
if ($user == null) {
}
return $this->view()->assign('edit_user', $user)->display('admin/user/edit.tpl');
}
@ -146,27 +276,26 @@ 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 +325,43 @@ 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'));
$detect_ban = (int)$request->getParam('detect_ban');
// 手动解封
if ($user->detect_ban == 1 && $detect_ban == 0) {
$user->detect_ban = 0;
}
// 手动封禁
if ($user->detect_ban == 0 && $detect_ban == 1) {
if ((int)$request->getParam('ban_time') == 0) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败,封禁时长不能为 0";
return $response->getBody()->write(json_encode($rs));
}
$user->detect_ban = 1;
$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 = (int)$request->getParam('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,69 +370,209 @@ 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)
{
$pageNum = 1;
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
//得到排序的方式
$order = $request->getParam('order')[0]['dir'];
//得到排序字段的下标
$order_column = $request->getParam('order')[0]['column'];
//根据排序字段的下标得到排序字段
$order_field = $request->getParam('columns')[$order_column]['data'];
$limit_start = $request->getParam('start');
$limit_length = $request->getParam('length');
$search = $request->getParam('search')['value'];
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 = User::skip(($pageNum - 1) * 100)->limit(100)->get();
$total_conut = User::count();
if($total_conut < $pageNum * 100) {
$res['next'] = 0;
$users = array();
$count_filtered = 0;
if ($search) {
$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(
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 {
$res['next'] = 1;
$users = User::orderByRaw($order_field . ' ' . $order)
->skip($limit_start)->limit($limit_length)
->get();
$count_filtered = User::count();
}
$res['data'] = array();
$data = array();
foreach ($users as $user) {
array_push($res['data'], $user->get_table_json_array());
$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" 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;
}
}
$tempdata['top_up'] = $user->get_top_up();
$data[] = $tempdata;
}
return $this->echoJson($response, $res);
}
$info = [
'draw' => $request->getParam('draw'), // ajax请求次数,作为标识符
'recordsTotal' => User::count(),
'recordsFiltered' => $count_filtered,
'data' => $data,
];
return json_encode($info, true);
}
}

@ -2,12 +2,11 @@
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;
use App\Utils\AliPay;
use App\Utils\Tools;
use App\Services\Analytics;
@ -31,6 +30,16 @@ class AdminController extends UserController
return $this->view()->assign('nodes', $nodes)->display('admin/node.tpl');
}
public function editConfig($request, $response, $args)
{
return (new ChenPay())->editConfig();
}
public function saveConfig($request, $response, $args)
{
return (new ChenPay())->saveConfig($request);
}
public function sys()
{
return $this->view()->display('admin/index.tpl');
@ -38,111 +47,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 find($request, $response, $args)
{
$id = $request->getParam('id');
$view=0;
if ($id) {
$view=1;
$userf=User::where("id", "=", $id)->first();
}
else {
$view=0;
$userf=User::where("id", "=", 0)->first();
}
return $this->view()->assign('view', $view)->assign('userf', $userf)->display('admin/find.tpl');
}
public function finduser($request, $response, $args)
public function chgInvite($request, $response, $args)
{
$username = $request->getParam('username');
$email = $request->getParam('email');
$port = $request->getParam('port');
if (!$username && !$email && !$port)
{
$res['ret'] = 0;
$res['msg'] = "没输入呀";
return $response->getBody()->write(json_encode($res));
}
if($username) {
$user=User::where("user_name", "=", $username)->first();
$id=$user->id;
}
if($email) {
$user=User::where("email", "=", $email)->first();
$id=$user->id;
}
if($port) {
$user=User::where("port", "=", $port)->first();
$id=$user->id;
}
if (!$id) {
$res['ret'] = 0;
$res['msg'] = "查无此人";
return $response->getBody()->write(json_encode($res));
}
$res['id']=$id;
$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'] = "稍等一下,正在查询";
$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');
@ -151,31 +138,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);
}
if (Coupon::where('code', $temp_code)->count() == 0) {
$final_code = $temp_code;
break;
}
}
}
$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');
$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');
}
@ -185,11 +201,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']);
});
@ -202,7 +218,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']);
});
@ -215,7 +231,7 @@ 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']);
});

@ -2,7 +2,6 @@
namespace App\Controllers;
use App\Models\InviteCode;
use App\Models\Node;
use App\Models\User;
use App\Services\Factory;
@ -14,7 +13,6 @@ use App\Utils\Helper;
/**
* ApiController
*/
class ApiController extends BaseController
{
public function index()
@ -26,13 +24,13 @@ class ApiController extends BaseController
$accessToken = $id = $args['token'];
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($token==null) {
if ($token == null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
$res['msg'] = 'token is null';
return $this->echoJson($response, $res);
}
$res['ret'] = 1;
$res['msg'] = "ok";
$res['msg'] = 'ok';
$res['data'] = $token;
return $this->echoJson($response, $res);
}
@ -40,8 +38,8 @@ class ApiController extends BaseController
public function newToken($request, $response, $args)
{
// $data = $request->post('sdf');
$email = $request->getParam('email');
$email = $request->getParam('email');
$email = strtolower($email);
$passwd = $request->getParam('passwd');
@ -50,94 +48,94 @@ class ApiController extends BaseController
if ($user == null) {
$res['ret'] = 0;
$res['msg'] = "401 邮箱或者密码错误";
$res['msg'] = '401 邮箱或者密码错误';
return $this->echoJson($response, $res);
}
if (!Hash::checkPassword($user->pass, $passwd)) {
$res['ret'] = 0;
$res['msg'] = "402 邮箱或者密码错误";
$res['msg'] = '402 邮箱或者密码错误';
return $this->echoJson($response, $res);
}
$tokenStr = Tools::genToken();
$storage = Factory::createTokenStorage();
$expireTime = time() + 3600*24*7;
$expireTime = time() + 3600 * 24 * 7;
if ($storage->store($tokenStr, $user, $expireTime)) {
$res['ret'] = 1;
$res['msg'] = "ok";
$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";
$res['msg'] = 'system error';
return $this->echoJson($response, $res);
}
public function node($request, $response, $args)
{
$accessToken = Helper::getTokenFromReq($request);
$accessToken = Helper::getParam($request, 'access_token');
$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);
$nodes = Node::where('sort', 0)->where('type', '1')->where(
static 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);
)->orderBy('name')->get();
$mu_nodes = Node::where('sort', 9)->where('node_class', '<=', $user->class)->where('type', '1')->where(
static function ($query) use ($user) {
$query->where('node_group', '=', $user->node_group)
->orWhere('node_group', '=', 0);
}
)->get();
$temparray=array();
)->orderBy('name')->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));
$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));
$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['msg'] = 'ok';
$res['data'] = $temparray;
return $this->echoJson($response, $res);
}
@ -145,19 +143,19 @@ class ApiController extends BaseController
public function userInfo($request, $response, $args)
{
$id = $args['id'];
$accessToken = Helper::getTokenFromReq($request);
$accessToken = Helper::getParam($request, 'access_token');
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($id != $token->userId) {
$res['ret'] = 0;
$res['msg'] = "access denied";
$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['msg'] = 'ok';
$res['data'] = $data;
return $this->echoJson($response, $res);
}

@ -7,10 +7,8 @@ use App\Services\Config;
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,9 +16,7 @@ use App\Services\Mail;
use App\Models\User;
use App\Models\LoginIp;
use App\Models\EmailVerify;
use App\Utils\Duoshuo;
use App\Utils\GA;
use App\Utils\Wecenter;
use App\Utils\Geetest;
use App\Utils\TelegramSessionManager;
@ -31,16 +27,23 @@ class AuthController extends BaseController
{
public function login()
{
$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 {
@ -54,24 +57,60 @@ class AuthController extends BaseController
->assign('login_number', $login_number)
->assign('telegram_bot', Config::get('telegram_bot'))
->assign('base_url', Config::get('baseUrl'))
->assign('recaptcha_sitekey', $recaptcha_sitekey)
->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 +120,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) {
@ -111,24 +150,21 @@ class AuthController extends BaseController
if (!$rcode) {
$res['ret'] = 0;
$res['msg'] = "两步验证码错误,如果您是丢失了生成器或者错误地设置了这个选项,您可以尝试重置密码,即可取消这个选项。";
$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 +178,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 +190,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 +210,66 @@ 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);
if (Config::get('enable_geetest_reg') == 'true') {
$GtSdk = Geetest::get($uid);
} else {
$GtSdk = null;
$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;
}
}
return $this->view()->assign('enable_invite_code', Config::get('enable_invite_code'))->assign('geetest_html', $GtSdk)->assign('enable_email_verify', Config::get('enable_email_verify'))->assign('code', $code)->display('auth/register.tpl');
return $this->view()
->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 +277,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,99 +285,128 @@ 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;
$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 registerHandle($request, $response, $next)
public function registerHandle($request, $response)
{
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'));
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));
}
}
//dumplin:1、enable_invite_code为true则注册必须要填邀请码;2、邀请人等级为0则邀请码不可用;3、邀请人invite_num为可邀请次数,填负数则为无限
//dumplin:1、邀请人等级为0则邀请码不可用;2、邀请人invite_num为可邀请次数,填负数则为无限
$c = InviteCode::where('code', $code)->first();
if ($c == null) {
if (Config::get('enable_invite_code') == '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) {
$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) {
$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));
}
// 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));
}
}
@ -339,30 +414,30 @@ 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();
}
// do reg user
@ -396,31 +471,29 @@ class AuthController extends BaseController
//dumplin:填写邀请人,写入邀请奖励
$user->ref_by = 0;
if ($c != null) {
if ($c->user_id != 0) {
$gift_user = User::where("id", "=", $c->user_id)->first();
$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->save();
}
if (($c != null) && $c->user_id != 0) {
$gift_user = User::where('id', '=', $c->user_id)->first();
$user->ref_by = $c->user_id;
$user->money = Config::get('invite_get_money');
$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();
@ -431,48 +504,54 @@ class AuthController extends BaseController
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) {
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');
@ -486,7 +565,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,34 +2,44 @@
namespace App\Controllers;
use App\Services\Auth;
use App\Models\User;
use App\Services\View;
use App\Services\Auth;
use Smarty;
/**
* 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();
}
/**
* Get smarty
*
* @return Smarty
*/
public function view()
{
return $this->smarty();
return $this->view;
}
/**
* @param $response
* @param $res

@ -22,31 +22,32 @@ class ClientApiController extends BaseController
{
public function GetAnnouncement($request, $response, $args)
{
$accessToken = Helper::getTokenFromReq($request);
$accessToken = Helper::getParam($request, 'access_token');
$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['msg'] = 'ok';
$res['data'] = $Anns;
return $this->echoJson($response, $res);
}
public function Redirect($request, $response, $args){
public function Redirect($request, $response, $args)
{
$user = Auth::getUser();
$url = $request->getQueryParams()["target"];
if(!$user->isLogin){
$accessToken = Helper::getTokenFromReq($request);
$url = $request->getQueryParams()['target'];
if (!$user->isLogin) {
$accessToken = Helper::getParam($request, 'access_token');
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($token==null) {
if ($token == null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
$res['msg'] = 'token is null';
return $this->echoJson($response, $res);
}
$user = User::find($token->userId);
$time = 3600*24;
$time = 3600 * 24;
Auth::login($user->id, $time);
}
return $response->withRedirect($url);
@ -54,18 +55,17 @@ class ClientApiController extends BaseController
public function GetSubLink($request, $response, $args)
{
$accessToken = Helper::getTokenFromReq($request);
$accessToken = Helper::getParam($request, 'access_token');
$sub = (Helper::getParam($request, 'sub') != ''
? Helper::getParam($request, 'sub')
: 1);
$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;
$res['msg'] = 'ok';
$res['data'] = Config::get('subUrl') . $ssr_sub_token . '?sub=' . $sub;
return $this->echoJson($response, $res);
}
}
}

@ -0,0 +1,575 @@
<?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 ($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 ($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)
{
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['Proxy'] = $Proxys;
if (isset($Configs['ProxyGroup'])) {
$tmp['Proxy Group'] = self::getClashConfProxyGroup(
$AllProxys,
$Configs['ProxyGroup']
);
} else {
$tmp['Proxy Group'] = 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)
{
// 加载本地规则文件
if ($local) {
$render = ConfRender::getTemplateRender();
return $render->fetch(trim($Rules['source']));
}
// 加载远程规则文件
$return = ('Rule:' . PHP_EOL);
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['Rule'])) {
$return .= $sourceContent;
} else {
$return .= Yaml::dump($sourceRule['Rule'], 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,20 +3,14 @@
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\Utils\Tools;
use App\Utils\Telegram;
use App\Utils\Tuling;
use App\Utils\AliPay;
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;
/**
* HomeController
@ -25,7 +19,49 @@ class HomeController extends BaseController
{
public function index()
{
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') != 'true' && Config::get('theme') == 'material') {
return $this->view()->display('indexold.tpl');
} else {
return $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 indexold()
{
return $this->view()->display('indexold.tpl');
}
public function code()
@ -35,70 +71,189 @@ class HomeController extends BaseController
}
public function down()
{
}
{ }
public function tos()
{
return $this->view()->display('tos.tpl');
}
public function staff()
{
return $this->view()->display('staff.tpl');
}
public function telegram($request, $response, $args)
{
$token = "";
if (isset($request->getQueryParams()["token"])) {
$token = $request->getQueryParams()["token"];
}
$token = $request->getQueryParams()['token'] ?? '';
if ($token == Config::get('telegram_request_token')) {
TelegramProcess::process();
} else {
echo("不正确请求!");
echo ('不正确请求!');
}
}
public function page404($request, $response, $args)
{
return $this->view()->display('404.tpl');
}
public function page405($request, $response, $args)
{
return $this->view()->display('405.tpl');
}
public function page500($request, $response, $args)
{
return $this->view()->display('500.tpl');
return $this->view()->display('500.tpl');
}
public function codepay_callback($request, $response, $args)
public function getOrderList($request, $response, $args)
{
echo '
<script>
window.location.href="/user/code";
</script>
';
return;
$key = $request->getParam('key');
if (!$key || $key != Config::get('key')) {
$res['ret'] = 0;
$res['msg'] = '错误';
return $response->getBody()->write(json_encode($res));
}
return $response->getBody()->write(json_encode(['data' => AliPay::getList()]));
}
public function pay_callback($request, $response, $args)
public function setOrder($request, $response, $args)
{
Pay::callback($request);
$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));
}
return $response->getBody()->write(json_encode(['res' => AliPay::setOrder($sn, $url)]));
}
public function f2fpay_pay_callback($request, $response, $args)
public function getDocCenter($request, $response, $args)
{
Pay::f2fpay_pay_callback($request);
$user = Auth::getUser();
if (!$user->isLogin && Config::get('enable_documents') != 'true') {
$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)
->display('doc/index.tpl');
}
public function codepay_pay_callback($request, $response, $args)
public function getSubLink($request, $response, $args)
{
Pay::codepay_pay_callback($request);
$user = Auth::getUser();
if (!$user->isLogin) {
return $msg = '!> ₍₍ ◝(・ω・)◟ ⁾⁾ 您没有登录噢,[点击此处登录](/auth/login \':ignore target=_blank\') 之后再刷新就阔以了啦';
} else {
$subInfo = LinkController::getSubinfo($user, 0);
switch ($request->getParam('type')) {
case 'ssr':
$msg = [
'**订阅链接:**',
'```',
$subInfo['ssr'] . '&extend=1',
'```'
];
break;
case 'v2ray':
$msg = [
'**订阅链接:**',
'```',
$subInfo['v2ray'] . '&extend=1',
'```'
];
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'] . '&extend=1',
'```'
];
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:
$msg = [
'获取失败了呢...,请联系管理员。'
];
break;
}
}
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,99 @@ 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;
}
if (Config::get('relay_port_migration') == 'true') {
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;
if (in_array($dis->sort, [0, 10])) {
$dis_server = explode(';', $dis->server);
$rule['dist_node_server'] = $dis_server[0];
} else {
$rule['dist_node_server'] = $dis->server;
}
if (in_array($dis->sort, [0, 10]) && strpos($dis->server, ';') !== false && $dis->mu_only != -1) {
$muPort = Tools::get_MuOutPortArray($dis->server);
$user = User::where('port', '=', $rule['port'])->first();
if ($user != null) {
if ($user->is_multi_user != 0) {
if ($muPort['type'] == 0) {
if (in_array($rule['port'], array_keys($muPort['port']))) {
$rule['port'] = $muPort['port'][$rule['port']];
}
} else {
$rule['port'] = ($rule['port'] + $muPort['type']);
}
}
}
}
} else {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = null;
$rule['dist_node_server'] = null;
}
}
} else {
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 +131,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 +142,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 +154,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 +185,8 @@ class FuncController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -122,14 +197,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 +231,8 @@ class FuncController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -167,14 +242,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 +259,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 +278,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 +303,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,34 @@ 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;
}
$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'
],
];
return $this->echoJson($response, $res);
@ -71,15 +77,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,11 @@ 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;
class UserController extends BaseController
{
@ -20,75 +22,145 @@ 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(
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(
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);
} 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("detect_ban", 0)->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("detect_ban", 0)->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;
}
}
}
$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');
$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');
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);
$user_raw->uuid = $user_raw->getUuid();
array_push($users, $user_raw);
if (Config::get('keep_connect') == 'true') {
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);
$user_raw->uuid = $user_raw->getUuid();
$users[] = $user_raw;
} else {
// 流量耗尽用户限速至 1Mbps
$user_raw = Tools::keyFilter($user_raw, $key_list);
$user_raw->uuid = $user_raw->getUuid();
$user_raw->node_speedlimit = 1;
$users[] = $user_raw;
}
}
} else {
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);
$user_raw->uuid = $user_raw->getUuid();
$users[] = $user_raw;
}
}
}
$res = [
"ret" => 1,
"data" => $users
'ret' => 1,
'data' => $users
];
return $this->echoJson($response, $res);
}
@ -101,15 +173,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 +194,7 @@ class UserController extends BaseController
$user = User::find($user_id);
if($user == NULL) {
if ($user == null) {
continue;
}
@ -132,8 +204,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 +233,8 @@ class UserController extends BaseController
$online_log->save();
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -173,15 +245,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 +273,8 @@ class UserController extends BaseController
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
@ -213,38 +285,139 @@ 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);
}
if (count($data) > 0) {
foreach ($data as $log) {
$list_id = $log['list_id'];
$user_id = $log['user_id'];
// log
$detect_log = new DetectLog();
$detect_log->user_id = $user_id;
$detect_log->list_id = $list_id;
$detect_log->node_id = $node_id;
$detect_log->datetime = time();
$detect_log->save();
if (Config::get('enable_auto_detect_ban') == 'true') {
$detect_Users = array();
if (count($data) > 0) {
foreach ($data as $log) {
$list_id = $log['list_id'];
$user_id = $log['user_id'];
// log
$detect_log = new DetectLog();
$detect_log->user_id = $user_id;
$detect_log->list_id = $list_id;
$detect_log->node_id = $node_id;
$detect_log->datetime = time();
$detect_log->save();
$User = User::find($user_id);
if ($User == null) {
continue;
}
if (!in_array($user_id, $detect_Users)) {
$detect_Users[] = $user_id;
}
$User->all_detect_number++;
$User->save();
}
}
if (count($detect_Users) > 0) {
self::DetectBan($detect_Users);
}
} else {
if (count($data) > 0) {
foreach ($data as $log) {
$list_id = $log['list_id'];
$user_id = $log['user_id'];
// log
$detect_log = new DetectLog();
$detect_log->user_id = $user_id;
$detect_log->list_id = $list_id;
$detect_log->node_id = $node_id;
$detect_log->datetime = time();
$detect_log->save();
}
}
}
$res = [
"ret" => 1,
"data" => "ok",
'ret' => 1,
'data' => 'ok',
];
return $this->echoJson($response, $res);
}
public function DetectBan($detect_Users)
{
foreach ($detect_Users as $user_id) {
$User = User::find($user_id);
if ($User == null) {
continue;
}
if ($User->detect_ban == 1 || ($User->is_admin && Config::get('auto_detect_ban_allow_admin') == 'true') || in_array($User->id, Config::get('auto_detect_ban_allow_users'))) {
continue;
}
if (Config::get('auto_detect_ban_type') == '1') {
$last_DetectBanLog = DetectBanLog::where('user_id', $user_id)->orderBy("id", "desc")->first();
$last_all_detect_number = (
$last_DetectBanLog == null
? 0
: (int) $last_DetectBanLog->all_detect_number
);
$detect_number = ($User->all_detect_number - $last_all_detect_number);
if ($detect_number >= Config::get('auto_detect_ban_number')) {
$last_detect_ban_time = $User->last_detect_ban_time;
$end_time = date('Y-m-d H:i:s');
$User->detect_ban = 1;
$User->last_detect_ban_time = $end_time;
$User->save();
$DetectBanLog = new DetectBanLog();
$DetectBanLog->user_name = $User->user_name;
$DetectBanLog->user_id = $User->id;
$DetectBanLog->email = $User->email;
$DetectBanLog->detect_number = $detect_number;
$DetectBanLog->ban_time = Config::get('auto_detect_ban_time');
$DetectBanLog->start_time = strtotime($last_detect_ban_time);
$DetectBanLog->end_time = strtotime($end_time);
$DetectBanLog->all_detect_number = $User->all_detect_number;
$DetectBanLog->save();
}
} else {
$number = $User->all_detect_number;
$tmp = 0;
foreach (Config::get('auto_detect_ban') as $key => $value) {
if ($number >= $key) {
if ($key >= $tmp) {
$tmp = $key;
}
}
}
if ($tmp != 0) {
if (Config::get('auto_detect_ban')[$tmp]['type'] == 'kill') {
$User->kill_user();
} else {
$last_detect_ban_time = $User->last_detect_ban_time;
$end_time = date('Y-m-d H:i:s');
$User->detect_ban = 1;
$User->last_detect_ban_time = $end_time;
$User->save();
$DetectBanLog = new DetectBanLog();
$DetectBanLog->user_name = $User->user_name;
$DetectBanLog->user_id = $User->id;
$DetectBanLog->email = $User->email;
$DetectBanLog->detect_number = $number;
$DetectBanLog->ban_time = Config::get('auto_detect_ban')[$tmp]['time'];
$DetectBanLog->start_time = strtotime('1989-06-04 00:05:00');
$DetectBanLog->end_time = strtotime($end_time);
$DetectBanLog->all_detect_number = $number;
$DetectBanLog->save();
}
}
}
}
}
}

@ -19,18 +19,18 @@ class NodeController extends BaseController
$log->log_time = time();
if (!$log->save()) {
$res = [
"ret" => 0,
"msg" => "update failed",
'ret' => 0,
'msg' => 'update failed',
];
return $this->echoJson($response, $res);
}
$res = [
"ret" => 1,
"msg" => "ok",
'ret' => 1,
'msg' => 'ok',
];
return $this->echoJson($response, $res);
}
public function info($request, $response, $args)
{
$node_id = $args['id'];
@ -43,14 +43,14 @@ class NodeController extends BaseController
$log->log_time = time();
if (!$log->save()) {
$res = [
"ret" => 0,
"msg" => "update failed",
'ret' => 0,
'msg' => 'update failed',
];
return $this->echoJson($response, $res);
}
$res = [
"ret" => 1,
"msg" => "ok",
'ret' => 1,
'msg' => 'ok',
];
return $this->echoJson($response, $res);
}

@ -13,66 +13,64 @@ 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);
$node = Node::where('node_ip', '=', $_SERVER['REMOTE_ADDR'])->where(
static function ($query) {
$query->where('sort', '=', 0)
->orWhere('sort', '=', 10)->orWhere('sort', '=', 12);
}
)->first();
$node->node_heartbeat=time();
$node->node_heartbeat = time();
$node->save();
if ($node->node_group!=0) {
if ($node->node_group != 0) {
$users_raw = User::where(
function ($query) use ($node){
static function ($query) use ($node) {
$query->where(
function ($query1) use ($node){
$query1->where("class", ">=", $node->node_class)
->where("node_group", "=", $node->node_group);
}
static function ($query1) use ($node) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group);
}
)->orwhere('is_admin', 1);
}
)
->where("enable", 1)->where("expire_in", ">", date("Y-m-d H:i:s"))->get();
->where('enable', 1)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
} else {
$users_raw = User::where(
function ($query) use ($node){
static function ($query) use ($node) {
$query->where(
function ($query1) use ($node){
$query1->where("class", ">=", $node->node_class);
}
static function ($query1) use ($node) {
$query1->where('class', '>=', $node->node_class);
}
)->orwhere('is_admin', 1);
}
)->where("enable", 1)->where("expire_in", ">", date("Y-m-d H:i:s"))->get();
)->where('enable', 1)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
}
if ($node->node_bandwidth_limit!=0) {
if ($node->node_bandwidth_limit<$node->node_bandwidth) {
$users=null;
$res = [
"ret" => 1,
"data" => $users
];
return $this->echoJson($response, $res);
}
if (($node->node_bandwidth_limit != 0) && $node->node_bandwidth_limit < $node->node_bandwidth) {
$users = null;
$res = [
'ret' => 1,
'data' => $users
];
return $this->echoJson($response, $res);
}
$key_list = array('method', 'id', 'port', 'passwd', 'u', 'd', 'enable',
't', 'transfer_enable', 'switch');
't', 'transfer_enable', 'switch', 'email');
$users_output = array();
foreach ($users as $user_raw) {
foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
array_push($users_output, $user_raw);
$users_output[] = $user_raw;
}
}
$res = [
"ret" => 1,
"msg" => "ok",
"data" => $users
'ret' => 1,
'msg' => 'ok',
'data' => $users_output
];
return $this->echoJson($response, $res);
}
@ -86,7 +84,7 @@ class UserController extends BaseController
$nodeId = $request->getParam('node_id');
$node = Node::find($nodeId);
$node->node_bandwidth=$node->node_bandwidth+$d+$u;
$node->node_bandwidth = $node->node_bandwidth + $d + $u;
$node->save();
@ -95,12 +93,12 @@ class UserController extends BaseController
$user = User::find($id);
$user->t = time();
$user->u = $user->u + ($u * $rate);
$user->d = $user->d + ($d * $rate);
$user->u += ($u * $rate);
$user->d += ($d * $rate);
if (!$user->save()) {
$res = [
"ret" => 0,
"msg" => "update failed",
'ret' => 0,
'msg' => 'update failed',
];
//return $this->echoJson($response, $res);
}
@ -116,8 +114,8 @@ class UserController extends BaseController
$traffic->save();
$res = [
"ret" => 1,
"msg" => "ok",
'ret' => 1,
'msg' => 'ok',
];
return $this->echoJson($response, $res);
}

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

@ -1,17 +0,0 @@
<?php
namespace App\Controllers;
class PayConfig{
public $pay_config;
public function init()
{
$this->pay_config = [
"notify_url" => "/yft/notify",
"return_url" => "/user/code",
"type" => "aliPay"
];
}
}

@ -1,107 +0,0 @@
<?php
namespace App\Controllers;
use app\Utils\YftOrderNumUtil;
class QuickPayFunction{
public function md5Verify($p1, $p2,$p3,$p4,$sign) {
$preStr = $p1.$p2.$p3.$p4;
$mySign = md5($preStr);
// echo $mySign;
if($mySign == $sign) {
return true;
}else {
return false;
}
}
/**
* 建立请求,以表单HTML形式构造(默认)
* @param $para_temp 请求参数数组
*
*/
public function buildRequestForm($para_temp,$ss_order_no,$pay_config) {
//待请求参数数组
$para = QuickPayFunction::buildRequestPara($para_temp);
$sHtml = "<form id='paysubmit' name='paysubmit' action='https://pay.anypay.me/pay/subOrder/zfb' accept-charset='utf-8' method='POST'>";
while (list ($key, $val) = each ($para)) {
$sHtml.= "<input type='hidden' name='".$key."' value='".$val."'/>";
}
if ($pay_config->pay_config["type"] == "aliPay"){
$sHtml .= "<input type='hidden' name='subject' value='余额充值'/>";
}else{
$sHtml .= "<input type='hidden' name='trade_no' value='".$ss_order_no."'/>";
}
//submit按钮控件请不要含有name属性
$sHtml = $sHtml."</form>";
$sHtml = $sHtml."<script>document.forms['paysubmit'].submit();</script>";
return $sHtml;
}
/**
* 生成要请求给云通付的参数数组
* @param $para_temp 请求前的参数数组
* @return 要请求的参数数组
*/
static function buildRequestPara($para_temp) {
//除去待签名参数数组中的空值和签名参数
$para_filter = QuickPayFunction::paraFilter($para_temp);
//生成签名结果
$mysign = QuickPayFunction::buildRequestMysign($para_filter);
//签名结果与签名方式加入请求提交参数组中
$para_filter['sign'] = $mysign;
return $para_filter;
}
/**
* 除去数组中的空值和签名参数
* @param $para 签名参数组
* return 去掉空值与签名参数后的新签名参数组
*/
static function paraFilter($para) {
$para_filter = array();
while (list ($key, $val) = each ($para)) {
if($key == "sign" || $val == "")continue;
else $para_filter[$key] = $para[$key];
}
return $para_filter;
}
/**
* 生成签名结果
* @param $para_filter 要签名的数组
* return 签名结果字符串
*/
static function buildRequestMysign($para_filter) {
//把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
$prestr = QuickPayFunction::createLinkstring($para_filter);
$mysign = MD5($prestr);
return $mysign;
}
static function md5Sign($prestr) {
return md5($prestr);
}
/**
* 把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
* @param $para 需要拼接的数组
* return 拼接完成以后的字符串
*/
static function createLinkstring($para) {
$arg = "";
while (list ($key, $val) = each ($para)) {
$arg.=$key."=".$val."&";
}
//去掉最后一个&字符
$arg = substr($arg,0,count($arg)-2);
//如果存在转义字符,那么去掉转义
if(get_magic_quotes_gpc()){$arg = stripslashes($arg);}
return $arg;
}
}

@ -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 = '<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);
@ -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 . ' → ' . '<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);
@ -115,41 +120,62 @@ 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('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();
foreach ($source_nodes as $node) {
if ($node->sort == 12) {
$node->name .= ' 正在使用V2ray后端 ';
}
}
$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)
->orWhere('sort', 12);
}
)->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);
foreach ($dist_nodes as $node) {
if ($node->sort == 11 || $node->sort == 12) {
$node_explode = Tools::v2Array($node->server);
$ports[] = $node_explode['port'];
$node->name = $node->name . ' 如果是V2ray后端 请设置成 ' . $node_explode['port'];
} else {
$node->name = $node->name . ' 如果是V2ray后端 请设置成 ' . $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 +189,72 @@ 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(
static function ($query) {
$query->Where('sort', 10)
->orWhere('sort', 12);
}
)->where('type', 1)->where('sort', 10)->where("node_class", "<=", $user->class)->first();
)->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)
->orWhere('sort', 12);
}
)->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();
$v2ray_port_raw = '';
if ($dist_node->sort == 12 || $dist_node->sort == 11) {
$node_explode = Tools::v2Array($dist_node->server);
$v2ray_port_raw = $node_explode['port'];
}
if (($port_raw == null && $port != $user->port && $v2ray_port_raw == '') || ($v2ray_port_raw != '' && ($port != $user->port && $port != $v2ray_port_raw))) {
$rs['ret'] = 0;
$rs['msg'] = "我和他谈笑风生";
$rs['msg'] = '端口错误';
return $response->getBody()->write(json_encode($rs));
}
@ -232,21 +279,21 @@ 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));
}
$rs['ret'] = 1;
$rs['msg'] = "添加成功";
$rs['msg'] = '添加成功';
return $response->getBody()->write(json_encode($rs));
}
@ -263,41 +310,61 @@ 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('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();
foreach ($source_nodes as $node) {
if ($node->sort == 12) {
$node->name .= ' 正在使用V2ray后端 ';
}
}
$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)
->orWhere('sort', 12);
}
)->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;
}
}
foreach ($dist_nodes as $node) {
if ($node->sort == 11 || $node->sort == 12) {
$node_explode = Tools::v2Array($node->server);
$ports[] = $node_explode['port'];
$node->name = $node->name . ' 如果是V2ray后端 请设置成: ' . $node_explode['port'];
} else {
$node->name = $node->name . ' 如果是V2ray后端 请设置成 ' . $user->port;
}
}
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 +384,63 @@ 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)
->orWhere('sort', 12);
}
)->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)
->orWhere('sort', 12);
}
)->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();
$v2ray_port_raw = '';
if ($dist_node->sort == 12 || $dist_node->sort == 11) {
$node_explode = Tools::v2Array($dist_node->server);
$v2ray_port_raw = $node_explode['port'];
}
if (($port_raw == null && $port != $user->port && $v2ray_port_raw == '') || ($v2ray_port_raw != '' && ($port != $user->port && $port != $v2ray_port_raw))) {
$rs['ret'] = 0;
$rs['msg'] = "西方的哪个国家我没去过";
$rs['msg'] = '端口错误';
return $response->getBody()->write(json_encode($rs));
}
@ -385,21 +464,21 @@ 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));
}
$rs['ret'] = 1;
$rs['msg'] = "修改成功";
$rs['msg'] = '修改成功';
return $response->getBody()->write(json_encode($rs));
}
@ -416,11 +495,11 @@ class RelayController extends UserController
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));
}
}

@ -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,440 @@
<?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\AliPay;
use App\Utils\Tools;
use App\Utils\TelegramSessionManager;
use App\Utils\Spay_tool;
use App\Utils\Geetest;
use App\Utils\URL;
use App\Models\Node;
use App\Models\Relay;
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'),
'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));
}
}

@ -1,127 +0,0 @@
<?php
/**
* Created by 傲慢与偏见.
* User: Administrator
* Date: 2017/11/21
* Time: 8:57
*
* 虽然代码开源,但是请别直接照搬好吗?直接照搬也别改的面目全非好吗?改的面目全非也别删除注释好吗?
*
* 抄代码之前想想为什么这样写,这样才能有提高。建议你去学学面向对象编程方式。
*
* 另外,我看了你的代码,真的写的很烂,乱。
*
*/
namespace App\Controllers;
use App\Models\Payback;
use App\Models\User;
use App\Models\YftOrder;
use App\Services\Config;
use App\Utils\Telegram;
class YFTPayCallBackController
{
public function yft_notify($request)
{
//价格
$total_fee = $request->getQueryParams()["total_fee"];//必填
//易付通返回的订单号
$yft_order_no = $request->getQueryParams()["trade_no"];
//面板生成的订单号
$ss_order_no = $request->getQueryParams()["out_trade_no"];//必填
//订单说明
$subject = $request->getQueryParams()["subject"];//必填
//付款状态
$trade_status = $request->getQueryParams()["trade_status"];//必填
//加密验证字符串
$sign = $request->getQueryParams()["sign"];//必填
$verifyNotify = YFTPayCallBackController::md5Verify(floatval($total_fee), $ss_order_no, $yft_order_no, $trade_status, $sign);
if ($verifyNotify) {//验证成功
if ($trade_status == 'TRADE_SUCCESS') {
/*
加入您的入库及判断代码;
>>>>>>>!!!为了保证数据传达到回调地址,会请求4次。所以必须要先判断订单状态,然后再插入到数据库,这样后面即使请求3次,也不会造成订单重复!!!!<<<<<<<
判断返回金额与实金额是否想同;
判断订单当前状态;
完成以上才视为支付成功
*/
$orderInfo = new YftOrder();
$orderInfo = $orderInfo->where("ss_order", "=", $ss_order_no)->first();
if ($orderInfo == "" || $orderInfo == null) {
return "fail";
}
if ($orderInfo->price != $total_fee) {
return "fail";
}
$userInfo = new User();
$userInfo = $userInfo->where("id", "=", $orderInfo->user_id)->first();
if (sizeof($orderInfo) != 0 && $orderInfo->state == 0) {
$oldMoney = $userInfo->money;
$userInfo->money = $total_fee + $oldMoney;
//更新用户余额信息
$userInfo->save();
//更新订单信息
$orderInfo->yft_order = $yft_order_no;
$orderInfo->state = 1;
$orderInfo->save();
//充值返利处理 start
if ($userInfo->ref_by != "" && $userInfo->ref_by != 0 && $userInfo->ref_by != null && Config::get('code_payback') != 0 && Config::get('code_payback') != null) {
$gift_user = User::where("id", "=", $userInfo->ref_by)->first();
$gift_user->money = ($gift_user->money + ($total_fee * (Config::get('code_payback') / 100)));
$gift_user->save();
$Payback = new Payback();
$Payback->total = $total_fee;
$Payback->userid = $userInfo->id;
$Payback->ref_by = $userInfo->ref_by;
$Payback->ref_get = $total_fee * (Config::get('code_payback') / 100);
$Payback->datetime = time();
$Payback->save();
}
//充值返利处理 end
//telegram提醒
if (Config::get('enable_donate') == 'true' && Config::get("enable_telegram") == 'true') {
if ($userInfo->is_hide == 1) {
Telegram::Send("感谢!一位不愿透露姓名的大老爷给我们捐了 " . $total_fee . " 元呢~");
} else {
Telegram::Send("感谢!" . $userInfo->user_name . " 大老爷给我们捐了 " . $total_fee . " 元呢~");
}
}
} else {
return "success";
}
return "success";
} else {
return "fail";
}
} else {
//验证失败
return "fail";
}
}
/**
* @param $p1
* @param $p2
* @param $p3
* @param $p4
* @param $sign 传入要比对的sign
* @return boolean 返回比对结果
*/
private static function md5Verify($p1, $p2, $p3, $p4, $sign)
{
$preStr = $p1 . $p2 . $p3 . $p4 . "yft";
$mySign = md5($preStr);
if ($mySign == $sign) {
return true;
} else {
return false;
}
}
}

@ -1,194 +0,0 @@
<?php
/**
* Created by 傲慢与偏见.
* OSUser: D-L
* Date: 2017/10/12
* Time: 21:08
*/
namespace App\Controllers;
use App\Models\User;
use App\Models\YftOrder;
use App\Services\Auth;
use App\Utils\YftOrderNumUtil;
use App\Services\Config;
class YftPay extends BaseController
{
private $user;
public function __construct()
{
$this->user = Auth::getUser();
}
public function yft($request, $response, $args)
{
$price = $request->getParams()['price'];
return $this->view()->assign('price', $price)->display('user/yft.tpl');
}
public function yftPay($request, $response, $args)
{
$yftLib = new QuickPayFunction();
$pay_config = new PayConfig();
$pay_config->init();
/**************************请求参数**************************/
//订单名称
$subject = $request->getParams()['subject'];//必填
//付款金额
$total_fee = $request->getParams()['total_fee'];//必填 需为整数
//服务器异步通知页面路径
$notify_url = $request->getUri()->getScheme()."://".$request->getUri()->getHost().$pay_config->pay_config['notify_url'];
//需http://格式的完整路径,不能加?id=123这类自定义参数
//页面跳转同步通知页面路径
$return_url = $request->getUri()->getScheme()."://".$request->getUri()->getHost().$pay_config->pay_config["return_url"];
//需http://格式的完整路径,不能加?id=123这类自定义参数,不能写成http://localhost/
$secret = Config::get('yft_secret');
$accesskey = Config::get('yft_accesskey');
//生成订单号
$ss_order_no = YftOrderNumUtil::generate_yftOrder(8);
/************************************************************/
//构造要请求的参数数组,无需改动
$parameter = [];
if ($pay_config->pay_config["type"] == "aliPay") {
$parameter = [
"total_fee" => $total_fee,
"notify_url" => $notify_url,
"return_url" => $return_url,
"secret" => $secret,
"out_trade_no" => $ss_order_no
];
} else {
$parameter = [
"secret" => $secret,
"notify_url" => $notify_url,
"accesskey" => $accesskey,
"return_url" => $return_url,
"subject" => $subject,
"total_fee" => $total_fee
];
}
//向数据库插入订单信息
$yft_order_info = new YftOrder();
$yft_order_info->user_id = $this->user->id;
$yft_order_info->ss_order = $ss_order_no;
$yft_order_info->price = $total_fee;
$yft_order_info->state = 0;
$yft_order_info->save();
//建立请求
$html_text = $yftLib->buildRequestForm($parameter, $ss_order_no,$pay_config);
return $html_text;
}
public function yftPayResult($request, $response, $args)
{
$newResponse = $response->withStatus(302)->withHeader('Location', '/user/code');
$yftLib = new QuickPayFunction();
$pay_config = new PayConfig();
$pay_config->init();
//价格
$total_fee = $request->getParams()['total_fee'];//必填
//付款状态
$trade_status = $request->getParams()['trade_status'];//必填
//加密验证字符串
$sign = $request->getParams()['sign'];//必填
//易付通返回的订单号
$yft_order_no = $request->getParams()['yft_order_no'];
//面板生成的订单号
$ss_order_no = $request->getParams()['ss_order_no'];//必填
$verifyNotify = $yftLib->md5Verify(floatval($total_fee), $trade_status, $pay_config->pay_config['secret'], $pay_config->pay_config['accesskey'], $sign);
if ($verifyNotify) {//验证成功
if ($_REQUEST['trade_status'] == 'success') {
/*
加入您的入库及判断代码;
>>>>>>>!!!为了保证数据传达到回调地址,会请求4次。所以必须要先判断订单状态,然后再插入到数据库,这样后面即使请求3次,也不会造成订单重复!!!!<<<<<<<
判断返回金额与实金额是否想同;
判断订单当前状态;
完成以上才视为支付成功
*/
$price = $request->getParams()['total_fee'];
$payInfo = YftOrder::where('ss_order', '=', $ss_order_no)->orderBy('id', 'desc')->first();
$user = User::where('id', '=', $payInfo->user_id)->orderBy('id', 'desc')->first();
if ($payInfo != null && $payInfo->state == 0) {
$old = $user->money;
$user->money = $price + $old;
$user->save();
$payInfo->yft_order = $yft_order_no;
$payInfo->state = 1;
$payInfo->save();
} else {
echo "订单号异常!请联系管理员!";
sleep(2);
return $newResponse;
}
echo "success";
return "success";
} else {
echo "fail";
return "fail";
}
} else {
//验证失败
echo "订单信息异常!请联系管理员";
sleep(2);
return $newResponse;
}
}
public function yftOrder($request, $response, $args)
{
$pageNum = 1;
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
}
$orderList = YftOrder::where("user_id", $this->user->id)->orderBy("id", "asc")->paginate(15, ['*'], 'page', $pageNum);
$count = sizeof(YftOrder::where("user_id", $this->user->id)->get());
$countPage = ceil($count / 15);
$orderList->setPath('/user/yftOrder');
return $this->view()->assign('orderList', $orderList)->assign('countPage', $countPage)->assign('currentPage', $pageNum)->display('user/yftOrder.tpl');
}
/**
* @desc 管理员查看所有充值记录
* @param $request
* @param $response
* @param $args
* @return mixed
*/
public function yftOrderForAdmin($request, $response, $args)
{
$pageNum = 1;
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
}
$orderList = YftOrder::where("price",">=", 0)->orderBy("id", "asc")->paginate(15, ['*'], 'page', $pageNum);
$count = sizeof(YftOrder::where("price",">=", 0)->get());
$countPage = ceil($count / 15);
$orderList->setPath('/admin/yftOrder');
return $this->view()->assign('orderList', $orderList)->assign('countPage', $countPage)->assign('currentPage', $pageNum)->display('admin/yftOrder.tpl');
}
}

@ -5,7 +5,6 @@ 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
{
@ -22,7 +21,7 @@ class Admin
$newResponse = $response->withStatus(302)->withHeader('Location', '/user');
return $newResponse;
}
$response = $next($request, $response);
return $response;
}

@ -11,24 +11,24 @@ class Api
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
{
$accessToken = Helper::getTokenFromReq($request);
if ($accessToken==null) {
$accessToken = Helper::getParam($request, 'access_token');
if ($accessToken == null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
$res['msg'] = 'token is null';
$response->getBody()->write(json_encode($res));
return $response;
}
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
if ($token==null) {
if ($token == null) {
$res['ret'] = 0;
$res['msg'] = "token is null";
$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";
$res['msg'] = 'token is expire';
$response->getBody()->write(json_encode($res));
return $response;
}

@ -5,9 +5,6 @@ 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
{
@ -18,28 +15,11 @@ class Auth
$newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login');
return $newResponse;
}
if ($user->enable == 0 && $_SERVER["REQUEST_URI"] != "/user/disable") {
$enablePages = array('/user/disable', '/user/backtoadmin', '/user/logout');
if ($user->enable == 0 && !in_array($_SERVER['REQUEST_URI'], $enablePages)) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/user/disable');
return $newResponse;
}
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);
}
$response = $next($request, $response);
return $response;
}

@ -12,8 +12,7 @@ class Guest
{
$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;

@ -6,7 +6,6 @@ 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;
@ -14,34 +13,34 @@ class Mod_Mu
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
{
$key = Helper::getMuKeyFromReq($request);
if ($key == null) {
$key = Helper::getParam($request, 'key');
if ($key === null) {
$res['ret'] = 0;
$res['data'] = "key is null";
$res['data'] = '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;
$auth = false;
$keys = Config::getMuKey();
foreach ($keys as $k) {
if ($key == $k) {
$auth = true;
break;
}
}
if ($auth==false) {
$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";
$res['data'] = 'token or source is invalid, Your ip address is ' . $_SERVER['REMOTE_ADDR'];
$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') {
if ($auth == false) {
$res['ret'] = 0;
$res['data'] = "token or source is invalid";
$res['data'] = 'token or source is invalid';
$response->getBody()->write(json_encode($res));
return $response;
}

@ -6,7 +6,6 @@ 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;
@ -14,34 +13,34 @@ class Mu
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next)
{
$key = Helper::getMuKeyFromReq($request);
if ($key == null) {
$key = Helper::getParam($request, 'key');
if ($key === null) {
$res['ret'] = 0;
$res['msg'] = "key is null";
$res['msg'] = 'key is null';
$response->getBody()->write(json_encode($res));
return $response;
}
$auth=false;
$keyset=explode(",", Config::get('muKey'));
$auth = false;
$keyset = explode(',', Config::get('muKey'));
foreach ($keyset as $sinkey) {
if ($key==$sinkey) {
$auth=true;
if ($key == $sinkey) {
$auth = true;
break;
}
}
if ($auth==false) {
if ($auth == false) {
$res['ret'] = 0;
$res['msg'] = "token or source is invalid";
$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') {
$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";
$res['msg'] = 'token or source is invalid';
$response->getBody()->write(json_encode($res));
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,23 +2,19 @@
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,32 @@ 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();
}
}

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

@ -0,0 +1,9 @@
<?php
namespace App\Models;
class Config extends Model
{
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';
}

@ -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;

@ -7,11 +7,11 @@ namespace App\Models;
*/
use App\Utils\Tools;
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 +34,7 @@ class Node extends Model
{
$log = $this->getLastNodeInfoLog();
if ($log == null) {
return "暂无数据";
return '暂无数据';
}
return Tools::secondsToTime((int)$log->uptime);
}
@ -43,31 +43,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 +86,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 +100,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 +114,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 +122,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 +142,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;
}

@ -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';
}

@ -6,193 +6,177 @@ use App\Services\Config;
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;
$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:
}

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

@ -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';
}

@ -7,39 +7,39 @@ use App\Utils\Tools;
class TrafficLog extends Model
{
protected $connection = "default";
protected $table = "user_traffic_log";
protected $connection = 'default';
protected $table = 'user_traffic_log';
public function node()
{
$node = Node::where("id", $this->attributes['node_id'])->first();
$node = Node::where('id', $this->attributes['node_id'])->first();
if ($node == null) {
TrafficLog::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $node;
}
return $node;
}
public function user()
{
$user = User::where("id", $this->attributes['user_id'])->first();
$user = User::where('id', $this->attributes['user_id'])->first();
if ($user == null) {
TrafficLog::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
public function totalUsed()
{
return Tools::flowAutoShow($this->attributes['u'] + $this->attributes['d']);
}
public function totalUsedRaw()
{
return number_format(($this->attributes['u'] + $this->attributes['d'])/1024, 2, ".", "");
return number_format(($this->attributes['u'] + $this->attributes['d']) / 1024, 2, '.', '');
}
public function logTime()

@ -3,26 +3,24 @@
namespace App\Models;
use App\Utils\Tools;
class UnblockIp extends Model
{
protected $connection = "default";
protected $table = "unblockip";
protected $connection = 'default';
protected $table = 'unblockip';
public function user()
{
$user = User::where("id", $this->attributes['userid'])->first();
$user = User::where('id', $this->attributes['userid'])->first();
if ($user == null) {
UnblockIp::where('id', '=', $this->attributes['id'])->delete();
self::where('id', '=', $this->attributes['id'])->delete();
return null;
} else {
return $user;
}
return $user;
}
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']);
}
}

@ -8,31 +8,30 @@ namespace App\Models;
use App\Utils\Tools;
use App\Utils\Hash;
use App\Models\InviteCode;
use App\Services\Config;
use App\Utils\GA;
use App\Utils\QQWry;
use App\Models\Link;
use App\Utils\Wecenter;
use App\Utils\Radius;
use Ramsey\Uuid\Uuid;
use App\Models\DetectLog;
use App\Models\DetectBanLog;
class User extends Model
{
protected $connection = "default";
protected $table = "user";
protected $connection = 'default';
protected $table = 'user';
public $isLogin;
public $isAdmin;
protected $casts = [
"t" => 'float',
"u" => 'float',
"d" => 'float',
"port" => 'int',
"transfer_enable" => 'float',
"enable" => 'int',
't' => 'float',
'u' => 'float',
'd' => 'float',
'port' => 'int',
'transfer_enable' => 'float',
'enable' => 'int',
'is_admin' => 'boolean',
'is_multi_user' => 'int',
'node_speedlimit' => 'float',
@ -40,8 +39,8 @@ class User extends Model
public function getGravatarAttribute()
{
// $hash = md5(strtolower(trim($this->attributes['email'])));
return "/images/Avatar.jpg";//.$hash;
$hash = md5(strtolower(trim($this->attributes['email'])));
return 'https://gravatar.loli.net/avatar/' . $hash;
}
public function isAdmin()
@ -52,22 +51,26 @@ class User extends Model
public function lastSsTime()
{
if ($this->attributes['t'] == 0) {
return "从未使用喵";
return '从未使用喵';
}
return Tools::toDateTime($this->attributes['t']);
}
public function getMuMd5()
{
$str = str_replace("%id", $this->attributes['id'], Config::get('mu_regex'));
$str = str_replace("%suffix", Config::get('mu_suffix'), $str);
$str = str_replace(
array('%id', '%suffix'),
array($this->attributes['id'], Config::get('mu_suffix')),
Config::get('mu_regex')
);
preg_match_all("|%-?[1-9]\d*m|U", $str, $matches, PREG_PATTERN_ORDER);
foreach ($matches[0] as $key) {
$key_match = str_replace("%", "", $key);
$key_match = str_replace("m", "", $key_match);
$md5 = substr(MD5($this->attributes['id'].$this->attributes['passwd'].$this->attributes['method'].$this->attributes['obfs'].$this->attributes['protocol']),
($key_match < 0 ? $key_match : 0),
abs($key_match));
$key_match = str_replace(array('%', 'm'), '', $key);
$md5 = substr(
MD5($this->attributes['id'] . $this->attributes['passwd'] . $this->attributes['method'] . $this->attributes['obfs'] . $this->attributes['protocol']),
($key_match < 0 ? $key_match : 0),
abs($key_match)
);
$str = str_replace($key, $md5, $str);
}
return $str;
@ -76,7 +79,7 @@ class User extends Model
public function lastCheckInTime()
{
if ($this->attributes['last_check_in_time'] == 0) {
return "从未签到";
return '从未签到';
}
return Tools::toDateTime($this->attributes['last_check_in_time']);
}
@ -94,12 +97,12 @@ class User extends Model
public function get_forbidden_ip()
{
return str_replace(",", PHP_EOL, $this->attributes['forbidden_ip']);
return str_replace(',', PHP_EOL, $this->attributes['forbidden_ip']);
}
public function get_forbidden_port()
{
return str_replace(",", PHP_EOL, $this->attributes['forbidden_port']);
return str_replace(',', PHP_EOL, $this->attributes['forbidden_port']);
}
public function updateSsPwd($pwd)
@ -118,20 +121,23 @@ class User extends Model
{
$uid = $this->attributes['id'];
$code = new InviteCode();
$code->code = Tools::genRandomChar(32);
$code->user = $uid;
while (true) {
$temp_code = Tools::genRandomChar(4);
if (InviteCode::where('user_id', $uid)->count() == 0) {
break;
}
}
$code->code = $temp_code;
$code->user_id = $uid;
$code->save();
}
public function getUuid() {
return Uuid::uuid3(Uuid::NAMESPACE_DNS, $this->attributes['id']. '|' .$this->attributes['passwd'])->toString();
}
public function addManyInviteCodes($num)
public function getUuid()
{
for ($i = 0; $i < $num; $i++) {
$this->addInviteCode();
}
return Uuid::uuid3(
Uuid::NAMESPACE_DNS,
$this->attributes['id'] . '|' . $this->attributes['passwd']
)->toString();
}
public function trafficUsagePercent()
@ -143,7 +149,7 @@ class User extends Model
}
$percent = $total / $transferEnable;
$percent = round($percent, 2);
$percent = $percent * 100;
$percent *= 100;
return $percent;
}
@ -152,16 +158,19 @@ class User extends Model
$transfer_enable = $this->attributes['transfer_enable'];
return Tools::flowAutoShow($transfer_enable);
}
public function enableTrafficInGB()
{
$transfer_enable = $this->attributes['transfer_enable'];
return Tools::flowToGB($transfer_enable);
}
public function usedTraffic()
{
$total = $this->attributes['u'] + $this->attributes['d'];
return Tools::flowAutoShow($total);
}
public function unusedTraffic()
{
$total = $this->attributes['u'] + $this->attributes['d'];
@ -171,7 +180,7 @@ class User extends Model
public function TodayusedTraffic()
{
$total = $this->attributes['u'] + $this->attributes['d']-$this->attributes['last_day_t'];
$total = $this->attributes['u'] + $this->attributes['d'] - $this->attributes['last_day_t'];
return Tools::flowAutoShow($total);
}
@ -186,10 +195,7 @@ class User extends Model
$last = $this->attributes['last_check_in_time'];
$now = time();
if (date("Ymd", $now)!= date("Ymd", $last)) {
return true;
}
return false;
return date('Ymd', $now) != date('Ymd', $last);
}
/*
@ -202,7 +208,10 @@ class User extends Model
public function getGAurl()
{
$ga = new GA();
$url = $ga->getUrl(urlencode(Config::get('appName')."-".$this->attributes['user_name']."-两步验证码"), $this->attributes['ga_token']);
$url = $ga->getUrl(
urlencode(Config::get('appName') . '-' . $this->attributes['user_name'] . '-两步验证码'),
$this->attributes['ga_token']
);
return $url;
}
@ -215,7 +224,7 @@ class User extends Model
public function ref_by_user()
{
$uid = $this->attributes['ref_by'];
return User::where('id', $uid)->first();
return self::where('id', $uid)->first();
}
public function clean_link()
@ -224,20 +233,26 @@ class User extends Model
Link::where('userid', $uid)->delete();
}
public function clear_inviteCodes()
{
$uid = $this->attributes['id'];
InviteCode::where('user_id', $uid)->delete();
}
public function online_ip_count()
{
$uid = $this->attributes['id'];
$total = Ip::where("datetime", ">=", time()-90)->where('userid', $uid)->orderBy('userid', 'desc')->get();
$total = Ip::where('datetime', '>=', time() - 90)->where('userid', $uid)->orderBy('userid', 'desc')->get();
$unique_ip_list = array();
foreach ($total as $single_record) {
$single_record->ip = Tools::getRealIp($single_record->ip);
$is_node = Node::where("node_ip", $single_record->ip)->first();
if($is_node) {
$is_node = Node::where('node_ip', $single_record->ip)->first();
if ($is_node) {
continue;
}
if (!in_array($single_record->ip, $unique_ip_list)) {
array_push($unique_ip_list, $single_record->ip);
$unique_ip_list[] = $single_record->ip;
}
}
@ -267,8 +282,6 @@ class User extends Model
Token::where('user_id', '=', $uid)->delete();
PasswordReset::where('email', '=', $email)->delete();
Wecenter::Delete($email);
$this->delete();
return true;
@ -278,7 +291,7 @@ class User extends Model
{
$id = $this->attributes['id'];
$today_traffic = Tools::flowToMB($this->attributes['u'] + $this->attributes['d'] - $this->attributes['last_day_t']);
$is_enable = $this->attributes['enable'] == 1 ? "可用" : "禁用";
$is_enable = $this->attributes['enable'] == 1 ? '可用' : '禁用';
$reg_location = $this->attributes['reg_ip'];
$account_expire_in = $this->attributes['expire_in'];
$class_expire_in = $this->attributes['class_expire'];
@ -287,56 +300,157 @@ class User extends Model
$im_type = '';
$im_value = $this->attributes['im_value'];
switch($this->attributes['im_type']) {
switch ($this->attributes['im_type']) {
case 1:
$im_type = '微信';
break;
$im_type = '微信';
break;
case 2:
$im_type = 'QQ';
break;
$im_type = 'QQ';
break;
case 3:
$im_type = 'Google+';
break;
$im_type = 'Google+';
break;
default:
$im_type = 'Telegram';
$im_value = '<a href="https://telegram.me/'.$im_value.'">'.$im_value.'</a>';
$im_type = 'Telegram';
$im_value = '<a href="https://telegram.me/' . $im_value . '">' . $im_value . '</a>';
}
$ref_user = User::find($this->attributes['ref_by']);
$ref_user = self::find($this->attributes['ref_by']);
if ($this->attributes['ref_by'] == 0) {
$ref_user_id = 0;
$ref_user_name = "系统邀请";
$ref_user_name = '系统邀请';
} elseif ($ref_user == null) {
$ref_user_id = $this->attributes['ref_by'];
$ref_user_name = '邀请人已经被删除';
} else {
if ($ref_user == null) {
$ref_user_id = $this->attributes['ref_by'];
$ref_user_name = "邀请人已经被删除";
} else {
$ref_user_id = $this->attributes['ref_by'];
$ref_user_name = $ref_user->user_name;
}
$ref_user_id = $this->attributes['ref_by'];
$ref_user_name = $ref_user->user_name;
}
$iplocation = new QQWry();
$location=$iplocation->getlocation($reg_location);
$reg_location .= "\n".iconv('gbk', 'utf-8//IGNORE', $location['country'].$location['area']);
$return_array = Array('DT_RowId' => 'row_1_'.$id, $id, $id,
$this->attributes['user_name'], $this->attributes['remark'],
$this->attributes['email'], $this->attributes['money'],
$im_type, $im_value,
$this->attributes['node_group'], $account_expire_in,
$this->attributes['class'], $class_expire_in,
$this->attributes['passwd'], $this->attributes['port'],
$this->attributes['method'],
$this->attributes['protocol'], $this->attributes['obfs'],
$this->online_ip_count(), $this->lastSsTime(),
$used_traffic, $enable_traffic,
$this->lastCheckInTime(), $today_traffic,
$is_enable, $this->attributes['reg_date'],
$reg_location,
$this->attributes['auto_reset_day'], $this->attributes['auto_reset_bandwidth'],
$ref_user_id, $ref_user_name);
$location = $iplocation->getlocation($reg_location);
$reg_location .= "\n" . iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
$return_array = array(
'DT_RowId' => 'row_1_' . $id,
$id,
$id,
$this->attributes['user_name'],
$this->attributes['remark'],
$this->attributes['email'],
$this->attributes['money'],
$im_type,
$im_value,
$this->attributes['node_group'],
$account_expire_in,
$this->attributes['class'],
$class_expire_in,
$this->attributes['passwd'],
$this->attributes['port'],
$this->attributes['method'],
$this->attributes['protocol'],
$this->attributes['obfs'],
$this->online_ip_count(),
$this->lastSsTime(),
$used_traffic,
$enable_traffic,
$this->lastCheckInTime(),
$today_traffic,
$is_enable,
$this->attributes['reg_date'],
$reg_location,
$this->attributes['auto_reset_day'],
$this->attributes['auto_reset_bandwidth'],
$ref_user_id,
$ref_user_name
);
return $return_array;
}
public function get_user_attributes($key)
{
return $this->attributes[$key];
}
public function get_top_up()
{
$codes = Code::where('userid', $this->attributes['id'])->get();
$top_up = 0;
foreach ($codes as $code) {
$top_up += $code->number;
}
return round($top_up, 2);
}
// 最后一次被封禁的时间
public function last_detect_ban_time()
{
return ($this->attributes['last_detect_ban_time'] == '1989-06-04 00:05:00'
? '未被封禁过'
: $this->attributes['last_detect_ban_time']
);
}
// 当前解封时间
public function relieve_time()
{
if ($this->attributes['detect_ban'] == 1) {
$logs = DetectBanLog::where('user_id', $this->attributes['id'])->orderBy("id", "desc")->first();
$time = ($logs->end_time + $logs->ban_time * 60);
return date('Y-m-d H:i:s', $time);
} else {
return '当前未被封禁';
}
}
// 累计被封禁的次数
public function detect_ban_number()
{
$logs = DetectBanLog::where('user_id', $this->attributes['id'])->get();
return count($logs);
}
// 最后一次封禁的违规次数
public function user_detect_ban_number()
{
$logs = DetectBanLog::where('user_id', $this->attributes['id'])->orderBy("id", "desc")->first();
return $logs->detect_number;
}
public function yesterdayIncome()
{
return Code::where('usedatetime', 'like', date('Y-m-d%', strtotime('-1 days')))->sum(number);
}
public function todayIncome()
{
return Code::where('usedatetime', 'like', date('Y-m-d%'))->sum(number);
}
public function thisMonthIncome()
{
return Code::where('usedatetime', 'like', date('Y-m%'))->sum(number);
}
public function lastMonthIncome()
{
return Code::where('usedatetime', 'like', date('Y-m%', strtotime('-1 months')))->sum(number);
}
public function totalIncome()
{
return Code::where('usedatetime', 'like', date('%'))->sum(number);
}
public function paidUserCount()
{
return self::where('class', '!=', '0')->count();
}
public function disableReason()
{
$reason_id = DetectLog::where('user_id', '=', $this->attributes['id'])->orderBy('id', 'DESC')->first();
$reason = DetectRule::where('id', '=', $reason_id->list_id)->get();
return $reason[0]->text;
}
}

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

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

Loading…
Cancel
Save