Compare commits

...

855 Commits

Author SHA1 Message Date
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
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
laurieryayoi 1c0856842d 优化UI切换代码和商店列表手风琴动画 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
錢爸爸 d88aefe832
目前的<加密/協議/混淆>可視SS(SS/SSR) 8 years ago
CGDF 915b8949d8 修复xcat update错误 8 years ago
laurieryayoi 6defaac7bd 修复编辑用户界面modal 8 years ago
CGDF de112cd7fc 修复syncjob不能自动更新 8 years ago
Sukka afa0c6dbef
Merge from NimaQu/dev 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
CGDF 278968c882 修复脑残写的BUG。。。 8 years ago
CGDF fc010bd0e5 修复邮件轰炸和账户过期时ssr订阅 8 years ago
CGDF 3b548381cb 修复账户过期时ssr订阅 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
NimaQu 73a7571e1c
修改文字说明 8 years ago
NimaQu a207fad6a0
Merge branch 'dev' 8 years ago
NimaQu 8d4b6ba725
手动 revert 3bf5a3a227 8 years ago
CGDF eb966d259d 修复node_offline_warn的bug 8 years ago
CGDF 4243480f26 修复【关闭旧套餐自动续费】不生效的BUG 8 years ago
CGDF 2c531e947f 修复【购买】无反应的BUG 8 years ago
NimaQu 9a3e12121c
Merge pull request #264 from wewall/patch-4
服务器ULDL速度->直观的ULDL速度
8 years ago
围墙 2f1b05f79c
服务器ULDL速度->直观的ULDL速度 8 years ago
Indexyz 60835f4b22
Merge branch 'dev' of github.com:NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Indexyz bc76386c9d
fix(v2ray): fix get uuid error 8 years ago
Yihan Huang 950d034222 更新純真數據庫版本到20180825 (#261) 8 years ago
Indexyz 5a11d679c9
fix: fix v2ray user may same password 8 years ago
NimaQu 1543163b03
修复[在梦里敲 kotlin ]的 CGDF 8 years ago
huyudong1991 27c8f9bb72 增加用户快速搜索编辑删除 by doocxy (#259) 8 years ago
NimaQu 5af7a448a5
手动 revert 3bf5a3a227 8 years ago
CGDF 714432dc13 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 14114eda56 【订单确认】新增【关闭旧套餐自动续费】选项 8 years ago
围墙 ca3c5ff5e8 【1024节点必备】优化节点地址解析
节点自动获取IP只有当节点地址不为IP时才处理,减少处理次数,优化大站处理效率
8 years ago
NimaQu 503e9ea620
修复单端口多用户实际导入为普通端口的小 8 years ago
Yihan Huang 0830c5fcd3 更新canvasjs.js版本 (#252) 8 years ago
CGDF 85f3500293 修复fade导致的BUG 8 years ago
CGDF 85a4ccdeb8 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 5e0af2d25b 修复纯SS协议下显示错乱的BUG。“退订”更名为“关闭自动续费” 8 years ago
NimaQu b3fb917bcd
Merge pull request #244 from idawnlight/dev
修复重置密码页回车键无法提交
8 years ago
NimaQu 74f8abce16
fix bugs 8 years ago
idawnlight 7058a352aa
修复重置密码页回车键无法提交
...
8 years ago
NimaQu c17e10dc87
🌝好bug Soul Dark造 8 years ago
CGDF 741ac2d974 Revert "ログインインタフェースの最適化"
This reverts commit 226250e39f.
8 years ago
CGDF 28f8dfcb0c Revert "Login interface optimization"
This reverts commit 0a75786944.
8 years ago
CGDF bb9a8b02e4 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
CGDF 465979bbb8 修生成链接的bug 8 years ago
NimaQu 4a09aec09f
Update README.md 8 years ago
NimaQu 4542879955
Update README.md 8 years ago
NimaQu 1ff86b06ac Update issue templates 8 years ago
Indexyz 49ce931c00
Merge branch 'dev' of github.com:NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Indexyz 0c5ef2fc38
feat(v2ray): add obfs type support 8 years ago
Miku c307d1a7a3
Update header.tpl 8 years ago
Miku 0a75786944
Login interface optimization 8 years ago
Miku 226250e39f
ログインインタフェースの最適化 8 years ago
Soul Dark 910c547b66 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark a313656e8c SSD订阅支持流量和等级到期时间 8 years ago
NimaQu 3719a70900
增加在用户等级0时的判断 8 years ago
Soul Dark f9a0463ca9 完善ajax局部刷新 8 years ago
Soul Dark 57865e2ab2 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark 86e1afdd9d 修复兼容单多BUG 8 years ago
NimaQu 39a2ab694b
修复投掷物大师 Tony 写出的用户到期时间而不是等级到期时间的问题 8 years ago
Soul Dark b3faa927a9 修复SSD订阅BUG(妈耶,没完没了了) 8 years ago
Soul Dark 6fb79ef139 修复SSD订阅BUG 8 years ago
Soul Dark 2d9f93ec3f 支持ssd:// 8 years ago
Soul Dark bf62df1846 完善兼容模式 8 years ago
Soul Dark 098dba0eb8 修复【忘了这是在写php】的bug 8 years ago
Soul Dark 325a6d1c6c Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark c79049e32d 新增备用SSD导入方案。完善兼容模式。 8 years ago
SoDa 95fe598198
Update README.md 8 years ago
Soul Dark 1cf78995d2 修复method导致的500错误 8 years ago
Soul Dark 6eb16ffc96 修正updateSSR返回值。完善兼容旧模式。 8 years ago
Soul Dark b6567adf08 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark 3bf5a3a227 新增兼容过时协议开关 8 years ago
SoDa dbdd42a547
Merge pull request #235 from hujy23/dev
给复制到剪贴板里的ss节点间加入换行,否则多个节点只能导入一个
8 years ago
Tony Zou 7d09f402a0
支持节点列表中显示流量统计
(Github编辑器真香
8 years ago
NimaQu 818efcfa65
Merge pull request #233 from YihanH/patch-1
修正海外日常爆炸 staticfile.org 用的七牛雲CDN
8 years ago
Soul Dark c219d0fcaf 修复ss客户端obfs插件配置bug 8 years ago
Era Hu 4fd3f40f0f 给复制到剪贴板里的ss节点间加入换行,否则多个节点只能导入一个 8 years ago
Soul Dark 743156e3c8 修复surge混淆的BUG 8 years ago
Yihan Huang 0506265ac9
更換js CDN地址 8 years ago
Yihan Huang 29ae4e17b0
修正海外日常爆炸 staticfile.org 用的七牛雲CDN 8 years ago
Soul Dark cff6f0f0de 完善SSD JSON 8 years ago
Soul Dark 79b9b2a7c1 优化SSD适配 8 years ago
Soul Dark fbed66c9eb 调整SSD V2RAY订阅链接 8 years ago
Soul Dark 1cf01477b9 调整SSD json 8 years ago
Soul Dark c7529da4c1 修复订阅BUG 8 years ago
Soul Dark d7d6fab869 config调整 8 years ago
Soul Dark f9a15e061d edit.tpl适配SSD 8 years ago
Soul Dark 60b2186265 SSD JSON微调 8 years ago
Soul Dark 1e908a9b33 index界面调整 8 years ago
Soul Dark 1cdf9f3c62 完善SSD支持 8 years ago
Soul Dark 8f436d4a9b 对接SSD 8 years ago
Soul Dark 3cf390b6cc Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark 7fb93b2eb0 修复邀请界面table的bug 8 years ago
NimaQu 40bcae03a6
Merge pull request #221 from wewall/patch-2
优化无论何时都会调用当面付的逻辑错误
8 years ago
Soul Dark 95fe0f1d06 修复surge导入bug,修正流量使用文字说明。 8 years ago
galaxychuck 089545c37a
Update README.md 8 years ago
Indexyz f6aab4a560
支持 v2ray 订阅 (#228)
* feat: try support v2ray sub

* fix: add v2ray tab

* fix: fix v2ray panel

* fix: fix error

* fix: fix v2ray node list

* fix: error

* debug

* fix: wtf

* feat: add base64 on sub

* fix: fix \n error
8 years ago
围墙 7450f6ac70
优化无论何时都会调用当面付的逻辑错误
理论上在成功返回二维码后才需要检测是否已经付款成功,所有修改了触发的时机
8 years ago
Miku 1ac3c20b6b
Update README.md 8 years ago
SoDa d9601f27a0
Merge pull request #218 from idawnlight/dev
修正一个判断错误
8 years ago
idawnlight e44ef7ddce
Fix a bug 8 years ago
NimaQu f4f4a84af4
Merge pull request #217 from idawnlight/dev
Fix a typo
8 years ago
dawnlight b30e5fd131
Fix a typo 8 years ago
Soul Dark c68b5fd6c9 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark a83f9e1d43 完善gfw检测 8 years ago
NimaQu 3359b9f8af
Merge pull request #209 from YihanH/patch-3
添加crisp自動標記客戶郵箱功能
8 years ago
Yihan Huang ee3177e994
添加crisp自動標記客戶郵箱功能 8 years ago
Soul Dark 13a877f566 优化GFW检测 8 years ago
Soul Dark 3bf9912b8c 新增节点被墙检测。修复update和充值码相关bug。 8 years ago
Soul Dark 24873185e9 Revert "优化非当面付检测支付状态"
This reverts commit 648550166f.
8 years ago
NimaQu a44f3c42f0
修复0级用户还能看到邀请链接的 bug 8 years ago
NimaQu fd4f27b591
Merge pull request #205 from wewall/patch-1
优化非当面付检测支付状态
8 years ago
围墙 648550166f
优化非当面付检测支付状态 8 years ago
Soul Dark 256c0d728c Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark 9726e211e5 更新gitignore,防止出事 8 years ago
SoDa 76a3d14024
Merge pull request #203 from EsWannn/dev
补上香港旗帜,删除所有JPG格式旗帜。节点列表判断旗帜是否存在,不存在则显示unknown图标。
8 years ago
EsWannn 131e1589e5 优化香港旗帜图标质量 8 years ago
EsWannn 9cb42efdbc 删除漏掉的中国.jpg 8 years ago
EsWannn e483f4844a 补上香港旗帜,删除所有JPG格式旗帜。节点列表判断旗帜是否存在,不存在则显示unknown图标。 8 years ago
Soul Dark 79a7c08641 UI细节优化 8 years ago
Soul Dark 37689b6ccb 修复css的bug 8 years ago
Soul Dark 321854e921 修复css的粗体不能加粗的bug 8 years ago
Soul Dark a2ad1b9807 修复update的bug 8 years ago
Soul Dark 7b7957abd9 Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark 3969a770d9 修复update的bug 8 years ago
Miku b3697d0818
紧急修复NimaQu用爱Commit的Bug 8 years ago
Soul Dark d54b08f50a Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark a0b4949188 简化NODE_ID操作 8 years ago
NimaQu 0af1d28444
add xsalsa20 support 8 years ago
NimaQu a64249c045
auth_chain_c-f support 8 years ago
Miku 3995ab006e
Update index.tpl 8 years ago
Soul Dark d483f27e3f 优化update正则 8 years ago
Soul Dark 41ecf2936d Merge branch 'dev' of https://github.com/NimaQu/ss-panel-v3-mod_Uim into dev 8 years ago
Soul Dark df258a89eb 修复bug。升级命令。 8 years ago
NimaQu cedef4d8de
Merge pull request #197 from EsWannn/dev
新增194个国家及地区的旗帜图标和unknown图标
8 years ago
EsWannn c370484d35 新增194个国家及地区的旗帜图标和unknown图标 8 years ago
Soul Dark 50ef089cd7 修复国旗bug。调整更新机制(铺路) 8 years ago
NimaQu 6d5bd5182e
修复无回调 8 years ago
aiden3434 2a7fb87311 邀请码框隐藏+购买失败时可点击进入充值界面 8 years ago
NimaQu 7e6aae28a3
不是很懂为什么要拿 id 做订单号 8 years ago
Soul Dark 42f2338ef6 调整备份机制(请阅读wiki)。优化邀请返利。 8 years ago
Soul Dark f11db5f813 index连接信息疏漏补完 8 years ago
Soul Dark 9f29bcac34 优化连接信息教程。调整等级规则(使之符合文字说明) 8 years ago
Soul Dark 676c971528 修复首页BUG 8 years ago
Soul Dark 4d364b4d98 修复一次性优惠码等bug。升级优惠码功能。商品默认以商品名排序。tpl中新增一些默认值。 8 years ago
SoDa 0b4b6ccf18
Merge pull request #182 from wewall/patch-1
fix error
8 years ago
围墙 473762c911
fix error 8 years ago
NimaQu 475fe4dbc4
update readme.md 8 years ago
NimaQu 3387376cc4
fix 用户列表切换用户 8 years ago
aiden3434 cb56b21e32
Update index.tpl 8 years ago
NimaQu e8ae4eb2e5
手动 revert 48fad23e41 8 years ago
SoDa b91282d355
Merge pull request #173 from SoDa-GitHub/dev
修复BUG,优化f2f支付界面
8 years ago
Soul Dark be7b30de72 修复BUG,优化f2f支付界面 8 years ago
NimaQu 031aba0d29
修复手残多改的重置全部用户端口功能 9 years ago
SoDa 182a81e822
Merge pull request #172 from SoDa-GitHub/dev
优化充值界面,trim优化输入
9 years ago
Soul Dark 10b7a79b70 优化充值界面,trim优化输入 9 years ago
NimaQu e0d1cc87a4 update config.php 9 years ago
aiden3434 a21af53acf 可以在工单和用户编辑内切换用户 (#170) 9 years ago
NimaQu 1369a7b2f4 update gitignore 9 years ago
aiden3434 e19721aaf0 加了个二次验证的开关 (#160) 9 years ago
NimaQu 5dd188e597
Merge pull request #162 from kaguya-hime/dev
添加对 kaguya 的 sstap 客户端支持
9 years ago
NimaQu 80faf8ab59 Merge branch 'master' into dev 9 years ago
LuckyTain 92f1f60c15 CDN修復 (#165)
他,叕改回去了
9 years ago
SoDa 95e195b9a0
Merge pull request #164 from SoDa-GitHub/dev
完成ajax局部刷新
9 years ago
Soul Dark 757078386a 完成ajax局部刷新 9 years ago
Kaguya 958c5f5665 Sublink取得APIを作成 9 years ago
NimaQu 48fad23e41
Merge pull request #157 from NimaQu/解决用户列表卡顿
解决用户列表卡顿
9 years ago
Soul Dark 5119bd2bb0 修复 bug ,增加购买端口功能 9 years ago
NimaQu 8de497fbac
Merge pull request #139 from SoDa-GitHub/master
修复国旗BUG
9 years ago
Soul Dark ed2bfcdb0f 修复Ell W.找到的国旗BUG 9 years ago
NimaQu 36ebef5135
Merge pull request #138 from SoDa-GitHub/master
新增【用户购买邀请码功能】
9 years ago
Soul Dark 6140571f5a 新增【用户购买邀请码功能】 9 years ago
NimaQu a1995b258f
Merge pull request #135 from SoDa-GitHub/master
修复一个莫名其妙的BUG。。。。
9 years ago
Soul Dark 8f79877e6d 修复一个莫名其妙的BUG。。。。(奇怪我自己代码明明里没有这个短横。。。)
修复Config.php
9 years ago
NimaQu 2174b3fe2b
Merge pull request #132 from SoDa-GitHub/master
国旗国家支持正则表达式
9 years ago
Soul Dark 4a09c49886 国旗国家支持正则表达式 9 years ago
MancyMiao ea36dbe4c0 修复配置文件导致500错误
更新站长联系方式后配置文件第205行有误 会导致500错误
9 years ago
NimaQu 2d9bfe33d2
Merge pull request #130 from SoDa-GitHub/master
修复国旗BUG, config新增站长联系方式
9 years ago
Soul Dark a3f2b8e60e config新增站长联系方式(为后续一些功能铺路)。新增“收不到邮件?”引导dialog,同时绑定config中的站长联系方式,提高注册成功率 9 years ago
Soul Dark 3a8b11b6b4 修复国旗BUG 9 years ago
SoDa 3bd8a7cdf0 新增财务报表功能 ,修改国旗相关代码
* 新增财务报表功能

* 给站点国旗增加开关,并修改了原本极其傻逼的国旗相关代码和相关逻辑
9 years ago
NimaQu 6ee1fdf969 Revert "优化工单系统界面"
This reverts commit bf58464094.
9 years ago
NimaQu e993a58713
Merge pull request #127 from SoDa-GitHub/master
新增自定义混淆参数
9 years ago
NimaQu bf58464094 优化工单系统界面 9 years ago
Soul Dark 14afad7ab0 新增自定义混淆参数(以支持运营商免流)
顺便给主页加了一个退出登录的<li>
为.gitignore新增了一条.vs/
9 years ago
SoDa d983df012d
Merge pull request #1 from NimaQu/master
init pr
9 years ago
NimaQu 740a637195 Update issue templates 9 years ago
NimaQu 83f0be4e08 现在签到可以设置负数流量了 9 years ago
NimaQu 972aa7b135 修复单端口订阅链接复制和普通端口相同的Bug 9 years ago
Tony Zou ba82a12196 fix node list display 9 years ago
NimaQu 4764fd1ada
Merge pull request #111 from YihanH/patch-1
新增每日郵件退訂鏈接,避免被判定垃圾郵件
9 years ago
Yihan Huang ae598a0949
新增每日郵件退訂鏈接,避免被判定垃圾郵件 9 years ago
NimaQu 197ed10fff 本地化部分文件方便自定义 9 years ago
NimaQu 9091421c0b 修复当面付二维码 9 years ago
围墙 d1f6e1a6d0 Automatically update the latest version year (#102) 9 years ago
NimaQu b8c3248cd9
Merge pull request #100 from wewall/patch-2
Optimize Reply Tips.
9 years ago
围墙 312372202c
Optimize Reply Tips.
Optimize the prompt that will trigger the reply no matter what.
9 years ago
NimaQu 8fa51af149
Merge pull request #96 from xcxnig/patch-4
修复405页面链接
9 years ago
Miku d2db7150b9
修复405页面链接 9 years ago
NimaQu 950b47a064 新增重置单个用户端口功能,增加帮助,输入 php xcat 可查看常用命令 9 years ago
NimaQu a13413c12e
Merge pull request #94 from xcxnig/patch-3
精简404、405、500页面逻辑
9 years ago
Miku 1aa282fe19
精简404、405、500页面逻辑 9 years ago
NimaQu 1a71dede1f 修复 Bug ,恢复单端口多用户订阅地址复制按钮 9 years ago
Tony Zou 1d5e29ca7b
fix: vmess base64 link parsing error 9 years ago
NimaQu f767d81840 增加跑路功能 ((((( 9 years ago
Indexyz 8ac21af6aa
typo
丢人.webp
9 years ago
NimaQu 866afa84b7
Update README.md 9 years ago
Tony Zou 1b52a1c27c
fix node load display 9 years ago
mxihan 33118a4f67 update README.md 9 years ago
NimaQu 89bd3797f3 修复 Safari 下到期时间显示不正常by神秘赵姓男子 9 years ago
NimaQu 45930c5dca
Merge pull request #83 from FQrabbit/patch-2
修复面板备份功能漏掉数据库中的易付通表
9 years ago
FQrabbit 2739e82299
修复面板备份功能漏掉数据库中的易付通表
'人在家里坐,锅从天上来'
9 years ago
Miku 4d4f647e6a 优化网站目录逻辑判断 9 years ago
NimaQu 31ec224992 f2fpay 改为输入模式 9 years ago
Miku 22a7a0752f 自动清理telegram登录时用户上传的二维码 9 years ago
mxihan 67467e9c46 细节优化 9 years ago
galaxychuck a9555dc90d 公告、查看工单编辑处开启emoji 9 years ago
Miku 4b6d8bb8b2 Miku:注册验证码改为人见人爱的6位数字 9 years ago
NimaQu 926064e027
Merge pull request #75 from neoFelhz/master
fix: using relative url when import font
9 years ago
Miku 0864a145b6 Merge branch 'master' of https://github.com/NimaQu/ss-panel-v3-mod_UIChanges 9 years ago
neoFelhz 49f112233b fix: using relative url when import font 9 years ago
neo Felhz 2e8514098e
Merge pull request #1 from NimaQu/master
Merge from upstream
9 years ago
Miku ca0fbd6425 新增韩国和俄罗斯节点 9 years ago
galaxychuck 951ae5c13d 打開編輯器emoji表情,修復emoji鏈接 9 years ago
galaxychuck 80f8bd4cd0 增加重置訂閱鏈接彈窗的超時跳轉(魔改版為3000毫秒) 9 years ago
dumplin eb21c5cf4e 修复bug 9 years ago
Miku af4ebd87e6
Update README.md 9 years ago
NimaQu ae51d16dae 细节优化 9 years ago
NimaQu d683b32afa
Merge pull request #74 from NeverBehave/master
Oauth Frontend Ready
9 years ago
NeverBehave ebaf72ad3c Fix Typo 9 years ago
NeverBehave d04b3235e1 Set back to traditional way 9 years ago
NeverBehave 4b41369ae7 Merge branch 'master' of https://github.com/NimaQu/ss-panel-v3-mod_Uim 9 years ago
NeverBehave 18254ab51c Fix $config issue 9 years ago
NimaQu a063f7894c
Merge pull request #71 from NeverBehave/master
Fix php tag disabled issue
9 years ago
NeverBehave 9441c7c582 fix php tag disabled issue 9 years ago
NimaQu 7e3f0f2ff6
Merge pull request #70 from NeverBehave/master
Add telegram Oauth Login
9 years ago
NeverBehave 363b290ae0 Add telegram oauth login 9 years ago
dumplin e871c7dd92 修复jquery bug:不能删除 9 years ago
dumplin bb7280640c 用户列表bug 9 years ago
dumplin 75ac224da9 解决用户列表卡顿
- 万人机场必备
 - 不再一次性加载全部用户数据
 - 用户数据分批加载
9 years ago

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

@ -0,0 +1,45 @@
---
name: issue
about: temlpate
---
<!--
如果你不填充下面的内容,我们可能会直接关闭你的 issue。
如果你没有仔细阅读 Wiki ,或者无关问题,我们可能会直接关闭你的 issue。
注意:Wiki 可能随时都会更新。在提交一个 issue 前,请重新查看相关内容。
-->
**我确认我已经阅读了** (使用 "x" 选择)
- [ ] [项目 Wiki ](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki)
- [ ] [项目其他 issue](https://github.com/NimaQu/ss-panel-v3-mod_Uim/issues?utf8=%E2%9C%93&q=is%3Aissue)
**我确认我做到了** (使用 "x" 选择)
- [ ] [将项目升级到当前分支最新版本](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC)
- [ ] 在[项目演示站](https://demo.nimaqu.com)成功复现问题
**我正在申请** (使用 "x" 选择)
- [ ] 反馈一个 bug
- [ ] 申请添加新的特性或功能或者好的想法
<!-- ----------- -->
**反馈BUG**
1.请在面板路径下运行`git show HEAD`,然后贴出输出内容
2.如果是页面问题(500 或 Slim Application Error ),请在 config 开启 debug 模式后截图或贴出输出内容,如果是某个按钮点击没反应,请打开浏览器开发者控制台(通常为 F12 ) ,贴出 console 输出内容
<!-- ----------- -->
**申请添加新的特性或功能或者好的想法**

@ -0,0 +1,47 @@
---
name: New Issue
about: Issue
---
<!--
如果你不填充下面的内容,我们可能会直接关闭你的 issue。
请在标题简单描述内容
如果你没有仔细阅读 Wiki ,或者无关问题,我们可能会直接关闭你的 issue。
注意:Wiki 可能随时都会更新。在提交一个 issue 前,请重新查看相关内容。
-->
**我确认我已经阅读了** (使用 "x" 选择)
- [ ] [项目 Wiki ](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki)
- [ ] [项目其他 issue](https://github.com/NimaQu/ss-panel-v3-mod_Uim/issues?utf8=%E2%9C%93&q=is%3Aissue)
**我确认我做到了** (使用 "x" 选择)
- [ ] [将项目升级到当前分支最新版本](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC)
- [ ] 在[项目演示站](https://demo.nimaqu.com)成功复现问题
**我正在申请** (使用 "x" 选择)
- [ ] 反馈一个 bug
- [ ] 申请添加新的特性或功能或者好的想法
<!-- ----------- -->
**反馈BUG**
1.请在面板路径下运行`git show HEAD`,然后贴出输出内容
2.如果是页面问题(500 或 Slim Application Error ),请在 config 开启 debug 模式后截图或贴出输出内容,如果是某个按钮点击没反应,请打开浏览器开发者控制台(通常为 F12 ) ,贴出 console 输出内容
<!-- ----------- -->
**申请添加新的特性或功能或者好的想法**

19
.gitignore vendored

@ -1,6 +1,17 @@
*/.DS_Store
.DS_Store
/vendor
/config/.config.php
/.idea
storage/qqwry.md5
vendor
config/.config.php
config/.config.php.bak
404.html
index.html
public/ssr-download/
public/images/*.*
public/theme/material/css/images/bg
storage/trimepay_notify.log
storage/traffic_notified/
.idea
storage/qqwry.*
.vs/
.htaccess
php_errors.log

@ -0,0 +1,33 @@
language: php
php:
# - '5.4'
# - '5.6'
- '7.1'
sudo: enabled
dist: xenial
before_install:
- echo "==========================================================="
- echo "Upgrade linux packages"
- echo "==========================================================="
- sudo sed -i 's|http://us-east-1.ec2.archive.ubuntu.com|https://ubuntu.mirror.noc.one|g' /etc/apt/sources.list
- sudo sed -i 's|http://security.ubuntu.com|https://ubuntu.mirror.noc.one|g' /etc/apt/sources.list
- sudo sed -i 's|http://us-central1.gce.archive.ubuntu.com|https://ubuntu.mirror.noc.one|g' /etc/apt/sources.list
- sudo sed -i 's|http://ppa.launchpad.net|https://launchpad.proxy.noc.one|g' /etc/apt/sources.list.d/*.list
- curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
- sudo apt upgrade
- sudo apt install -y nodejs
- composer config -g repos.packagist composer https://packagist.noc.one
install:
- sudo chmod -R 755 *
- echo "==========================================================="
- echo "Comoposer install"
- echo "==========================================================="
- php composer.phar install
before_script:
- npm i -g phplint
script:
- cp config/.config.php.example config/.config.php
- phplint '**/*.php' '!vendor/**'
- php xcat initdownload
- php xcat initQQWry
- php xcat update

@ -1,29 +1,25 @@
# 欢迎使用ss panel v3 mod 再次修改版
**ss-panel-v3-mod**是一款转为shadowsocks设计的web前端面板,再次感谢ss-panel-v3mod 的制作者,修改后的功能简介:
**ss-panel-v3-mod**是一款专为shadowsocks设计的web前端面板,再次感谢ss-panel-v3-mod 的制作者,修改后的功能简介:
- **支付系统集成**:集成 支付宝当面付 黛米付 易付通 码支付等多种支付系统,使用方法见项目[wiki](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/)
- **支付系统集成**:集成 支付宝当面付 易付通 码支付 TrimePay 等多种支付系统,使用方法见项目[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)
- 增加**v2Ray** 功能,详情请看 [wiki](https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/v2ray-%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B)
telegram交流群:https://t.me/joinchat/GQehSEV7LEU1Z6E8aQ4z3w
Telegram 频道 :https://t.me/sspanel_Uim
telegtam 频道 :https://t.me/sspanel_Uim 管理模式参考91yun管理
演示站: [demo.nimaqu.com](https://demo.nimaqu.com) 账号和密码都是 admin 对接节点的 mukey=NimaQu
**原作者** [galaxychuck](https://github.com/galaxychuck)
[支持开发者请点我](https://github.com/NimaQu/ss-panel-v3-mod_UIM#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
本面板在[宝塔面板5.6.0](www.bt.cn),宝塔安装版 nginx1.12,php 7.1 ,mysql 5.7 上全部功能测试通过
## 搭建教程
感谢LALA制作教程:https://lala.im/2398.html
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
@ -34,6 +30,9 @@ Wiki已经启用,欢迎为此面板维护wiki
- 面板**原作者**
##### [hkserversolution](https://www.hkserversolution.com/cart.php)
- Demo 演示站服务器赞助
##### [dumplin](https://github.com/dumplin233)
- 码支付对接 + 码支付当面付二合一
@ -42,10 +41,11 @@ Wiki已经启用,欢迎为此面板维护wiki
- 多端口订阅
- 解决用户列表加载缓慢历史遗留问题
##### [rinSama](https://github.com/mxihan)
##### [RinSAMA](https://github.com/mxihan)
- 整理分类 config.php
- spay 优化
- 美观性调整
- 客服系统优化
##### [miku](https://github.com/xcxnig)
@ -57,10 +57,32 @@ Wiki已经启用,欢迎为此面板维护wiki
- 节点负载情况显示&用户账户过期在首页弹窗提醒
- 增加返利列表
[**indexyz**](https://github.com/Indexyz)
[**Indexyz**](https://github.com/Indexyz)
- 为面板增加 v2Ray 功能
[**NeverBehave**](https://github.com/NeverBehave)
- 添加 Telegram OAuth
[**CGDF**](https://github.com/CGDF-GitHub)
- 一键国旗
- 财务报表
- xcat一键update
- 适配SSD
- 用户列表分页加载
[**CHEN**](https://github.com/ChenSee)
- 免签约支付宝与微信,自带监听,不需第三方软件,直接到个人账户
[**laurieryayoi**](https://github.com/laurieryayoi)
- 重做美化UI(~~援交~~圆角化)
- 重写节点列表,支持分级显示所有级别节点
##### 还有所有被引用过代码的同学,以及所有提交过issue的同学。
#### 关于捐赠
@ -72,13 +94,15 @@ Wiki已经启用,欢迎为此面板维护wiki
- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
##### NimaQu
- [魔方云 - 低成本极速高效 专属您的私有云](https://www.cubecloud.net/aff.php?aff=796)
##### galaxychuck
- [黛米付-支付接入](https://www.daimiyun.cn/register.php?aff=624)
- [冲上云霄云主机](http://console.soar-clouds.com/aff.php?aff=94)
- [Vultr](https://www.vultr.com/?ref=7205737)
[Nymph 的前端课程报名](t.me/kinokonominoco)
# 免责声明
本程序由 MIT License 授权。**不提供任何担保**。使用本程序即表明,您知情并同意:程序开发者不对此程序导致的任何服务中断、数据损失或任何少见未列出的事故负责。

@ -42,7 +42,7 @@ class DailyMail
"user" => $user,"text" => $text,"lastday"=>$lastday
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
$text="";

@ -23,7 +23,7 @@ class ExtMail
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
}
@ -44,7 +44,7 @@ class ExtMail
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
}

@ -0,0 +1,223 @@
<?php
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 Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
class FinanceMail
{
public static function sendFinanceMail_day()
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query(
'select code.number, code.userid, code.usedatetime from code
where TO_DAYS(NOW()) - TO_DAYS(code.usedatetime) = 1 and code.type = -1 and code.isused= 1');
$text_json=$datatables->generate();
$text_array=json_decode($text_json,true);
$codes=$text_array['data'];
$text_html='<table border=1><tr><td>金额</td><td>用户ID</td><td>用户名</td><td>充值时间</td>';
$income_count=0;
$income_total=0.00;
foreach($codes as $code){
$text_html.='<tr>';
$text_html.='<td>'.$code['number'].'</td>';
$text_html.='<td>'.$code['userid'].'</td>';
$user=User::find($code['userid']);
$text_html.='<td>'.$user->user_name.'</td>';
$text_html.='<td>'.$code['usedatetime'].'</td>';
$text_html.='</tr>';
$income_count+=1;
$income_total+=$code['number'];
}
//易付通的单独表
$datatables2 = new Datatables(new DatatablesHelper());
$datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
$count_yft=$datatables2->generate();
if(strpos($count_yft,'"count_yft":1')){
$datatables2->query(
'select yft_order_info.price, yft_order_info.user_id, yft_order_info.create_time from yft_order_info
where TO_DAYS(NOW()) - TO_DAYS(yft_order_info.create_time) = 1 and yft_order_info.state= 1');
$text_json2=$datatables2->generate();
$text_array2=json_decode($text_json2,true);
$codes2=$text_array2['data'];
foreach($codes2 as $code2){
$text_html.='<tr>';
$text_html.='<td>'.$code2['price'].'</td>';
$text_html.='<td>'.$code2['user_id'].'</td>';
$user=User::find($code2['user_id']);
$text_html.='<td>'.$user->user_name.'</td>';
$text_html.='<td>'.$code2['create_time'].'</td>';
$text_html.='</tr>';
$income_count+=1;
$income_total+=$code['price'];
}
}
$text_html.='</table>';
$text_html.='<br>昨日总收入笔数:'.$income_count.'<br>昨日总收入金额:'.$income_total;
$adminUser = User::where("is_admin", "=", "1")->get();
foreach ($adminUser as $user) {
echo "Send offline mail to user: ".$user->id;
$subject = Config::get('appName')."-财务日报";
$to = $user->email;
$title='财务日报';
$text = $text_html;
try {
Mail::send($to, $subject, 'news/finance.tpl', [
"user" => $user,"title"=>$title,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
}
if (Config::get("finance_public")=="true") {
$sts = new Analytics();
Telegram::Send(
"新鲜出炉的财务日报~".PHP_EOL.
"昨日总收入笔数:".$income_count.PHP_EOL.
"昨日总收入金额:".$income_total.PHP_EOL.
"凌晨也在努力工作~"
);
}
}
public static function sendFinanceMail_week()
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query(
'select code.number from code
where yearweek(date_format(code.usedatetime,\'%Y-%m-%d\')) = yearweek(now())-1 and code.isused= 1');
//每周的第一天是周日,因此统计周日~周六的七天
$text_json=$datatables->generate();
$text_array=json_decode($text_json,true);
$codes=$text_array['data'];
$text_html='';
$income_count=0;
$income_total=0.00;
foreach($codes as $code){
$income_count+=1;
$income_total+=$code['number'];
}
//易付通的单独表
$datatables2 = new Datatables(new DatatablesHelper());
$datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
$count_yft=$datatables2->generate();
if(strpos($count_yft,'"count_yft":1')){
$datatables2->query(
'select yft_order_info.price from yft_order_info
where yearweek(date_format(yft_order_info.create_time,\'%Y-%m-%d\')) = yearweek(now())-1 and yft_order_info.state= 1');
//每周的第一天是周日,因此统计周日~周六的七天
$text_json2=$datatables2->generate();
$text_array2=json_decode($text_json2,true);
$codes2=$text_array2['data'];
foreach($codes2 as $code2){
$income_count+=1;
$income_total+=$code2['price'];
}
}
$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.
"上周总收入笔数:".$income_count.PHP_EOL.
"上周总收入金额:".$income_total.PHP_EOL.
"周末也在努力工作~"
);
}
}
public static function sendFinanceMail_month()
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query(
'select code.number from code
where date_format(code.usedatetime,\'%Y-%m\')=date_format(date_sub(curdate(), interval 1 month),\'%Y-%m\') and code.type = -1 and code.isused= 1');
$text_json=$datatables->generate();
$text_array=json_decode($text_json,true);
$codes=$text_array['data'];
$text_html='';
$income_count=0;
$income_total=0.00;
foreach($codes as $code){
$income_count+=1;
$income_total+=$code['number'];
}
$datatables2 = new Datatables(new DatatablesHelper());
$datatables2->query('select COUNT(*) as "count_yft" from INFORMATION_SCHEMA.TABLES where TABLE_NAME = "yft_order_info"');
$count_yft=$datatables2->generate();
if(strpos($count_yft,'"count_yft":1')){
$datatables2->query(
'select yft_order_info.price from yft_order_info
where date_format(yft_order_info.create_time,\'%Y-%m\') =date_format(date_sub(curdate(), interval 1 month),\'%Y-%m\') and yft_order_info.state= 1');
//每周的第一天是周日,因此统计周日~周六的七天
$text_json2=$datatables2->generate();
$text_array2=json_decode($text_json2,true);
$codes2=$text_array2['data'];
foreach($codes2 as $code2){
$income_count+=1;
$income_total+=$code2['price'];
}
}
$text_html.='<br>上月总收入笔数:'.$income_count.'<br>上月总收入金额:'.$income_total;
$adminUser = User::where("is_admin", "=", "1")->get();
foreach ($adminUser as $user) {
echo "Send offline mail to user: ".$user->id;
$subject = Config::get('appName').'-财务月报';
$to = $user->email;
$title='财务月报';
$text = $text_html;
try {
Mail::send($to, $subject, 'news/finance.tpl', [
"user" => $user,"title"=>$title,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
}
if (Config::get("finance_public")=="true") {
$sts = new Analytics();
Telegram::Send(
"新鲜出炉的财务月报~".PHP_EOL.
"上月总收入笔数:".$income_count.PHP_EOL.
"上月总收入金额:".$income_total.PHP_EOL.
"月初也在努力工作~"
);
}
}
}

@ -20,11 +20,9 @@ use App\Models\TelegramSession;
use App\Models\EmailVerify;
use App\Services\Config;
use App\Utils\Radius;
use App\Utils\Wecenter;
use App\Utils\Tools;
use App\Services\Mail;
use App\Utils\QQWry;
use App\Utils\Duoshuo;
use App\Utils\GA;
use App\Utils\Telegram;
use CloudXNS\Api;
@ -37,66 +35,56 @@ class Job
{
$nodes = Node::all();
foreach ($nodes as $node) {
if ($node->sort==0) {
$ip=gethostbyname($node->server);
$node->node_ip=$ip;
$node->save();
}
if ($node->sort == 11) {
$server_list = explode(";", $node->server);
if(!Tools::is_ip($server_list[0])){
if($node->changeNodeIp($server_list[0])){
$node->save();
}
}
} else if($node->sort == 0 || $node->sort == 1 || $node->sort == 10){
if(!Tools::is_ip($node->server)){
if($node->changeNodeIp($node->server)){
$node->save();
}
}
}
}
}
public static function backup()
{
$to = Config::get('auto_backup_email');
if($to==null){
return false;
}
mkdir('/tmp/ssmodbackup/');
$db_address_array = explode(':', Config::get('db_host'));
system('mysqldump --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' '.Config::get('db_database').' announcement auto blockip bought code coupon disconnect_ip link login_ip payback radius_ban shop speedtest ss_invite_code ss_node ss_password_reset ticket unblockip user user_token email_verify detect_list relay paylist> /tmp/ssmodbackup/mod.sql', $ret);
system('mysqldump --opt --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' -d '.Config::get('db_database').' alive_ip ss_node_info ss_node_online_log user_traffic_log detect_log telegram_session >> /tmp/ssmodbackup/mod.sql', $ret);
system('mysqldump --opt --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' -d '.Config::get('db_database').' alive_ip ss_node_info ss_node_online_log user_traffic_log detect_log telegram_session yft_order_info >> /tmp/ssmodbackup/mod.sql', $ret);
if (Config::get('enable_radius')=='true') {
$db_address_array = explode(':', Config::get('radius_db_host'));
system('mysqldump --user='.Config::get('radius_db_user').' --password='.Config::get('radius_db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').''.Config::get('radius_db_database').'> /tmp/ssmodbackup/radius.sql', $ret);
}
if (Config::get('enable_wecenter')=='true') {
$db_address_array = explode(':', Config::get('wecenter_db_host'));
system('mysqldump --user='.Config::get('wecenter_db_user').' --password='.Config::get('wecenter_db_password').' --host='.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' '.Config::get('wecenter_db_database').'> /tmp/ssmodbackup/wecenter.sql', $ret);
}
system("cp ".Config::get('auto_backup_webroot')."/config/.config.php /tmp/ssmodbackup/configbak.php", $ret);
system("cp ".BASE_PATH."/config/.config.php /tmp/ssmodbackup/configbak.php", $ret);
echo $ret;
system("zip -r /tmp/ssmodbackup.zip /tmp/ssmodbackup/* -P ".Config::get('auto_backup_passwd'), $ret);
$subject = Config::get('appName')."-备份成功";
$to = Config::get('auto_backup_email');
$subject = Config::get('appName')."-备份成功";
$text = "您好,系统已经为您自动备份,请查看附件,用您设定的密码解压。" ;
try {
Mail::send($to, $subject, 'news/backup.tpl', [
"text" => $text
], ["/tmp/ssmodbackup.zip"
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
system("rm -rf /tmp/ssmodbackup", $ret);
system("rm /tmp/ssmodbackup.zip", $ret);
Telegram::Send("备份完毕了喵~今天又是安全祥和的一天呢。");
}
public static function SyncDuoshuo()
{
$users = User::all();
foreach ($users as $user) {
Duoshuo::add($user);
}
echo "ok";
}
public static function UserGa()
{
$users = User::all();
@ -114,7 +102,8 @@ class Job
{
$nodes = Node::all();
foreach ($nodes as $node) {
if ($node->sort==1) {
$rule = preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/",$node->server);
if (!$rule && (!$node->sort || $node->sort == 10)) {
$ip=gethostbyname($node->server);
$node->node_ip=$ip;
$node->save();
@ -128,7 +117,7 @@ class Job
{
$nodes = Node::all();
foreach ($nodes as $node) {
if ($node->sort == 0 || $node->sort == 10) {
if ($node->sort == 0 || $node->sort == 10 || $node->sort == 11) {
if (date("d")==$node->bandwidthlimit_resetday) {
$node->node_bandwidth=0;
$node->save();
@ -142,6 +131,7 @@ class Job
DetectLog::where("datetime", "<", time()-86400*3)->delete();
Speedtest::where("datetime", "<", time()-86400*3)->delete();
EmailVerify::where("expire_in", "<", time()-86400*3)->delete();
system("rm ".BASE_PATH."/storage/*.png", $ret);
Telegram::Send("姐姐姐姐,数据库被清理了,感觉身体被掏空了呢~");
//auto reset
@ -179,7 +169,7 @@ class Job
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
}
@ -194,7 +184,6 @@ class Job
$user->last_day_t=($user->u+$user->d);
$user->save();
if (date("d") == $user->auto_reset_day) {
$user->u = 0;
$user->d = 0;
@ -210,7 +199,7 @@ class Job
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
}
@ -256,12 +245,6 @@ class Job
rename(BASE_PATH."/storage/qqwry.dat.bak", BASE_PATH."/storage/qqwry.dat");
}
if (Config::get('enable_auto_backup') == 'true') {
Job::backup();
}
Job::updatedownload();
}
@ -358,7 +341,7 @@ class Job
$disconnected->delete();
}
//auto renew
//自动续费
$boughts=Bought::where("renew", "<", time())->where("renew", "<>", 0)->get();
foreach ($boughts as $bought) {
$user=User::where("id", $bought->userid)->first();
@ -368,42 +351,47 @@ class Job
continue;
}
if ($user->money>=$bought->price) {
$shop=Shop::where("id", $bought->shopid)->first();
if ($shop == null) {
$bought->delete();
continue;
}
$user->money=$user->money-$bought->price;
$shop=Shop::where("id", $bought->shopid)->first();
if ($shop == null) {
$bought->delete();
$subject = Config::get('appName')."-续费失败";
$to = $user->email;
$text = "您好,系统为您自动续费商品时,发现该商品已被下架,为能继续正常使用,建议您登录用户面板购买新的商品。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
continue;
}
if ($user->money >= $shop->price) {
$user->money=$user->money - $shop->price;
$user->save();
$shop->buy($user, 1);
$bought->renew=0;
$bought->save();
$bought_new=new Bought();
$bought_new->userid=$user->id;
$bought_new->shopid=$shop->id;
$bought_new->datetime=time();
$bought_new->renew=time()+$shop->auto_renew*86400;
$bought_new->price=$bought->price;
$bought_new->price=$shop->price;
$bought_new->coupon="";
$bought_new->save();
$subject = Config::get('appName')."-续费成功";
$to = $user->email;
$text = "您好,系统已经为您自动续费,商品名:".$shop->name.",金额:".$bought->price." 元。" ;
$text = "您好,系统已经为您自动续费,商品名:".$shop->name.",金额:".$shop->price." 元。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
@ -414,13 +402,13 @@ class Job
if (!file_exists(BASE_PATH."/storage/".$bought->id.".renew")) {
$subject = Config::get('appName')."-续费失败";
$to = $user->email;
$text = "您好,系统为您自动续费商品名:".$shop->name.",金额:".$bought->price." 元 时,发现您余额不足,请及时充值,当您充值之后,稍等一会系统就会自动扣费为您续费了。" ;
$text = "您好,系统为您自动续费商品名:".$shop->name.",金额:".$shop->price." 元 时,发现您余额不足,请及时充值。充值后请稍等系统便会自动为您续费。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
$myfile = fopen(BASE_PATH."/storage/".$bought->id.".renew", "w+") or die("Unable to open file!");
@ -436,52 +424,14 @@ class Job
BlockIp::where("datetime", "<", time()-86400)->delete();
TelegramSession::where("datetime", "<", time()-900)->delete();
$adminUser = User::where("is_admin", "=", "1")->get();
$latest_content = file_get_contents("https://raw.githubusercontent.com/NimaQu/ss-panel-v3-mod_uim/master/bootstrap.php");
$newmd5 = md5($latest_content);
$oldmd5 = md5(file_get_contents(BASE_PATH."/bootstrap.php"));
if ($latest_content!="") {
if ($newmd5 == $oldmd5) {
if (file_exists(BASE_PATH."/storage/update.md5")) {
unlink(BASE_PATH."/storage/update.md5");
}
} else {
if (!file_exists(BASE_PATH."/storage/update.md5")) {
foreach ($adminUser as $user) {
echo "Send mail to user: ".$user->id;
$subject = Config::get('appName')."-系统提示";
$to = $user->email;
$text = "管理员您好,系统发现有了新版本,您可以到 <a href=\"https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC\">https://github.com/NimaQu/ss-panel-v3-mod_Uim/wiki/%E5%8D%87%E7%B4%9A%E7%89%88%E6%9C%AC</a> 按照步骤进行升级。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
echo $e->getMessage();
}
}
Telegram::Send("姐姐姐姐,面板程序有更新了呢~看看你的邮箱吧~");
$myfile = fopen(BASE_PATH."/storage/update.md5", "w+") or die("Unable to open file!");
$txt = "1";
fwrite($myfile, $txt);
fclose($myfile);
}
}
}
//节点掉线检测
if (Config::get("node_offline_warn")=="true") {
//节点掉线检测
if (Config::get("enable_detect_offline")=="true") {
$nodes = Node::all();
foreach ($nodes as $node) {
if ($node->isNodeOnline() === false && time() - $node->node_heartbeat <= 360) {
if ($node->isNodeOnline() === false && !file_exists(BASE_PATH."/storage/".$node->id.".offline")) {
foreach ($adminUser as $user) {
echo "Send offline mail to user: ".$user->id;
$subject = Config::get('appName')."-系统警告";
@ -492,7 +442,7 @@ class Job
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
@ -543,53 +493,47 @@ class Job
fwrite($myfile, $txt);
fclose($myfile);
}
}
foreach ($nodes as $node) {
if (time()-$node->node_heartbeat<60&&file_exists(BASE_PATH."/storage/".$node->id.".offline")&&$node->node_heartbeat!=0&&($node->sort==0||$node->sort==7||$node->sort==8||$node->sort==10)) {
foreach ($adminUser as $user) {
echo "Send offline mail to user: ".$user->id;
$subject = Config::get('appName')."-系统提示";
$to = $user->email;
$text = "管理员您好,系统发现节点 ".$node->name." 恢复上线了。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
echo $e->getMessage();
}
elseif ($node->isNodeOnline() === true && file_exists(BASE_PATH."/storage/".$node->id.".offline")) {
foreach ($adminUser as $user) {
echo "Send offline mail to user: ".$user->id;
$subject = Config::get('appName')."-系统提示";
$to = $user->email;
$text = "管理员您好,系统发现节点 ".$node->name." 恢复上线了。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
if (Config::get('enable_cloudxns')=='true'&& ($node->sort==0 || $node->sort==10)) {
$api=new Api();
$api->setApiKey(Config::get("cloudxns_apikey"));//修改成自己API KEY
$api->setSecretKey(Config::get("cloudxns_apisecret"));//修改成自己的SECERET KEY
$api->setProtocol(true);
$domain_json=json_decode($api->domain->domainList());
foreach ($domain_json->data as $domain) {
if (strpos($domain->domain, Config::get('cloudxns_domain'))!==false) {
$domain_id=$domain->id;
}
if (Config::get('enable_cloudxns')=='true'&& ($node->sort==0 || $node->sort==10)) {
$api=new Api();
$api->setApiKey(Config::get("cloudxns_apikey"));//修改成自己API KEY
$api->setSecretKey(Config::get("cloudxns_apisecret"));//修改成自己的SECERET KEY
$api->setProtocol(true);
$domain_json=json_decode($api->domain->domainList());
foreach ($domain_json->data as $domain) {
if (strpos($domain->domain, Config::get('cloudxns_domain'))!==false) {
$domain_id=$domain->id;
}
}
$record_json=json_decode($api->record->recordList($domain_id, 0, 0, 2000));
$record_json=json_decode($api->record->recordList($domain_id, 0, 0, 2000));
foreach ($record_json->data as $record) {
if (($record->host.".".Config::get('cloudxns_domain'))==$node->server) {
$record_id=$record->record_id;
foreach ($record_json->data as $record) {
if (($record->host.".".Config::get('cloudxns_domain'))==$node->server) {
$record_id=$record->record_id;
$api->record->recordUpdate($domain_id, $record->host, $node->getNodeIp(), 'A', 55, 600, 1, '', $record_id);
}
$api->record->recordUpdate($domain_id, $record->host, $node->getNodeIp(), 'A', 55, 600, 1, '', $record_id);
}
$notice_text = "喵喵喵~ ".$node->name." 节点恢复了喵~域名解析被切换回来了喵~";
}
$notice_text = "喵喵喵~ ".$node->name." 节点恢复了喵~域名解析被切换回来了喵~";
} else {
$notice_text = "喵喵喵~ ".$node->name." 节点恢复了喵~";
}
@ -598,10 +542,12 @@ class Job
Telegram::Send($notice_text);
unlink(BASE_PATH."/storage/".$node->id.".offline");
}
}
}
}
//登录地检测
if (Config::get("login_warn")=="true") {
$iplocation = new QQWry();
@ -632,7 +578,7 @@ class Job
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
}
@ -642,11 +588,6 @@ class Job
}
}
$users = User::all();
foreach ($users as $user) {
if (($user->transfer_enable<=$user->u+$user->d||$user->enable==0||(strtotime($user->expire_in)<time()&&strtotime($user->expire_in)>644447105))&&RadiusBan::where("userid", $user->id)->first()==null) {
@ -656,131 +597,162 @@ class Job
Radius::Delete($user->email);
}
if (strtotime($user->expire_in) < time() && (((Config::get('enable_account_expire_reset')=='true' && strtotime($user->expire_in) < time()) ? $user->transfer_enable != Tools::toGB(Config::get('enable_account_expire_reset_traffic')) : true) && ((Config::get('enable_class_expire_reset')=='true' && ($user->class!=0 && strtotime($user->class_expire)<time() && strtotime($user->class_expire) > 1420041600))? $user->transfer_enable != Tools::toGB(Config::get('enable_class_expire_reset_traffic')) : true))) {
if (Config::get('enable_account_expire_reset')=='true') {
$user->transfer_enable = Tools::toGB(Config::get('enable_account_expire_reset_traffic'));
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
$subject = Config::get('appName')."-您的用户账户已经过期了";
$to = $user->email;
$text = "您好,系统发现您的账号已经过期了。流量已经被重置为".Config::get('enable_account_expire_reset_traffic').'GB' ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
echo $e->getMessage();
}
if (strtotime($user->expire_in) < time()&&!file_exists(BASE_PATH."/storage/".$user->id.".expire_in")) {
$user->transfer_enable = 0;
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
$subject = Config::get('appName')."-您的用户账户已经过期了";
$to = $user->email;
$text = "您好,系统发现您的账号已经过期了。";
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
$myfile = fopen(BASE_PATH."/storage/".$user->id.".expire_in", "w+") or die("Unable to open file!");
$txt = "1";
fwrite($myfile, $txt);
fclose($myfile);
}
if (strtotime($user->expire_in)+((int)Config::get('enable_account_expire_delete_days')*86400)<time()) {
if (Config::get('enable_account_expire_delete')=='true') {
$subject = Config::get('appName')."-您的用户账户已经被删除了";
elseif (strtotime($user->expire_in) > time()&&file_exists(BASE_PATH."/storage/".$user->id.".expire_in")) {
unlink(BASE_PATH."/storage/".$user->id.".expire_in");
}
//余量不足检测
if(!file_exists(BASE_PATH."/storage/traffic_notified/")){
mkdir(BASE_PATH."/storage/traffic_notified/");
}
if (Config::get('notify_limit_mode') !='false'){
$user_traffic_left = $user->transfer_enable - $user->u - $user->d;
$under_limit='false';
if($user->transfer_enable != 0){
if (Config::get('notify_limit_mode') == 'per'&&
$user_traffic_left / $user->transfer_enable * 100 < Config::get('notify_limit_value')){
$under_limit='true';
$unit_text='%';
}
}
else if(Config::get('notify_limit_mode')=='mb'&&
Tools::flowToMB($user_traffic_left) < Config::get('notify_limit_value')){
$under_limit='true';
$unit_text='MB';
}
if($under_limit=='true' && !file_exists(BASE_PATH."/storage/traffic_notified/".$user->id.".userid")){
$subject = Config::get('appName')." - 您的剩余流量过低";
$to = $user->email;
$text = "您好,系统发现您的账号已经过期 ".Config::get('enable_account_expire_delete_days')." 天了,帐号已经被删除。" ;
$text = '您好,系统发现您剩余流量已经低于 '.Config::get('notify_limit_value').$unit_text.' 。' ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
$myfile = fopen(BASE_PATH."/storage/traffic_notified/".$user->id.".userid", "w+") or die("Unable to open file!");
$txt = "1";
fwrite($myfile, $txt);
fclose($myfile);
} catch (\Exception $e) {
echo $e->getMessage();
}
$user->kill_user();
continue;
}
else if($under_limit=='false'){
if(file_exists(BASE_PATH."/storage/traffic_notified/".$user->id.".userid")){
unlink(BASE_PATH."/storage/traffic_notified/".$user->id.".userid");
}
}
}
if ((int)Config::get('enable_auto_clean_uncheck_days')!=0 && max($user->last_check_in_time, strtotime($user->reg_date)) + ((int)Config::get('enable_auto_clean_uncheck_days')*86400) < time() && $user->class == 0 && $user->money <= (int)Config::get('auto_clean_min_money')) {
if (Config::get('enable_auto_clean_uncheck')=='true') {
$subject = Config::get('appName')."-您的用户账户已经被删除了";
$to = $user->email;
$text = "您好,系统发现您的账号已经 ".Config::get('enable_auto_clean_uncheck_days')." 天没签到了,帐号已经被删除。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
echo $e->getMessage();
}
Radius::Delete($user->email);
RadiusBan::where('userid', '=', $user->id)->delete();
Wecenter::Delete($user->email);
$user->delete();
continue;
if (Config::get('account_expire_delete_days')>=0&&
strtotime($user->expire_in)+Config::get('account_expire_delete_days')*86400<time()
) {
$subject = Config::get('appName')."-您的用户账户已经被删除了";
$to = $user->email;
$text = "您好,系统发现您的账户已经过期 ".Config::get('account_expire_delete_days')." 天了,帐号已经被删除。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
$user->kill_user();
continue;
}
if ((int)Config::get('enable_auto_clean_unused_days')!=0 && max($user->t, strtotime($user->reg_date)) + ((int)Config::get('enable_auto_clean_unused_days')*86400) < time() && $user->class == 0 && $user->money <= (int)Config::get('auto_clean_min_money')) {
if (Config::get('enable_auto_clean_unused')=='true') {
$subject = Config::get('appName')."-您的用户账户已经被删除了";
$to = $user->email;
$text = "您好,系统发现您的账号已经 ".Config::get('enable_auto_clean_unused_days')." 天没使用了,帐号已经被删除。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
echo $e->getMessage();
}
Radius::Delete($user->email);
RadiusBan::where('userid', '=', $user->id)->delete();
Wecenter::Delete($user->email);
$user->delete();
continue;
if (Config::get('auto_clean_uncheck_days')>0 &&
max($user->last_check_in_time, strtotime($user->reg_date)) + (Config::get('auto_clean_uncheck_days')*86400) < time() &&
$user->class == 0 &&
$user->money <= Config::get('auto_clean_min_money')
) {
$subject = Config::get('appName')."-您的用户账户已经被删除了";
$to = $user->email;
$text = "您好,系统发现您的账号已经 ".Config::get('auto_clean_uncheck_days')." 天没签到了,帐号已经被删除。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
$user->kill_user();
continue;
}
if ($user->class!=0 && (((Config::get('enable_account_expire_reset')=='true' && strtotime($user->expire_in) < time()) ? $user->transfer_enable != Tools::toGB(Config::get('enable_account_expire_reset_traffic')) : true) && ((Config::get('enable_class_expire_reset')=='true' && ($user->class!=0 && strtotime($user->class_expire)<time() && strtotime($user->class_expire) > 1420041600))? $user->transfer_enable != Tools::toGB(Config::get('enable_class_expire_reset_traffic')) : true)) && strtotime($user->class_expire)<time() && strtotime($user->class_expire) > 1420041600) {
if (Config::get('enable_class_expire_reset')=='true') {
$user->transfer_enable = Tools::toGB(Config::get('enable_class_expire_reset_traffic'));
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
$subject = Config::get('appName')."-您的用户等级已经过期了";
$to = $user->email;
$text = "您好,系统发现您的账号等级已经过期了。流量已经被重置为".Config::get('enable_class_expire_reset_traffic').'GB' ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
echo $e->getMessage();
}
if (Config::get('auto_clean_unused_days')>0 &&
max($user->t, strtotime($user->reg_date)) + (Config::get('auto_clean_unused_days')*86400) < time() &&
$user->class == 0 &&
$user->money <= Config::get('auto_clean_min_money')
) {
$subject = Config::get('appName')."-您的用户账户已经被删除了";
$to = $user->email;
$text = "您好,系统发现您的账号已经 ".Config::get('auto_clean_unused_days')." 天没使用了,帐号已经被删除。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
$user->class=0;
$user->kill_user();
continue;
}
if ($user->class!=0 && strtotime($user->class_expire)<time() && strtotime($user->class_expire) > 1420041600) {
if ($user->class!=0 &&
strtotime($user->class_expire)<time() &&
strtotime($user->class_expire) > 1420041600
){
$text = '您好,系统发现您的账号等级已经过期了。';
$reset_traffic=Config::get('class_expire_reset_traffic');
if($reset_traffic>=0){
$user->transfer_enable =Tools::toGB($reset_traffic);
$user->u = 0;
$user->d = 0;
$user->last_day_t = 0;
$text.='流量已经被重置为'.$reset_traffic.'GB';
}
$subject = Config::get('appName')."-您的账户等级已经过期了";
$to = $user->email;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
$user->class=0;
}
@ -802,4 +774,148 @@ class Job
}
}
}
public static function detectGFW()
{
//节点被墙检测
$last_time=file_get_contents(BASE_PATH."/storage/last_detect_gfw_time");
for ($count=1;$count<=12;$count++){
if(time()-$last_time>=Config::get("detect_gfw_interval")){
$file_interval=fopen(BASE_PATH."/storage/last_detect_gfw_time","w");
fwrite($file_interval,time());
fclose($file_interval);
$nodes=Node::all();
$adminUser = User::where("is_admin", "=", "1")->get();
foreach ($nodes as $node){
if($node->node_ip==""||
$node->node_ip==null||
file_exists(BASE_PATH."/storage/".$node->id."offline")==true){
continue;
}
$api_url=Config::get("detect_gfw_url");
$api_url=str_replace('{ip}',$node->node_ip,$api_url);
$api_url=str_replace('{port}',Config::get('detect_gfw_port'),$api_url);
//因为考虑到有v2ray之类的节点,所以不得不使用ip作为参数
$result_tcping=false;
$detect_time=Config::get("detect_gfw_count");
for ($i=1;$i<=$detect_time;$i++){
$json_tcping = json_decode(file_get_contents($api_url), true);
if(eval('return '.Config::get('detect_gfw_judge').';')){
$result_tcping=true;
break;
}
}
if($result_tcping==false){
//被墙了
echo($node->id.":false".PHP_EOL);
//判断有没有发送过邮件
if(file_exists(BASE_PATH."/storage/".$node->id.".gfw")){
continue;
}
foreach ($adminUser as $user) {
echo "Send gfw mail to user: ".$user->id."-";
$subject = Config::get('appName')."-系统警告";
$to = $user->email;
$text = "管理员您好,系统发现节点 ".$node->name." 被墙了,请您及时处理。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
}
catch (\Exception $e) {
echo $e->getMessage();
}
if (Config::get('enable_cloudxns')=='true' && ($node->sort==0 || $node->sort==10)) {
$api=new Api();
$api->setApiKey(Config::get("cloudxns_apikey"));
//修改成自己API KEY
$api->setSecretKey(Config::get("cloudxns_apisecret"));
//修改成自己的SECERET KEY
$api->setProtocol(true);
$domain_json=json_decode($api->domain->domainList());
foreach ($domain_json->data as $domain) {
if (strpos($domain->domain, Config::get('cloudxns_domain'))!==false) {
$domain_id=$domain->id;
}
}
$record_json=json_decode($api->record->recordList($domain_id, 0, 0, 2000));
foreach ($record_json->data as $record) {
if (($record->host.".".Config::get('cloudxns_domain'))==$node->server) {
$record_id=$record->record_id;
$Temp_node=Node::where('node_class', '<=', $node->node_class)->where(
function ($query) use ($node) {
$query->where("node_group", "=", $node->node_group)
->orWhere("node_group", "=", 0);
})->whereRaw('UNIX_TIMESTAMP()-`node_heartbeat`<300')->first();
if ($Temp_node!=null) {
$api->record->recordUpdate($domain_id, $record->host, $Temp_node->server, 'CNAME', 55, 60, 1, '', $record_id);
}
$notice_text = "喵喵喵~ ".$node->name." 节点被墙了喵~域名解析被切换到了 ".$Temp_node->name." 上了喵~";
}
}
} else {
$notice_text = "喵喵喵~ ".$node->name." 节点被墙了喵~";
}
}
Telegram::Send($notice_text);
$file_node = fopen(BASE_PATH."/storage/".$node->id.".gfw", "w+");
fclose($file_node);
} else{
//没有被墙
echo($node->id.":true".PHP_EOL);
if(file_exists(BASE_PATH."/storage/".$node->id.".gfw")==false){
continue;
}
foreach ($adminUser as $user) {
echo "Send gfw mail to user: ".$user->id."-";
$subject = Config::get('appName')."-系统提示";
$to = $user->email;
$text = "管理员您好,系统发现节点 ".$node->name." 溜出墙了。" ;
try {
Mail::send($to, $subject, 'news/warn.tpl', [
"user" => $user,"text" => $text
], [
]);
}
catch (\Exception $e) {
echo $e->getMessage();
}
if (Config::get('enable_cloudxns')=='true'&& ($node->sort==0 || $node->sort==10)) {
$api=new Api();
$api->setApiKey(Config::get("cloudxns_apikey"));
//修改成自己API KEY
$api->setSecretKey(Config::get("cloudxns_apisecret"));
//修改成自己的SECERET KEY
$api->setProtocol(true);
$domain_json=json_decode($api->domain->domainList());
foreach ($domain_json->data as $domain) {
if (strpos($domain->domain, Config::get('cloudxns_domain'))!==false) {
$domain_id=$domain->id;
}
}
$record_json=json_decode($api->record->recordList($domain_id, 0, 0, 2000));
foreach ($record_json->data as $record) {
if (($record->host.".".Config::get('cloudxns_domain'))==$node->server) {
$record_id=$record->record_id;
$api->record->recordUpdate($domain_id, $record->host, $node->getNodeIp(), 'A', 55, 600, 1, '', $record_id);
}
}
$notice_text = "喵喵喵~ ".$node->name." 节点恢复了喵~域名解析被切换回来了喵~";
} else {
$notice_text = "喵喵喵~ ".$node->name." 节点恢复了喵~";
}
}
Telegram::Send($notice_text);
unlink(BASE_PATH."/storage/".$node->id.".gfw");
}
}
break;
} else{
echo($node->id."interval skip".PHP_EOL);
sleep(3);
}
}
}
}

@ -177,7 +177,7 @@ class SyncRadius
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
}

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

@ -9,6 +9,7 @@ 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\Services\Config;
@ -28,18 +29,26 @@ class XCat
public function boot()
{
switch ($this->argv[1]) {
case("install"):
return $this->install();
case("alipay"):
return (new ChenPay())->AliPayListen();
case("wxpay"):
return (new ChenPay())->WxPayListen();
case("createAdmin"):
return $this->createAdmin();
case("resetTraffic"):
return $this->resetTraffic();
case("setTelegram"):
return $this->setTelegram();
return $this->setTelegram();
case("initQQWry"):
return $this->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"):
@ -56,14 +65,14 @@ class XCat
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"):
return Job::CheckJob();
case("syncduoshuo"):
return Job::SyncDuoshuo();
case("userga"):
return Job::UserGa();
case("backup"):
@ -74,19 +83,52 @@ class XCat
return Job::updatedownload();
case("cleanRelayRule"):
return $this->cleanRelayRule();
case("resetport"):
return $this->resetport();
default:
case("resetPort"):
return $this->resetPort();
case("resetAllPort"):
return $this->resetAllPort();
case("update"):
return Update::update($this);
default:
return $this->defaultAction();
}
}
public function defaultAction()
{
echo "Memo";
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);
}
public function resetport()
public function resetPort()
{
fwrite(STDOUT, "请输入用户id: ");
$user=User::Where("id", "=", trim(fgets(STDIN)))->first();
$origin_port = $user->port;
$user->port = Tools::getAvPort();
$relay_rules = Relay::where('user_id', $user->id)->where('port', $origin_port)->get();
foreach ($relay_rules as $rule) {
$rule->port = $user->port;
$rule->save();
}
if ($user->save()) {
echo "重置成功!\n";
}
}
public function resetAllPort()
{
$users = User::all();
foreach ($users as $user) {
@ -117,11 +159,6 @@ class XCat
}
}
public function install()
{
echo "x cat will install ss-panel v3...../n";
}
public function initdownload()
{
system('git clone https://github.com/xcxnig/ssr-download.git '.BASE_PATH."/public/ssr-download/", $ret);
@ -130,18 +167,16 @@ class XCat
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 添加密码 ");
fwrite(STDOUT, "Enter password for: $email / 为 $email 添加密码: ");
$passwd = trim(fgets(STDIN));
echo "Email: $email, Password: $passwd! ";
fwrite(STDOUT, "Press [Y] to create admin..... 按下[Y]确认来确认创建管理员账户..... ");
fwrite(STDOUT, "Press [Y] to create admin..... 按下[Y]确认来确认创建管理员账户..... \n");
$y = trim(fgets(STDIN));
if (strtolower($y) == "y") {
echo "start create admin account";
@ -170,17 +205,13 @@ class XCat
$user->node_speedlimit=0;
$user->theme=Config::get('theme');
$ga = new GA();
$secret = $ga->createSecret();
$user->ga_token=$secret;
$user->ga_enable=0;
if ($user->save()) {
echo "Successful/添加成功!";
echo "Successful/添加成功!\n";
return true;
}
echo "添加失败";
@ -217,10 +248,10 @@ class XCat
public function initQQWry()
{
echo("downloading....");
$copywrite = file_get_contents("https://github.com/esdeathlove/qqwry-download/raw/master/copywrite.rar");
$copywrite = file_get_contents("https://qqwry.mirror.noc.one/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");
$qqwry = file_get_contents("https://qqwry.mirror.noc.one/qqwry.rar");
if ($qqwry != "") {
$key = unpack("V6", $copywrite)[6];
for ($i=0; $i<0x200; $i++) {

@ -30,40 +30,56 @@ 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');
$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');
$beginSend = (int)($request->getParam('page') - 1) * Config::get('sendPageLimit');
$users = User::where('class', ">=", $vip)->skip($beginSend)->limit(Config::get('sendPageLimit'))->get();
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 ($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;
}
$subject = Config::get('appName')."-公告";
$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;
}
}
}
Telegram::SendMarkdown("新公告:".PHP_EOL.$request->getParam('markdown'));
$rs['ret'] = 1;
$rs['msg'] = "公告添加成功,邮件发送成功";
return $response->getBody()->write(json_encode($rs));
if(count($users) == Config::get('sendPageLimit')){
$rs['ret'] = 2;
$rs['msg'] = $request->getParam('page') + 1;
return $response->getBody()->write(json_encode($rs));
}else{
Telegram::SendMarkdown("新公告:".PHP_EOL.$request->getParam('markdown'));
$rs['ret'] = 1;
if ($issend == 1){
$rs['msg'] = "公告添加成功,邮件发送成功";
}
else{
$rs['msg'] = "公告添加成功";
}
return $response->getBody()->write(json_encode($rs));
}
}
public function edit($request, $response, $args)

@ -43,6 +43,11 @@ class CodeController extends AdminController
$type = $request->getParam('type');
$number = $request->getParam('number');
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);

@ -7,7 +7,8 @@ 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;
@ -40,7 +41,7 @@ class NodeController extends AdminController
{
$node = new Node();
$node->name = $request->getParam('name');
$node->server = $request->getParam('server');
$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');
@ -52,21 +53,35 @@ class NodeController extends AdminController
$node->node_speedlimit = $request->getParam('node_speedlimit');
$node->status = $request->getParam('status');
$node->sort = $request->getParam('sort');
if ($node->sort == 0 || $node->sort == 1 || $node->sort == 10 || $node->sort == 11) {
if ($request->getParam('node_ip') != '') {
$node->node_ip = $request->getParam('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 ($node->sort == 11) {
$server_list = explode(";", $node->server);
if(!Tools::is_ip($server_list[0])){
$node->node_ip = gethostbyname($server_list[0]);
}else{
$node->node_ip = $req_node_ip;
}
} else if ($node->sort == 0 || $node->sort == 1 || $node->sort == 10){
if(!Tools::is_ip($node->server)){
$node->node_ip = gethostbyname($node->server);
}else{
$node->node_ip = $req_node_ip;
}
} else {
$node->node_ip="";
}
if($node->node_ip==""&&($node->sort == 11||$node->sort == 0 || $node->sort == 1 || $node->sort == 10)){
$rs['ret'] = 0;
$rs['msg'] = "获取节点IP失败,请检查您输入的节点地址是否正确!";
return $response->getBody()->write(json_encode($rs));
}
if ($node->sort==1) {
Radius::AddNas($node->node_ip, $request->getParam('server'));
}
@ -74,10 +89,11 @@ class NodeController extends AdminController
$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));
$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);
}
Telegram::Send("新节点添加~".$request->getParam('name'));
@ -103,7 +119,7 @@ class NodeController extends AdminController
$node->name = $request->getParam('name');
$node->node_group = $request->getParam('group');
$node->server = $request->getParam('server');
$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');
@ -114,33 +130,34 @@ class NodeController extends AdminController
$node->type = $request->getParam('type');
$node->sort = $request->getParam('sort');
if ($node->sort == 0 || $node->sort == 1 || $node->sort == 10 || $node->sort == 11) {
if ($request->getParam('node_ip') != '') {
$node->node_ip = $request->getParam('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'));
}
if (!succ) {
$rs['ret'] = 0;
$rs['msg'] = "更新节点IP失败,请检查您输入的节点地址是否正确!";
return $response->getBody()->write(json_encode($rs));
}
}
}
$req_node_ip=trim($request->getParam('node_ip'));
if($req_node_ip==""){
$req_node_ip=$node->server;
}
$success=true;
if ($node->sort == 11) {
$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 if ($node->sort == 0 || $node->sort == 1 || $node->sort == 10){
if(!Tools::is_ip($node->server)){
$success=$node->changeNodeIp($node->server);
}else{
$success=$node->changeNodeIp($req_node_ip);
}
} else {
$node->node_ip="";
}
if ($node->sort == 0 || $node->sort == 10) {
Tools::updateRelayRuleIp($node);
}
if (!$success) {
$rs['ret'] = 0;
$rs['msg'] = "更新节点IP失败,请检查您输入的节点地址是否正确!";
return $response->getBody()->write(json_encode($rs));
}
if ($node->sort==1) {
$SS_Node=Node::where('sort', '=', 0)->where('server', '=', $request->getParam('server'))->first();
@ -148,7 +165,8 @@ class NodeController extends AdminController
if (time()-$SS_Node->node_heartbeat<300||$SS_Node->node_heartbeat==0) {
Radius::AddNas(gethostbyname($request->getParam('server')), $request->getParam('server'));
}
} else {
}
else {
Radius::AddNas(gethostbyname($request->getParam('server')), $request->getParam('server'));
}
}
@ -158,11 +176,7 @@ class NodeController extends AdminController
$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));
}
$node->save();
Telegram::Send("节点信息被修改~".$request->getParam('name'));
@ -246,24 +260,9 @@ class NodeController extends AdminController
case 2:
$sort = 'SSH';
break;
case 3:
$sort = 'PAC';
break;
case 4:
$sort = 'APN文件外链';
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;
case 9:
$sort = 'Shadowsocks - 单端口多用户';
break;

@ -5,6 +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;
@ -16,7 +17,7 @@ class ShopController extends AdminController
$table_config['total_column'] = array("op" => "操作", "id" => "ID", "name" => "商品名称",
"price" => "价格", "content" => "商品内容",
"auto_renew" => "自动续费", "auto_reset_bandwidth" => "续费时是否重置流量",
"status" => "状态");
"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);
@ -75,6 +76,10 @@ class ShopController extends AdminController
$content["connector"]=$request->getParam('connector');
//}
if ($request->getParam('content_extra')!='') {
$content["content_extra"]=$request->getParam('content_extra');
}
$shop->content=json_encode($content);
@ -155,6 +160,10 @@ class ShopController extends AdminController
$content["connector"]=$request->getParam('connector');
//}
if ($request->getParam('content_extra')!='') {
$content["content_extra"]=$request->getParam('content_extra');
}
$shop->content=json_encode($content);
if (!$shop->save()) {
@ -194,10 +203,11 @@ class ShopController extends AdminController
public function bought($request, $response, $args)
{
$table_config['total_column'] = array("op" => "操作", "id" => "ID", "content" => "内容",
$table_config['total_column'] = array("op" => "操作", "id" => "ID",
"datetime" => "购买日期","content" => "内容",
"price" => "价格", "user_id" => "用户ID",
"user_name" => "用户名", "renew" => "自动续费时间", "auto_reset_bandwidth" => "续费时是否重置流量",
"datetime" => "自动重置");
"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);
@ -224,7 +234,7 @@ class ShopController extends AdminController
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>
@ -247,11 +257,24 @@ class ShopController extends AdminController
$datatables->edit('auto_reset_bandwidth', function ($data) {
return $data['auto_reset_bandwidth'] == 0 ? '不自动重置' : '自动重置';
});
$datatables->edit('status', function ($data) {
return $data['status'] == 1 ? '上架' : '下架';
});
$datatables->edit('period_sales', 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());
}

@ -65,7 +65,7 @@ class TicketController extends AdminController
"user" => $user,"text" => $text
], [
]);
} catch (Exception $e) {
} catch (\Exception $e) {
echo $e->getMessage();
}
}

@ -7,10 +7,12 @@ use App\Models\Ip;
use App\Models\RadiusBan;
use App\Models\Relay;
use App\Controllers\AdminController;
use App\Services\Config;
use App\Services\Auth;
use App\Utils;
use App\Utils\Hash;
use App\Utils\Radius;
use App\Utils\QQWry;
use App\Utils\Wecenter;
use App\Utils\Tools;
class UserController extends AdminController
@ -20,15 +22,15 @@ class UserController extends AdminController
$table_config['total_column'] = array("op" => "操作", "id" => "ID", "user_name" => "用户名",
"remark" => "备注", "email" => "邮箱", "money" => "金钱",
"im_type" => "联络方式类型", "im_value" => "联络方式详情",
"node_group" => "群组", "account_expire_in" => "账户过期时间",
"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",
"is_enable" => "是否启用", "reg_date" => "注册时间",
"reg_location" => "注册IP", "auto_reset_day" => "自动重置流量日",
"enable" => "是否启用", "reg_date" => "注册时间",
"reg_ip" => "注册IP", "auto_reset_day" => "自动重置流量日",
"auto_reset_bandwidth" => "自动重置流量/GB", "ref_by" => "邀请人ID", "ref_by_user_name" => "邀请人用户名");
$table_config['default_show_column'] = array("op", "id", "user_name", "remark", "email");
$table_config['ajax_url'] = 'user/ajax';
@ -156,7 +158,6 @@ class UserController extends AdminController
if ($request->getParam('pass') != '') {
$user->pass = Hash::passwordHash($request->getParam('pass'));
Wecenter::ChangeUserName($email1, $email2, $request->getParam('pass'), $user->user_name);
$user->clean_link();
}
@ -184,6 +185,7 @@ class UserController extends AdminController
$user->node_connector = $request->getParam('node_connector');
$user->enable = $request->getParam('enable');
$user->is_admin = $request->getParam('is_admin');
$user->ga_enable = $request->getParam('ga_enable');
$user->node_group = $request->getParam('group');
$user->ref_by = $request->getParam('ref_by');
$user->remark = $request->getParam('remark');
@ -221,27 +223,152 @@ class UserController extends AdminController
$rs['msg'] = "删除成功";
return $response->getBody()->write(json_encode($rs));
}
public function ajax($request, $response, $args)
public function changetouser($request, $response, $args)
{
$pageNum = 1;
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
}
$users = User::skip(($pageNum - 1) * 100)->limit(100)->get();
$total_conut = User::count();
if($total_conut < $pageNum * 100) {
$res['next'] = 0;
} else {
$res['next'] = 1;
$userid = $request->getParam('userid');
$adminid = $request->getParam('adminid');
$user = User::find($userid);
$admin = User::find($adminid);
$expire_in = time()+60*60;
if (!$admin->is_admin || !$user || !Auth::getUser()->isLogin) {
$rs['ret'] = 0;
$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);
$rs['ret'] = 1;
$rs['msg'] = "切换成功";
return $response->getBody()->write(json_encode($rs));
}
$res['data'] = array();
foreach ($users as $user) {
array_push($res['data'], $user->get_table_json_array());
public function ajax($request, $response, $args)
{
//得到排序的方式
$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'];
$users=array();
$count_filtered=0;
if ($search) {
$users = User::orderBy($order_field,$order)
->skip($limit_start)->limit($limit_length)
->where(
function ($query) use ($search) {
$query->where('id','LIKE',"%$search%")
->orwhere('user_name','LIKE',"%$search%")
->orwhere('email','LIKE',"%$search%")
->orwhere('im_value','LIKE',"%$search%")
->orwhere('port','LIKE',"%$search%");
}
)
->get();
$count_filtered = User::where(
function ($query)use($search) {
$query->where('id','LIKE',"%$search%")
->orwhere('user_name','LIKE',"%$search%")
->orwhere('email','LIKE',"%$search%")
->orwhere('im_value','LIKE',"%$search%")
->orwhere('port','LIKE',"%$search%");
}
)->count();
}
else{
$users = User::orderBy($order_field,$order)
->skip($limit_start)->limit($limit_length)
->get();
$count_filtered = User::count();
}
return $this->echoJson($response, $res);
}
$data=array();
foreach ($users as $user) {
$tempdata=array();
//model里是casts所以没法直接 $tempdata=(array)$user
$tempdata['op']='<a class="btn btn-brand" href="/admin/user/'.$user->id.'/edit">编辑</a>
<a class="btn btn-brand-accent" id="delete" href="javascript:void(0);" onClick="delete_modal_show(\''.$user->id.'\')">删除</a>
<a class="btn btn-brand" id="changetouser" href="javascript:void(0);" onClick="changetouser_modal_show(\''.$user->id.'\')">切换为该用户</a>';;
$tempdata['id']=$user->id;
$tempdata['user_name']=$user->user_name;
$tempdata['remark']=$user->remark;
$tempdata['email']=$user->email;
$tempdata['money']=$user->money;
$tempdata['im_value']=$user->im_value;
switch($user->im_type) {
case 1:
$tempdata['im_type'] = '微信';
break;
case 2:
$tempdata['im_type'] = 'QQ';
break;
case 3:
$tempdata['im_type'] = 'Google+';
break;
default:
$tempdata['im_type'] = 'Telegram';
$tempdata['im_value'] = '<a href="https://telegram.me/'.$user->im_value.'">'.$user->im_value.'</a>';
}
$tempdata['node_group']=$user->node_group;
$tempdata['expire_in']=$user->expire_in;
$tempdata['class']=$user->class;
$tempdata['class_expire']=$user->class_expire;
$tempdata['passwd']=$user->passwd;
$tempdata['port']=$user->port;
$tempdata['method']=$user->method;
$tempdata['protocol']=$user->protocol;
$tempdata['obfs']=$user->obfs;
$tempdata['online_ip_count']=$user->online_ip_count();
$tempdata['last_ss_time']=$user->lastSsTime();
$tempdata['used_traffic']=Tools::flowToGB($user->u + $user->d);
$tempdata['enable_traffic']=Tools::flowToGB($user->transfer_enable);
$tempdata['last_checkin_time']=$user->lastCheckInTime();
$tempdata['today_traffic']=Tools::flowToMB($user->u + $user->d-$user->last_day_t);
$tempdata['enable']=$user->enable == 1 ? "可用" : "禁用";
$tempdata['reg_date']=$user->reg_date;
$tempdata['reg_ip']=$user->reg_ip;
$tempdata['auto_reset_day']=$user->auto_reset_day;
$tempdata['auto_reset_bandwidth']=$user->auto_reset_bandwidth;
$tempdata['ref_by']= $user->ref_by;
if ($user->ref_by == 0) {
$tempdata['ref_by_user_name'] = "系统邀请";
}
else {
$ref_user = User::find($user->ref_by);
if ($ref_user == null) {
$tempdata['ref_by_user_name'] = "邀请人已经被删除";
}
else {
$tempdata['ref_by_user_name'] = $ref_user->user_name;
}
}
array_push($data,$tempdata);
}
$info = [
'draw'=> $request->getParam('draw'), // ajax请求次数,作为标识符
'recordsTotal'=>User::count(),
'recordsFiltered'=>$count_filtered,
'data'=>$data,
];
return json_encode($info,true);
}
}

@ -8,6 +8,8 @@ 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 +33,17 @@ 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');
@ -50,12 +63,18 @@ class AdminController extends UserController
$table_config['ajax_url'] = 'payback/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/invite.tpl');
}
public function addInvite($request, $response, $args)
{
$n = $request->getParam('num');
$num = $request->getParam('num');
$prefix = $request->getParam('prefix');
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();
@ -65,14 +84,14 @@ class AdminController extends UserController
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;
}
$user->invite_num += $n;
$user->invite_num += $num;
$user->save();
$res['ret'] = 1;
$res['msg'] = "邀请次数添加成功";
@ -84,7 +103,7 @@ class AdminController extends UserController
{
$table_config['total_column'] = array("id" => "ID", "code" => "优惠码",
"expire" => "过期时间", "shop" => "限定商品ID",
"credit" => "额度");
"credit" => "额度", "onetime" => "次数");
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
@ -98,7 +117,7 @@ class AdminController extends UserController
$code = new Coupon();
$code->onetime=$request->getParam('onetime');
$code->code=$request->getParam('prefix').Tools::genRandomChar(8);
$code->code = $request->getParam('prefix');
$code->expire=time()+$request->getParam('expire')*3600;
$code->shop=$request->getParam('shop');
$code->credit=$request->getParam('credit');
@ -158,7 +177,7 @@ class AdminController extends UserController
public function ajax_coupon($request, $response, $args)
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select id,code,expire,shop,credit from coupon');
$datatables->query('Select id,code,expire,shop,credit,onetime from coupon');
$datatables->edit('expire', function ($data) {
return date('Y-m-d H:i:s', $data['expire']);

@ -18,25 +18,30 @@ 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;
/**
* AuthController
*/
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().rand(1, 10000) ;
$GtSdk = Geetest::get($uid);
break;
}
}
if (Config::get('enable_telegram') == 'true') {
@ -49,20 +54,42 @@ class AuthController extends BaseController
$login_number = '';
}
return $this->view()->assign('geetest_html', $GtSdk)->assign('login_token', $login_token)->assign('login_number', $login_number)->assign('telegram_bot', Config::get('telegram_bot'))->display('auth/login.tpl');
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('base_url', Config::get('baseUrl'))
->assign('recaptcha_sitekey', $recaptcha_sitekey)
->display('auth/login.tpl');
}
public function loginHandle($request, $response, $args)
{
// $data = $request->post('sdf');
$email = $request->getParam('email');
$email = $request->getParam('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'] = "系统无法接受您的验证结果,请刷新页面后重试。";
@ -84,22 +111,22 @@ class AuthController extends BaseController
$rs['msg'] = "邮箱或者密码错误.";
$loginip=new LoginIp();
$loginip->ip=$_SERVER["REMOTE_ADDR"];
$loginip->userid=$user->id;
$loginip->datetime=time();
$loginip->type=1;
$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;
$time = 3600 * 24;
if ($rememberMe) {
$time = 3600*24*7;
$time = 3600 * 24 * 7;
}
if ($user->ga_enable==1) {
if ($user->ga_enable == 1) {
$ga = new GA();
$rcode = $ga->verifyCode($user->ga_token, $code);
@ -112,26 +139,23 @@ class AuthController extends BaseController
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 = 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);
return $response->getBody()->write(json_encode($rs));
}
public function qrcode_loginHandle($request, $response, $args)
{
// $data = $request->post('sdf');
$token = $request->getParam('token');
$number = $request->getParam('number');
$token = $request->getParam('token');
$number = $request->getParam('number');
$ret = TelegramSessionManager::step2_verify_login_session($token, $number);
if (!$ret) {
@ -144,22 +168,27 @@ class AuthController extends BaseController
// Handle Login
$user = User::where('id', '=', $ret)->first();
// @todo
$time = 3600*24;
$time = 3600 * 24;
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();
$this->logUserIp($user->id, $_SERVER["REMOTE_ADDR"]);
return $response->getBody()->write(json_encode($rs));
}
private function logUserIp($id, $ip)
{
$loginip = new LoginIp();
$loginip->ip = $ip;
$loginip->userid = $id;
$loginip->datetime = time();
$loginip->type = 0;
$loginip->save();
}
public function register($request, $response, $next)
{
$ary = $request->getQueryParams();
@ -169,26 +198,38 @@ class AuthController extends BaseController
$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().rand(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);
if ($email=="") {
if ($email == "") {
$res['ret'] = 0;
$res['msg'] = "未填写邮箱";
return $response->getBody()->write(json_encode($res));
@ -201,16 +242,15 @@ class AuthController extends BaseController
return $response->getBody()->write(json_encode($res));
}
$user = User::where('email', '=', $email)->first();
if ($user!=null) {
if ($user != null) {
$res['ret'] = 0;
$res['msg'] = "此邮箱已经注册";
return $response->getBody()->write(json_encode($res));
}
$ipcount = EmailVerify::where('ip', '=', $_SERVER["REMOTE_ADDR"])->where('expire_in', '>', time())->count();
if ($ipcount>=(int)Config::get('email_verify_iplimit')) {
if ($ipcount >= (int)Config::get('email_verify_iplimit')) {
$res['ret'] = 0;
$res['msg'] = "此IP请求次数过多";
return $response->getBody()->write(json_encode($res));
@ -218,13 +258,13 @@ class AuthController extends BaseController
$mailcount = EmailVerify::where('email', '=', $email)->where('expire_in', '>', time())->count();
if ($mailcount>=3) {
if ($mailcount >= 3) {
$res['ret'] = 0;
$res['msg'] = "此邮箱请求次数过多";
return $response->getBody()->write(json_encode($res));
}
$code = Tools::genRandomChar(6);
$code = Tools::genRandomNum(6);
$ev = new EmailVerify();
$ev->expire_in = time() + Config::get('email_verify_ttl');
@ -233,16 +273,18 @@ class AuthController extends BaseController
$ev->code = $code;
$ev->save();
$subject = Config::get('appName')."- 验证邮件";
$subject = Config::get('appName') . "- 验证邮件";
try {
Mail::send($email, $subject, 'auth/verify.tpl', [
"code" => $code,"expire" => date("Y-m-d H:i:s", time() + Config::get('email_verify_ttl'))
"code" => $code, "expire" => date("Y-m-d H:i:s", time() + Config::get('email_verify_ttl'))
], [
//BASE_PATH.'/public/assets/email/styles.css'
]);
} catch (Exception $e) {
return false;
} catch (\Exception $e) {
$res['ret'] = 1;
$res['msg'] = "邮件发送失败,请联系网站管理员。";
return $response->getBody()->write(json_encode($res));
}
$res['ret'] = 1;
@ -251,21 +293,45 @@ class AuthController extends BaseController
}
}
public function registerHandle($request, $response, $next)
public function registerHandle($request, $response)
{
$name = $request->getParam('name');
$email = $request->getParam('email');
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 = strtolower($email);
$passwd = $request->getParam('passwd');
$repasswd = $request->getParam('repasswd');
$code = $request->getParam('code');
$code = trim($code);
$imtype = $request->getParam('imtype');
$emailcode = $request->getParam('emailcode');
$emailcode = trim($emailcode);
$wechat = $request->getParam('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'] = "系统无法接受您的验证结果,请刷新页面后重试。";
@ -273,16 +339,17 @@ class AuthController extends BaseController
}
}
//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'] = "邀请码无效";
return $response->getBody()->write(json_encode($res));
}
} else if ($c->user_id != 0) {
$gift_user=User::where("id", "=", $c->user_id)->first();
$gift_user = User::where("id", "=", $c->user_id)->first();
if ($gift_user == null) {
$res['ret'] = 0;
$res['msg'] = "邀请人不存在";
@ -298,6 +365,8 @@ class AuthController extends BaseController
}
}
// check email format
if (!Check::isEmailLegal($email)) {
$res['ret'] = 0;
@ -312,7 +381,7 @@ class AuthController extends BaseController
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;
@ -322,7 +391,7 @@ class AuthController extends BaseController
}
// check pwd length
if (strlen($passwd)<8) {
if (strlen($passwd) < 8) {
$res['ret'] = 0;
$res['msg'] = "密码请大于8位";
return $response->getBody()->write(json_encode($res));
@ -335,7 +404,7 @@ class AuthController extends BaseController
return $response->getBody()->write(json_encode($res));
}
if ($imtype==""||$wechat=="") {
if ($imtype == "" || $wechat == "") {
$res['ret'] = 0;
$res['msg'] = "请填上你的联络方式";
return $response->getBody()->write(json_encode($res));
@ -347,7 +416,7 @@ class AuthController extends BaseController
$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
@ -371,56 +440,56 @@ class AuthController extends BaseController
$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 = $imtype;
$user->im_value = $antiXss->xss_clean($wechat);
$user->im_type = $imtype;
$user->im_value = $antiXss->xss_clean($wechat);
$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->money = 0;
//dumplin:填写邀请人,写入邀请奖励
$user->ref_by =0;
$user->ref_by = 0;
if ($c != null) {
if ($c->user_id != 0) {
$gift_user=User::where("id", "=", $c->user_id)->first();
$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);
$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();
}
}
$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->plan='A';
$user->theme=Config::get('theme');
$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');
$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();
$user->ga_token=$secret;
$user->ga_enable=0;
$user->ga_token = $secret;
$user->ga_enable = 0;
if ($user->save()) {
$res['ret'] = 1;
$res['msg'] = "注册成功!正在进入登录界面";
Duoshuo::add($user);
Radius::Add($user, $user->passwd);
return $response->getBody()->write(json_encode($res));
}
$res['ret'] = 0;
$res['msg'] = "未知错误";
return $response->getBody()->write(json_encode($res));
@ -447,4 +516,50 @@ class AuthController extends BaseController
return $response->getBody()->write(json_encode($res));
}
}
public function telegram_oauth($request, $response, $args)
{
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"]);
// 登陆成功!
return $this->view()->assign('title', '登录成功')->assign('message', '正在前往仪表盘')->assign('redirect', '/user')->display('telegram_success.tpl');
}
// 验证失败
return $this->view()->assign('title', '登陆超时或非法构造信息')->assign('message', '很抱歉带来的不便,请重新试试')->assign('redirect', '/auth/login')->display('telegram_error.tpl');
}
return $response->withRedirect('/404');
}
private function telegram_oauth_check($auth_data)
{
$check_hash = $auth_data['hash'];
$bot_token = Config::get('telegram_token');;
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
}
sort($data_check_arr);
$data_check_string = implode("\n", $data_check_arr);
$secret_key = hash('sha256', $bot_token, true);
$hash = hash_hmac('sha256', $data_check_string, $secret_key);
if (strcmp($hash, $check_hash) !== 0) {
return false; // Bad Data :(
}
if ((time() - $auth_data['auth_date']) > 300) { // Expire @ 5mins
return false;
}
return true; // Good to Go
}
}

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

@ -9,6 +9,8 @@ use App\Models\Payback;
use App\Models\Paylist;
use App\Services\Auth;
use App\Services\Config;
use App\Services\Payment;
use App\Utils\AliPay;
use App\Utils\Tools;
use App\Utils\Telegram;
use App\Utils\Tuling;
@ -64,69 +66,40 @@ class HomeController extends BaseController
public function page404($request, $response, $args)
{
$pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/404/");
if (count($pics)>2) {
$pic=$pics[rand(2, count($pics)-1)];
} else {
$pic="4041.png";
}
$newResponse = $response->withStatus(404);
$newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/404/".$pic)->display('404.tpl'));
return $newResponse;
return $this->view()->display('404.tpl');
}
public function page405($request, $response, $args)
{
$pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/405/");
if (count($pics)>2) {
$pic=$pics[rand(2, count($pics)-1)];
} else {
$pic="4051.png";
}
$newResponse = $response->withStatus(405);
$newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/405/".$pic)->display('405.tpl'));
return $newResponse;
return $this->view()->display('405.tpl');
}
public function page500($request, $response, $args)
{
$pics=scandir(BASE_PATH."/public/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/500/");
if (count($pics)>2) {
$pic=$pics[rand(2, count($pics)-1)];
} else {
$pic="5001.png";
}
$newResponse = $response->withStatus(500);
$newResponse->getBody()->write($this->view()->assign("pic", "/theme/".(Auth::getUser()->isLogin==false?Config::get("theme"):Auth::getUser()->theme)."/images/error/500/".$pic)->display('500.tpl'));
return $newResponse;
return $this->view()->display('500.tpl');
}
public function codepay_callback($request, $response, $args)
{
echo '
<script>
window.location.href="/user/code";
</script>
';
return;
}
public function pay_callback($request, $response, $args)
{
Pay::callback($request);
}
public function f2fpay_pay_callback($request, $response, $args)
public function getOrderList($request, $response, $args)
{
Pay::f2fpay_pay_callback($request);
$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 codepay_pay_callback($request, $response, $args)
public function setOrder($request, $response, $args)
{
Pay::codepay_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)]));
}
}

File diff suppressed because it is too large Load Diff

@ -38,6 +38,10 @@ 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;
}
$rules = Relay::Where('source_node_id', $node_id)->get();
$res = [
@ -75,7 +79,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
@ -115,7 +122,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
@ -157,7 +167,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
@ -190,7 +203,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [

@ -13,6 +13,10 @@ 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;
}
$load = $request->getParam('load');
$uptime = $request->getParam('uptime');
$log = new NodeInfoLog();
@ -37,6 +41,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {
$res = [
@ -52,7 +60,9 @@ class NodeController extends BaseController
"node_speedlimit" => $node->node_speedlimit,
"traffic_rate" => $node->traffic_rate,
"mu_only" => $node->mu_only,
"sort" => $node->sort
"sort" => $node->sort,
"server" => $node->server,
"type" => "ss-panel-v3-mod_Uim"
],
];
return $this->echoJson($response, $res);

@ -10,7 +10,6 @@ use App\Models\Ip;
use App\Models\DetectLog;
use App\Controllers\BaseController;
use App\Utils\Tools;
use Ramsey\Uuid\Uuid;
class UserController extends BaseController
{
@ -20,14 +19,20 @@ class UserController extends BaseController
$params = $request->getQueryParams();
$node_id = $params['node_id'];
$node = Node::where("id", "=", $node_id)->first();
if ($node == null) {
$res = [
"ret" => 0
];
return $this->echoJson($response, $res);
}
$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();
@ -75,7 +80,7 @@ class UserController extends BaseController
foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
$user_raw->uuid = Uuid::uuid3(Uuid::NAMESPACE_DNS, $user_raw->passwd)->toString();
$user_raw->uuid = $user_raw->getUuid();
array_push($users, $user_raw);
}
}
@ -95,6 +100,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {
@ -163,6 +172,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {
@ -199,6 +212,10 @@ 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;
}
$node = Node::find($node_id);
if ($node == null) {

@ -58,11 +58,11 @@ class UserController extends BaseController
}
$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);
@ -72,7 +72,7 @@ class UserController extends BaseController
$res = [
"ret" => 1,
"msg" => "ok",
"data" => $users
"data" => $users_output
];
return $this->echoJson($response, $res);
}

@ -32,9 +32,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));
}
@ -49,7 +52,7 @@ class PasswordController extends BaseController
$tokenStr = $args['token'];
$password = $request->getParam('password');
$repasswd = $request->getParam('repasswd');
if ($password != $repasswd) {
$res['ret'] = 0;
$res['msg'] = "两次输入不符合";
@ -61,7 +64,7 @@ class PasswordController extends BaseController
$res['msg'] = "密码太短啦";
return $response->getBody()->write(json_encode($res));
}
// check token
$token = PasswordReset::where('token', $tokenStr)->first();
if ($token == null || $token->expire_time < time()) {
@ -88,9 +91,9 @@ class PasswordController extends BaseController
}
$rs['ret'] = 1;
$rs['msg'] = '重置成功';
$user->clean_link();
return $response->getBody()->write(json_encode($rs));
}
}

@ -2,16 +2,13 @@
namespace App\Controllers;
use app\Utils\YftOrderNumUtil;
class QuickPayFunction{
public function md5Verify($p1, $p2,$p3,$p4,$sign) {
$preStr = $p1.$p2.$p3.$p4;
$preStr = $p1 . $p2 . $p3 . $p4 . "yft";
$mySign = md5($preStr);
// echo $mySign;
if($mySign == $sign) {
if ($mySign == $sign) {
return true;
}else {
} else {
return false;
}
}

File diff suppressed because it is too large Load Diff

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

@ -18,28 +18,10 @@ class Auth
$newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login');
return $newResponse;
}
if ($user->enable == 0 && $_SERVER["REQUEST_URI"] != "/user/disable") {
$newResponse = $response->withStatus(302)->withHeader('Location', '/user/disable');
return $newResponse;
}
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;
}

@ -41,7 +41,7 @@ class Mod_Mu
$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;
}

@ -19,6 +19,5 @@ class Auto extends Model
public function content()
{
return str_replace(PHP_EOL, '<br>', $this->attributes['value']);
;
}
}

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

@ -65,9 +65,9 @@ class Node extends Model
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;
}
@ -113,22 +113,17 @@ class Node extends Model
public function isNodeOnline()
{
$node_heartbeat = $this->attributes['node_heartbeat'];
$result = false;
$id = $this->attributes['id'];
$sort = $this->attributes['sort'];
if (!($sort == 0 || $sort == 7 || $sort == 8 || $sort==10 || $sort==11)) {
return null;
}
if ($node_heartbeat == 0) {
return null;
}
if (time() - $node_heartbeat > 300) {
return false;
} else {
return true;
$node_heartbeat = $this->attributes['node_heartbeat'];
$log = NodeOnlineLog::where('node_id', $id)->where("log_time",">",time()-300)->orderBy('id', 'desc')->first();
if(!($sort == 0 || $sort == 7 || $sort == 8 || $sort==10 || $sort==11) || $node_heartbeat == 0){
$result = null;
}else if ($log != null && $log->log_time + 300 > time()) {
$result = true;
}
return $result;
}
public function isNodeTrafficOut()

@ -109,6 +109,27 @@ class Shop extends Model
}
}
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 (!strstr($innerContent,'-')) {
$innerContent = 'check-' . $innerContent;
}
$innerContent = explode('-',$innerContent);
array_push($content_extra_new,$innerContent);
}
$content_extra = $content_extra_new;
return $content_extra;
} else {
return 0;
}
}
public function user_class()
{
$content = json_decode($this->attributes['content']);
@ -185,11 +206,8 @@ class Shop extends Model
}
break;
case "class":
if ($user->class==0||$user->class!=$value) {
$user->class_expire=date("Y-m-d H:i:s", time());
}
$user->class_expire=date("Y-m-d H:i:s", strtotime($user->class_expire)+$content["class_expire"]*86400);
$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;

@ -13,7 +13,6 @@ 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;
@ -118,20 +117,19 @@ 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['passwd'])->toString();
}
public function addManyInviteCodes($num)
{
for ($i = 0; $i < $num; $i++) {
$this->addInviteCode();
}
return Uuid::uuid3(Uuid::NAMESPACE_DNS, $this->attributes['id']. '|' .$this->attributes['passwd'])->toString();
}
public function trafficUsagePercent()
@ -223,6 +221,12 @@ class User extends Model
$uid = $this->attributes['id'];
Link::where('userid', $uid)->delete();
}
public function clear_inviteCodes()
{
$uid = $this->attributes['id'];
InviteCode::where('user_id', $uid)->delete();
}
public function online_ip_count()
{
@ -267,8 +271,6 @@ class User extends Model
Token::where('user_id', '=', $uid)->delete();
PasswordReset::where('email', '=', $email)->delete();
Wecenter::Delete($email);
$this->delete();
return true;

@ -1,10 +0,0 @@
<?php
namespace App\Models;
class WecenterUser extends Model
{
protected $connection = "wecenter";
protected $table = "aws_users";
protected $primaryKey = 'uid';
}

@ -96,22 +96,24 @@ class Analytics
return Node::count();
}
public function getTotalSSNode()
public function getTotalNodes()
{
return Node::where('node_heartbeat', '>', 0)->where(
function ($query) {
$query->Where('sort', '=', 0)
->orWhere('sort', '=', 10);
->orWhere('sort', '=', 10)
->orWhere('sort', '=', 11);
}
)->count();
}
public function getAliveSSNode()
public function getAliveNodes()
{
return Node::where(
function ($query) {
$query->Where('sort', '=', 0)
->orWhere('sort', '=', 10);
->orWhere('sort', '=', 10)
->orWhere('sort', '=', 11);
}
)->where('node_heartbeat', '>', time()-90)->count();
}

@ -2,8 +2,6 @@
namespace App\Services;
use App\Utils\Wecenter;
class Auth
{
protected $driver;
@ -30,6 +28,5 @@ class Auth
public static function logout()
{
self::getDriver()->logout();
Wecenter::Loginout();
}
}

@ -2,18 +2,10 @@
namespace App\Services;
use Dotenv\Dotenv;
use Illuminate\Database\Capsule\Manager as Capsule;
class Boot
{
public static function loadEnv()
{
// Env
$env = new Dotenv(BASE_PATH);
$env->load();
}
public static function setDebug()
{
// debug
@ -41,10 +33,6 @@ class Boot
if (Config::get('enable_radius')=='true') {
$capsule->addConnection(Config::getRadiusDbConfig(), 'radius');
}
if (Config::get('enable_wecenter')=='true') {
$capsule->addConnection(Config::getWecenterDbConfig(), 'wecenter');
}
$capsule->bootEloquent();
}
}

@ -22,18 +22,33 @@ class Config
"appName" => self::get("appName"),
"version" => VERSION,
"baseUrl" => self::get("baseUrl"),
"min_port" => self::get("min_port"),
"max_port" => self::get("max_port"),
"checkinMin" => self::get("checkinMin"),
"code_payback" => self::get("code_payback"),
"checkinMax" => self::get("checkinMax"),
"wecenter_url" => self::get("wecenter_url"),
"enable_wecenter" => self::get("enable_wecenter"),
"invite_price"=>self::get("invite_price"),
"invite_get_money"=>self::get("invite_get_money"),
"code_payback" => self::get("code_payback"),
"invite_gift"=>self::get("invite_gift"),
"port_price" => self::get("port_price"),
"port_price_specify" => self::get("port_price_specify"),
"jump_delay" => self::get("jump_delay"),
"enable_analytics_code" => self::get("enable_analytics_code"),
"enable_donate" => self::get("enable_donate"),
"enable_telegram" => self::get("enable_telegram"),
"payment_system" => self::get("payment_system"),
"enable_crisp" => self::get("enable_crisp"),
"crisp_id" => self::get("crisp_id")
"crisp_id" => self::get("crisp_id"),
"enable_ticket"=> self::get("enable_ticket"),
"enable_admin_contact" => self::get("enable_admin_contact"),
"admin_contact1" => self::get("admin_contact1"),
"admin_contact2" => self::get("admin_contact2"),
"admin_contact3" => self::get("admin_contact3"),
"register_mode" => self::get("register_mode"),
"enable_flag" => self::get("enable_flag"),
"enable_kill" => self::get("enable_kill"),
"custom_invite_price" => self::get("custom_invite_price"),
"telegram_grouplink" => self::get("telegram_grouplink")
];
}
@ -64,19 +79,6 @@ class Config
];
}
public static function getWecenterDbConfig()
{
return [
'driver' => self::get('db_driver'),
'host' => self::get('wecenter_db_host'),
'database' => self::get('wecenter_db_database'),
'username' => self::get('wecenter_db_user'),
'password' => self::get('wecenter_db_password'),
'charset' => self::get('db_charset'),
'collation' => self::get('db_collation')
];
}
public static function getSupportParam($type)
{
switch ($type) {
@ -87,13 +89,13 @@ class Config
return $list;
case 'protocol':
$list = array('origin', 'verify_deflate',
'auth_sha1_v4', 'auth_sha1_v4_compatible', 'auth_aes128_sha1', 'auth_aes128_md5', 'auth_chain_a', 'auth_chain_b');
'auth_sha1_v4', 'auth_sha1_v4_compatible', 'auth_aes128_sha1', 'auth_aes128_md5', 'auth_chain_a', 'auth_chain_b','auth_chain_c','auth_chain_d','auth_chain_e','auth_chain_f');
return $list;
case 'allow_none_protocol':
$list = array('auth_chain_a', 'auth_chain_b');
$list = array('auth_chain_a', 'auth_chain_b','auth_chain_c','auth_chain_d','auth_chain_e','auth_chain_f');
return $list;
case 'relay_able_protocol':
$list = array('auth_aes128_md5', 'auth_aes128_sha1', 'auth_chain_a', 'auth_chain_b');
$list = array('auth_aes128_md5', 'auth_aes128_sha1', 'auth_chain_a', 'auth_chain_b','auth_chain_c','auth_chain_d','auth_chain_e','auth_chain_f');
return $list;
case 'ss_aead_method':
$list = array('aes-128-gcm', 'aes-192-gcm',
@ -106,7 +108,7 @@ class Config
$list = array('rc4-md5', 'rc4-md5-6', 'aes-128-cfb', 'aes-192-cfb', 'aes-256-cfb',
'aes-128-ctr', 'aes-192-ctr', 'aes-256-ctr', 'camellia-128-cfb', 'camellia-192-cfb', 'camellia-256-cfb',
'bf-cfb', 'cast5-cfb', 'des-cfb', 'des-ede3-cfb', 'idea-cfb',
'rc2-cfb', 'seed-cfb', 'salsa20', 'chacha20', 'chacha20-ietf', 'none', 'aes-128-gcm', 'aes-192-gcm',
'rc2-cfb', 'seed-cfb', 'salsa20', 'chacha20', 'xsalsa20', 'chacha20-ietf', 'aes-128-gcm', 'aes-192-gcm', 'none',
'aes-256-gcm', 'chacha20-ietf-poly1305', 'xchacha20-ietf-poly1305');
return $list;
}

@ -0,0 +1,88 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/24
* Time: 下午4:23
*/
namespace App\Services\Gateway;
use App\Models\Paylist;
use App\Models\Payback;
use App\Models\User;
use App\Models\Code;
use App\Services\Config;
use App\Utils\Telegram;
abstract class AbstractPayment
{
abstract public function purchase($request, $response, $args);
abstract public function notify($request, $response, $args);
abstract public function getPurchaseHTML();
abstract public function getReturnHTML($request, $response, $args);
abstract public function getStatus($request, $response, $args);
public function postPayment($pid, $method){
$p = Paylist::where("tradeno", $pid)->first();
if($p->status==1){
return json_encode(['errcode'=>0]);
}
$p->status=1;
$p->save();
$user = User::find($p->userid);
$user->money += $p->total;
$user->save();
$codeq=new Code();
$codeq->code=$method;
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$p->total;
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
if ($user->ref_by >= 1) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$codeq->number;
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send("一位不愿透露姓名的大老爷给我们捐了 ".$codeq->number." 元!");
} else {
Telegram::Send($user->user_name." 大老爷给我们捐了 ".$codeq->number." 元!");
}
}
return 0;
}
public static function generateGuid() {
mt_srand((double)microtime()*10000);
$charid = strtoupper(md5(uniqid(rand() + time(), true)));
$hyphen = chr(45);
$uuid = chr(123)
.substr($charid, 0, 8).$hyphen
.substr($charid, 8, 4).$hyphen
.substr($charid,12, 4).$hyphen
.substr($charid,16, 4).$hyphen
.substr($charid,20,12)
.chr(125);
$uuid = str_replace(['}', '{', '-'],'',$uuid);
$uuid = substr($uuid, 0, 8);
return $uuid;
}
}

@ -0,0 +1,108 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/24
* Time: 下午9:24
*/
namespace App\Services\Gateway;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Code;
use App\Models\Paylist;
use App\Services\View;
use Omnipay\Omnipay;
class AopF2F extends AbstractPayment
{
private function createGateway(){
$gateway = Omnipay::create('Alipay_AopF2F');
$gateway->setSignType('RSA2'); //RSA/RSA2
$gateway->setAppId(Config::get("f2fpay_app_id"));
$gateway->setPrivateKey(Config::get("merchant_private_key")); // 可以是路径,也可以是密钥内容
$gateway->setAlipayPublicKey(Config::get("alipay_public_key")); // 可以是路径,也可以是密钥内容
$gateway->setNotifyUrl(Config::get("baseUrl")."/payment/notify");
return $gateway;
}
function purchase($request, $response, $args)
{
$amount = $request->getParam('amount');
$user = Auth::getUser();
if ($amount == "") {
$res['ret'] = 0;
$res['msg'] = "订单金额错误:" . $amount;
return $response->getBody()->write(json_encode($res));
}
$pl = new Paylist();
$pl->userid = $user->id;
$pl->tradeno = self::generateGuid();
$pl->total = $amount;
$pl->save();
$gateway = self::createGateway();
$request = $gateway->purchase();
$request->setBizContent([
'subject' => "¥".$pl->total." - ".Config::get("appName")." - {$user->user_name}({$user->email})",
'out_trade_no' => $pl->tradeno,
'total_amount' => $pl->total
]);
/** @var \Omnipay\Alipay\Responses\AopTradePreCreateResponse $response */
$aliResponse = $request->send();
// 获取收款二维码内容
$qrCodeContent = $aliResponse->getQrCode();
$return['ret'] = 1;
$return['qrcode'] = $qrCodeContent;
$return['amount'] = $pl->total;
$return['pid'] = $pl->tradeno;
return json_encode($return);
}
function notify($request, $response, $args)
{
$gateway = self::createGateway();
$aliRequest = $gateway->completePurchase();
$aliRequest->setParams($_POST);
try {
/** @var \Omnipay\Alipay\Responses\AopCompletePurchaseResponse $response */
$aliResponse = $aliRequest->send();
$pid = $aliResponse->data('out_trade_no');
if($aliResponse->isPaid()){
self::postPayment($pid, "支付宝当面付");
die('success'); //The response should be 'success' only
}
} catch (\Exception $e) {
die('fail');
}
}
function getPurchaseHTML()
{
return View::getSmarty()->fetch("user/aopf2f.tpl");
}
function getReturnHTML($request, $response, $args)
{
return 0;
}
function getStatus($request, $response, $args)
{
$p = Paylist::where("tradeno", $_POST['pid'])->first();
$return['ret'] = 1;
$return['result'] = $p->status;
return json_encode($return);
}
}

@ -0,0 +1,275 @@
<?php
/**
* 支付宝微信检测监听 间隔为10秒
* cookie失效会通过email通知
* 请务必设置好邮箱配置
* User: chen yun.9in.info
* Date: 9/12/18
* Time: 12:33 PM
*/
namespace App\Services\Gateway;
use App\Models\Paylist;
use App\Services\Mail;
use App\Services\View;
use App\Services\Auth;
class ChenPay extends AbstractPayment
{
private $config = [];
private $listenInterval = 10; // 运行间隔
/**
* 初始化
*/
public function __construct()
{
$data = [];
foreach (\App\Models\Config::get() as $item) $data[$item->name] = $item->value;
$this->config = $data;
}
/**
* 获取config值
* @param bool $name
* @return array|mixed
*/
public function getConfig($name = false)
{
if ($name) return isset($this->config[$name]) ? $this->config[$name] : false;
else return $this->config;
}
/**
* 设置数据库中的config
* @param $name
* @param $value
* @return mixed
*/
public function setConfig($name, $value)
{
$newObj = \App\Models\Config::where('name', $name)->first();
if ($newObj) \App\Models\Config::where('name', $name)->update(['value' => $value]);
else {
$newObj = new \App\Models\Config;
$newObj->value = $value;
$newObj->name = $name;
$newObj->save();
}
$this->config[$name] = $value;
return $value;
}
/**
* 注入HTML
* @return mixed
*/
public function getPurchaseHTML()
{
return View::getSmarty()->assign("config", $this->config)
->assign('QRcodeUrl', $this->getConfig('AliPay_QRcode'))
->assign('WxQRcodeUrl', $this->getConfig('WxPay_QRcode'))
->fetch("user/chenPay.tpl");
}
/**
* 获取订单信息
* @param $request
* @param $response
* @param $args
* @return false|string
*/
public function getStatus($request, $response, $args)
{
$id = $request->getParam('id');
if (!$id) return json_encode(['ret' => 0, 'msg' => '请输入Id']);
$order = Paylist::find($id);
$order->ret = 1;
return json_encode($order);
}
/**
* 生成订单
* @param $request
* @param $response
* @param $args
* @return false|string
*/
public function purchase($request, $response, $args)
{
$type = $request->getParam('type');
$amount = $request->getParam('fee');
$url = $request->getParam('url');
if (!is_numeric($amount) || !is_numeric($type)) return json_encode(['ret' => 0, 'msg' => '请输入正确金额']);
elseif ($amount <= 0) return json_encode(['ret' => 0, 'msg' => '请输入正确金额']);
$user = Auth::getUser();
if (!Paylist::where('status', 0)->where('type', $type)->where('total', $amount)->where('datetime', '>', time())->first()) {
$newOrder = new Paylist();
$newOrder->userid = $user->id;
$newOrder->total = $amount;
$newOrder->datetime = time() + 3 * 60; // 有效时间
$newOrder->tradeno = rand(100000, 999999) . $user->id . $newOrder->datetime;
$newOrder->type = $type;
$newOrder->url = $url;
$newOrder->save();
$newOrder->ret = 1;
} else $newOrder = ['msg' => '正在排队中,请稍后再试!', 'ret' => 0];
return json_encode($newOrder);
}
/**
* 手动关闭排队机制 & 删除订单
* @param $request
* @return false|string
*/
public function orderDelete($request)
{
$id = $request->getParam('id');
if (!$id) return json_encode(['ret' => 0, 'msg' => '请输入Id']);
$user = Auth::getUser();
return json_encode(['ret' => Paylist::where("id", $id)->where('status', 0)->where('userid', $user->id)->delete()]);
}
/**
* 后台支付配置
* @return mixed
*/
public function editConfig()
{
return View::getSmarty()->assign('payConfig', $this->config)->display('admin/payEdit.tpl');
}
/**
* 后台保存配置
* @param $request
* @return false|string
*/
public function saveConfig($request)
{
$this->setConfig('Notice_EMail', $request->getParam('Notice_EMail'));
$this->setConfig('AliPay_QRcode', $request->getParam('AliPay_QRcode'));
$this->setConfig('AliPay_Cookie', $request->getParam('AliPay_Cookie'));
$this->setConfig('WxPay_QRcode', $request->getParam('WxPay_QRcode'));
$this->setConfig('WxPay_Cookie', $request->getParam('WxPay_Cookie'));
$this->setConfig('WxPay_Url', $request->getParam('WxPay_Url'));
$this->setConfig('WxPay_SyncKey', '');
$this->setConfig('Pay_Price', $request->getParam('Pay_Price'));
$this->setConfig('AliPay_Status', $request->getParam('AliPay_Status'));
$this->setConfig('WxPay_Status', $request->getParam('WxPay_Status'));
return json_encode(['ret' => 1, 'msg' => '编辑成功!']);
}
/**
* @param int $type
* @param int $isError
*/
public function mail($type = 1, $isError = 0)
{
$time = date('Y-m-d H:i:s');
$name = $type == 1 ? '支付宝' : '微信';
$this->setConfig($type == 1 ? 'AliPay_Status' : 'WxPay_Status', $isError ? 0 : 1);
Mail::getClient()->send($this->getConfig('Notice_EMail'), 'LOG报告监听' . $name . 'COOKIE' .
($isError ? "出现问题" : "成功运行"), "LOG提醒你,{$name}COOKIE" .
($isError ? "出现问题,请务必尽快更新COOKIE" : "成功运行") . "。<br>LOG记录时间:$time", []);
}
/**
* 发送错误email
* @param int $type
*/
public function sendMail($type = 1)
{
if (($this->getConfig('AliPay_Status') == 1 && $type == 1) || ($this->getConfig('WxPay_Status') == 1 && $type == 2))
$this->mail($type, 1);
}
/**
* 发生成功email
* @param int $type
*/
public function sendSunMail($type = 1)
{
if (($this->getConfig('AliPay_Status') == 0 && $type == 1) || ($this->getConfig('WxPay_Status') == 0 && $type == 2))
$this->mail($type);
}
/**
* 监听支付宝
*/
public function AliPayListen()
{
$that = new ChenPay();
if (!$that->getConfig('AliSum')) $that->setConfig('AliSum', 1);
if (!$that->getConfig('AliType')) $that->setConfig('AliType', 1);
if (!$that->getConfig('AliStatus')) $that->setConfig('AliStatus', time());
$log = "";
$tradeCount = Paylist::where('status', 0)->where('type', 1)->where('datetime', '>', time())->count();
if ($that->getConfig('AliStatus') > time() && $tradeCount == 0) {
$log .= "支付宝监听暂停中[" . date('Y-m-d H:i:s') . "]\n";
file_put_contents(__DIR__ . "/../../../storage/logs/chenpay.log", $log, FILE_APPEND);
return;
}
try {
$run = (new \ChenPay\AliPay($that->getConfig('AliPay_Cookie')))->getData($that->getConfig('AliType') == 1 ? true : false)->DataHandle();
$tradeAll = Paylist::where('status', 0)->where('type', 1)->where('datetime', '>', time())->orderBy('id', 'desc')->get();
foreach ($tradeAll as $item) {
$order = $run->DataContrast($item->total, $item->datetime);
if ($order) {
$log .= $order . "订单有效\n";
ChenPay::postPayment($item->tradeno, 'chenPay支付宝支付' . $order);
}
}
$log .= "支付宝监听第" . $that->getConfig('AliSum') . "次运行" . "[" . date('Y-m-d H:i:s') . "]\n";
$that->sendSunMail(1);
$that->setConfig('AliType', $that->getConfig('AliType') == 1 ? 2 : 1);
$that->setConfig('AliSum', $that->getConfig('AliSum') + 1);
$that->setConfig('AliStatus', time() + 2 * 60);
} catch (\ChenPay\PayException\PayException $e) {
if ($e->getCode() == 445) $that->sendMail(1);
$log .= "支付宝监听" . $e->getMessage() . "[" . date('Y-m-d H:i:s') . "]\n";
}
file_put_contents(__DIR__ . "/../../../storage/logs/chenpay.log", $log, FILE_APPEND);
}
/**
* 监听微信
*/
public function WxPayListen()
{
$that = new ChenPay();
if (!$that->getConfig('WxSum')) $that->setConfig('WxSum', 1);
if (!$that->getConfig('syncKey')) $that->setConfig('syncKey', '');
$log = "";
try {
$run = (new \ChenPay\WxPay($that->getConfig('WxPay_Cookie')))->getData($that->getConfig('WxPay_Url'), $that->getConfig('syncKey'))->DataHandle();
$that->setConfig('syncKey', $run->syncKey);
$tradeAll = Paylist::where('status', 0)->where('type', 2)->where('datetime', '>', time())->orderBy('id', 'desc')->get();
foreach ($tradeAll as $item) {
$order = $run->DataContrast($item->total, $item->datetime);
if ($order) {
$log .= $order . "订单有效\n";
ChenPay::postPayment($item->tradeno, 'chenPay微信支付' . $order);
}
}
$log .= "微信监听第" . $that->getConfig('WxSum') . "次运行" . "[" . date('Y-m-d H:i:s') . "]\n";
$that->sendSunMail(2);
$that->setConfig('WxSum', $that->getConfig('WxSum') + 1);
} catch (\ChenPay\PayException\PayException $e) {
if ($e->getCode() == 445) $that->sendMail(2);
$log .= "微信监听" . $e->getMessage() . "[" . date('Y-m-d H:i:s') . "]\n";
}
file_put_contents(__DIR__ . "/../../../storage/logs/chenpay.log", $log, FILE_APPEND);
}
public function getReturnHTML($request, $response, $args)
{
}
public function notify($request, $response, $args)
{
}
}

@ -0,0 +1,141 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/27
* Time: 8:16 AM
*/
namespace App\Services\Gateway;
use App\Services\Auth;
use App\Services\Config;
use App\Models\User;
use App\Models\Code;
use App\Models\Paylist;
class Codepay extends AbstractPayment
{
function isHTTPS()
{
define('HTTPS', false);
if (defined('HTTPS') && HTTPS) return true;
if (!isset($_SERVER)) return FALSE;
if (!isset($_SERVER['HTTPS'])) return FALSE;
if ($_SERVER['HTTPS'] === 1) { //Apache
return TRUE;
} elseif ($_SERVER['HTTPS'] === 'on') { //IIS
return TRUE;
} elseif ($_SERVER['SERVER_PORT'] == 443) { //其他
return TRUE;
}
return FALSE;
}
public function purchase($request, $response, $args)
{
$codepay_id = Config::get('codepay_id');//这里改成码支付ID
$codepay_key = Config::get('codepay_key'); //这是您的通讯密钥
$user = Auth::getUser();
$price = $request->getParam('price');
$type = $request->getParam('type');
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = (string)time()."UID".(string)$user->id;
$pl->save();
$url = (self::isHTTPS() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
$data = array(
"id" => $codepay_id,//你的码支付ID
"pay_id" => $pl->tradeno, //唯一标识 可以是用户ID,用户名,session_id(),订单ID,ip 付款后返回
"type" => $type,//1支付宝支付 2QQ钱包 3微信支付
"price" => $price,//金额100元
"param" => "",//自定义参数
"notify_url" => $url . '/payment/notify',//通知地址
"return_url" => $url . '/user/code',//跳转地址
); //构造需要传递的参数
ksort($data); //重新排序$data数组
reset($data); //内部指针指向数组中的第一个元素
$sign = ''; //初始化需要签名的字符为空
$urls = ''; //初始化URL参数为空
foreach ($data AS $key => $val) { //遍历需要传递的参数
if ($val == '' || $key == 'sign') continue; //跳过这些不参数签名
if ($sign != '') { //后面追加&拼接URL
$sign .= "&";
$urls .= "&";
}
$sign .= "$key=$val"; //拼接为url参数形式
$urls .= "$key=" . urlencode($val); //拼接为url参数形式并URL编码参数值
}
$query = $urls . '&sign=' . md5($sign . $codepay_key); //创建订单所需的参数
$url = "https://codepay.fateqq.com:51888/creat_order/?" . $query; //支付页面
header("Location:" . $url);
}
public function notify($request, $response, $args)
{
//以下五行无需更改
ksort($_POST); //排序post参数
reset($_POST); //内部指针指向数组中的第一个元素
$codepay_key=Config::get('codepay_key'); //这是您的密钥
$sign = '';//初始化
foreach ($_POST AS $key => $val) { //遍历POST参数
if ($val == '' || $key == 'sign') continue; //跳过这些不签名
if ($sign) $sign .= '&'; //第一个字符串签名不加& 其他加&连接起来参数
$sign .= "$key=$val"; //拼接为url参数形式
}
if (!$_POST['pay_no'] || md5($sign . $codepay_key) != $_POST['sign']) { //不合法的数据
exit('fail'); //返回失败,等待下次回调
} else { //合法的数据
//业务处理
$pay_id = $_POST['pay_id']; //需要充值的ID 或订单号 或用户名
$money = (float)$_POST['money']; //实际付款金额
$price = (float)$_POST['price']; //订单的原价
//$param = $_POST['param']; //自定义参数
$pay_no = $_POST['pay_no']; //流水号
self::postPayment($pay_id, "码支付");
}
exit('success'); //返回成功 不要删除哦
return;
}
public function getPurchaseHTML()
{
return '
<div class="card-inner">
<p class="card-heading">请输入充值金额</p>
<form class="codepay" name="codepay" action="/user/code/codepay" method="get">
<input class="form-control maxwidth-edit" id="price" name="price" placeholder="输入充值金额后,点击你要付款的应用图标即可" autofocus="autofocus" type="number" min="0.01" max="1000" step="0.01" required="required">
<br>
<button class="btn btn-flat waves-attach" id="btnSubmit" type="submit" name="type" value="1" ><img src="/images/alipay.jpg" width="50px" height="50px" /></button>
<button class="btn btn-flat waves-attach" id="btnSubmit" type="submit" name="type" value="2" ><img src="/images/qqpay.jpg" width="50px" height="50px" /></button>
<button class="btn btn-flat waves-attach" id="btnSubmit" type="submit" name="type" value="3" ><img src="/images/weixin.jpg" width="50px" height="50px" /></button>
</form>
</div>
';
}
public function getReturnHTML($request, $response, $args)
{
// TODO: Implement getReturnHTML() method.
}
public function getStatus($request, $response, $args)
{
// TODO: Implement getStatus() method.
}
}

@ -0,0 +1,155 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Author:
* Date: 2018/9/24
* Time: 下午4:01
*/
/**
* Made By Leo
* 黛米付接口
* 2.1.4版本
* 适用于 V1 API 黛米付面板V1
* copyright all rights reserved
*/
namespace App\Services\Gateway;
use App\Services\View;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Paylist;
class DoiAMPay extends AbstractPayment
{
public function getPurchaseHTML()
{
return View::getSmarty()->assign("enabled",Config::get("doiampay")['enabled'])->fetch("user/doiam.tpl");
}
public function notify($request, $response, $args)
{
$order_data = $_POST;
$status = $order_data['status']; //获取传递过来的交易状态
$invoiceid = $order_data['out_trade_no']; //订单号
$transid = $order_data['trade_no']; //转账交易号
$amount = $order_data['money']; //获取递过来的总价格
if(!DoiAM::checksign($_POST,Config::get("doiampay")['mchdata'][$args['type']]['token'])){
return (json_encode(array('errcode'=>2333)));
}
if ($status == 'success') {
self::postPayment($invoiceid, "黛米付".['wepay' => "(微信)" , 'qqpay' => '(QQ支付)','alipay' => "(支付宝)"][$args['type']]);
return json_encode(['errcode'=>0]);
} else {
return 1;
}
}
public function purchase($request, $response, $args)
{
$type = $request->getParam('type');
$price = $request->getParam('price');
if(Config::get("doiampay")['enabled'][$type]==0){
return json_encode(['errcode'=>-1,'errmsg'=>"非法的支付方式."]);
}
if($price <= 0){
return json_encode(['errcode'=>-1,'errmsg'=>"非法的金额."]);
}
$user = Auth::getUser();
$settings = Config::get("doiampay")['mchdata'][$type];
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
$pl->save();
$data = [
'trade' => $pl->tradeno,
'price' => $price,
'phone' => $settings['phone'],
'mchid' => $settings['mchid'],
'subject' => Config::get("appName")."充值".$price."元",
'body' => Config::get("appName")."充值".$price."元",
'type' => 'Mod',
];
$data = DoiAM::sign($data,$settings['token']);
$ret = DoiAM::post("https://api.daimiyun.cn/v2/".$type."/create",$data);
$result = json_decode($ret,true);
if($result and $result['errcode']==0){
$result['pid']=$pl->tradeno;
return json_encode($result);
} else {
return json_encode([
'errcode' => -1,
'errmsg' => "接口调用失败!".$ret,
]);
}
return json_encode($result);
}
public function getReturnHTML($request, $response, $args)
{
$money = $_GET['money'];
echo "您已经成功支付 $money 元,正在跳转..";
echo <<<HTML
<script>
location.href="/user/code";
</script>
HTML;
return;
}
public function getStatus($request, $response, $args)
{
$p = Paylist::where("tradeno", $_POST['pid'])->first();
$return['ret'] = 1;
$return['result'] = $p->status;
return json_encode($return);
}
}
class DoiAM{
public static function sort(&$array){
ksort($array);
}
public static function getsign($array,$key){
unset($array['sign']);
self::sort($array);
$sss=http_build_query($array);
$sign=hash("sha256",$sss.$key);
$sign=sha1($sign.hash("sha256",$key));
return $sign;
}
public static function sign($array,$key){
$array['sign']=self::getSign($array,$key);
return $array;
}
public static function checksign($array,$key){
$new = $array;
$new=self::sign($new,$key);
if(!isset($array['sign'])){
return false;
}
return $array['sign']==$new['sign'];
}
public static function post($url, $data = null){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
if (!empty($data)){
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl);
curl_close($curl);
return $output;
}
}

@ -0,0 +1,118 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/27
* Time: 7:20 PM
*/
namespace App\Services\Gateway;
use App\Models\User;
use App\Models\Code;
use App\Services\Auth;
use App\Models\Paylist;
use App\Models\Payback;
use App\Services\Config;
use App\Services\Payment;
class PaymentWall extends AbstractPayment
{
public function purchase($request, $response, $args)
{
// TODO: Implement purchase() method.
}
public function notify($request, $response, $args)
{
if (Config::get('pmw_publickey')!="") {
\Paymentwall_Config::getInstance()->set(array(
'api_type' => \Paymentwall_Config::API_VC,
'public_key' => Config::get('pmw_publickey'),
'private_key' => Config::get('pmw_privatekey')
));
$pingback = new \Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
if ($pingback->validate()) {
$virtualCurrency = $pingback->getVirtualCurrencyAmount();
if ($pingback->isDeliverable()) {
// deliver the virtual currency
} elseif ($pingback->isCancelable()) {
// withdraw the virual currency
}
$user=User::find($pingback->getUserId());
$user->money=$user->money+$pingback->getVirtualCurrencyAmount();
$user->save();
$codeq=new Code();
$codeq->code="Payment Wall 充值";
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$pingback->getVirtualCurrencyAmount();
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$pingback->getVirtualCurrencyAmount();
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
echo 'OK'; // Paymentwall expects response to be OK, otherwise the pingback will be resent
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send("姐姐姐姐,一位不愿透露姓名的大老爷给我们捐了 ".$codeq->number." 元呢~");
} else {
Telegram::Send("姐姐姐姐,".$user->user_name." 大老爷给我们捐了 ".$codeq->number." 元呢~");
}
}
} else {
echo $pingback->getErrorSummary();
}
} else {
echo 'error';
}
}
public function getPurchaseHTML()
{
\Paymentwall_Config::getInstance()->set(array(
'api_type' => \Paymentwall_Config::API_VC,
'public_key' => Config::get('pmw_publickey'),
'private_key' => Config::get('pmw_privatekey')
));
$user = Auth::getUser();
$widget = new \Paymentwall_Widget(
$user->id, // id of the end-user who's making the payment
Config::get('pmw_widget'), // widget code, e.g. p1; can be picked inside of your merchant account
array(), // array of products - leave blank for Virtual Currency API
array(
'email' => $user->email,
'history'=>
array(
'registration_date'=>strtotime($user->reg_date),
'registration_ip'=>$user->reg_ip,
'payments_number'=>Code::where('userid', '=', $user->id)->where('type', '=', -1)->count(),
'membership'=>$user->class),
'customer'=>array(
'username'=>$user->user_name
)
) // additional parameters
);
return $widget->getHtmlCode(array("height"=>Config::get('pmw_height'),"width"=>"100%"));
}
public function getReturnHTML($request, $response, $args)
{
// TODO: Implement getReturnHTML() method.
}
public function getStatus($request, $response, $args)
{
// TODO: Implement getStatus() method.
}
}

@ -0,0 +1,153 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/30
* Time: 8:14 PM
*/
namespace App\Services\Gateway;
use App\Services\View;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Paylist;
class SPay extends AbstractPayment
{
public function purchase($request, $response, $args)
{
/**************************请求参数**************************/
$amount = $request->getParam()["price"];
$user = Auth::getUser();
$alipay_config = Spay_tool::getConfig();
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $amount;
$pl->tradeno = self::generateGuid();
$pl->save();
//商户订单号,商户网站订单系统中唯一订单号,必填
$out_trade_no = $pl->tradeno;
//订单名称,必填
$subject = $pl->id."UID:".$user->id." 充值".$amount."元";
//付款金额,必填
$total_fee = (float)$amount;
//商品描述,可空
$body = $user->id;
/************************************************************/
//构造要请求的参数数组,无需改动
$parameter = array(
"service" => "create_direct_pay_by_user",
"partner" => trim($alipay_config['partner']),
"notify_url" => $alipay_config['notify_url'],
"return_url" => $alipay_config['return_url'],
"out_trade_no" => $out_trade_no,
"total_fee" => $total_fee
);
//建立请求
$alipaySubmit = new Spay_submit($alipay_config);
$reqUrl = $alipaySubmit->buildRequestForm($parameter);
return json_encode(['code'=>0, 'url'=>$reqUrl]);
}
public function notify($request, $response, $args)
{
//计算得出通知验证结果
$alipayNotify = new Spay_notify(Spay_tool::getConfig());
$verify_result = $alipayNotify->verifyNotify();
if ($verify_result) {//验证成功
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//请在这里加上商户的业务逻辑程序代
//——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
//获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表
//商户订单号
$out_trade_no = $_POST['out_trade_no'];
//支付宝交易号
$trade_no = $_POST['trade_no'];
//交易状态
$trade_status = $_POST['trade_status'];
if ($_POST['trade_status'] == 'TRADE_FINISHED' or $_POST['trade_status'] == 'TRADE_SUCCESS') {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的
//如果有做过处理,不执行商户的业务程序
//注意:
//退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
$this->postPayment($out_trade_no, "SPay 支付");
}
//——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
echo "success"; //请不要修改或删除
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
//验证失败
echo "fail";
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
}
}
public function getPurchaseHTML()
{
return '
<div class="card-inner">
<div class="form-group pull-left">
<p class="modal-title" >本站支持支付宝在线充值</p>
<p>输入充值金额:</p>
<div class="form-group form-group-label">
<label class="floating-label" for="price">充值金额</label>
<input id="type" class="form-control maxwidth-edit" name="amount" />
</div>
<a class="btn btn-flat waves-attach" id="submitSpay" ><span class="icon">check</span>&nbsp;充值</a>
</div>
</div>
<script>
window.onload = function(){
$("#submitSpay").click(function() {
var price = parseFloat($("#amount").val());
console.log("将要使用 SPay 方法充值" + price + "元");
if (isNaN(price)) {
$("#result").modal();
$("#msg").html("非法的金额!");
}
$(\'#readytopay\').modal();
$("#readytopay").on(\'shown.bs.modal\', function () {
$.ajax({
\'url\': "/user/payment/purchase",
\'data\': {
\'price\': price,
},
\'dataType\': \'json\',
\'type\': "POST",
success: function (data) {
if (data.code == 0) {
$("#result").modal();
$("#msg").html("正在跳转到支付宝...");
console.log(data);
window.location.href = data.url;
} else {
$("#result").modal();
$("#msg").html(data.msg);
console.log(data);
}
}
});
});
});
};</script>
';
}
public function getReturnHTML($request, $response, $args)
{
// TODO: Implement getReturnHTML() method.
}
public function getStatus($request, $response, $args)
{
// TODO: Implement getStatus() method.
}
}

@ -1,6 +1,6 @@
<?php
namespace App\Utils;
namespace App\Services\Gateway;
class Spay_notify
{
@ -11,7 +11,7 @@ class Spay_notify
}
public static function Spay_notify($alipay_config)
{
$this->__construct($alipay_config);
self::__construct($alipay_config);
}
/**
* 针对notify_url验证消息是否是支付宝发出的合法消息

@ -1,6 +1,6 @@
<?php
namespace App\Utils;
namespace App\Services\Gateway;
class Spay_submit
{
@ -12,7 +12,7 @@ class Spay_submit
}
public static function Spay_submit($alipay_config)
{
$this->__construct($alipay_config);
self::__construct($alipay_config);
}
/**
@ -76,13 +76,11 @@ class Spay_submit
public function buildRequestForm($para_temp)
{
$para = $this->buildRequestPara($para_temp);
$sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->alipay_gateway_new."_input_charset=UTF-8' method='get'>";
$reqUrl = $this->alipay_gateway_new;
while (list($key, $val) = each($para)) {
$sHtml.= "<input type='hidden' name='".$key."' value='".$val."'/>";
$reqUrl .= "&" . $key . "=" . $val;
}
//submit按钮控件请不要含有name属性
$sHtml = $sHtml."<input type='submit' value='正在跳转支付中'></form>";
$sHtml = $sHtml."<script>document.forms['alipaysubmit'].submit();</script>";
return $sHtml;
return $reqUrl;
}
}

@ -1,6 +1,6 @@
<?php
namespace App\Utils;
namespace App\Services\Gateway;
use App\Services\Config;
@ -210,7 +210,7 @@ class Spay_tool
$alipay_config['key'] = Config::get('alipay_key');
// 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
$alipay_config['notify_url'] = Config::get('baseUrl')."/alipay_callback";
$alipay_config['notify_url'] = Config::get('baseUrl')."/purchase/notify";
// 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问

@ -0,0 +1,183 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/28
* Time: 9:08 PM
*/
namespace App\Services\Gateway;
use App\Services\View;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Paylist;
class TrimePay extends AbstractPayment
{
private $appSecret;
private $gatewayUri;
/**
* 签名初始化
* @param merKey 签名密钥
*/
public function __construct($appSecret) {
$this->appSecret = $appSecret;
$this->gatewayUri = 'https://api.Trimepay.com/gateway/';
}
/**
* @name 准备签名/验签字符串
*/
public function prepareSign($data) {
ksort($data);
return http_build_query($data);
}
/**
* @name 生成签名
* @param sourceData
* @return 签名数据
*/
public function sign($data) {
$signature = strtolower(md5(md5($data).$this->appSecret));
return $signature;
}
/*
* @name 验证签名
* @param signData 签名数据
* @param sourceData 原数据
* @return
*/
public function verify($data, $signature) {
$mySign = $this->sign($data);
if ($mySign === $signature) {
return true;
} else {
return false;
}
}
public function post($data, $type = "pay"){
if ($type == "pay"){
$this->gatewayUri .= "pay/go";
} else {
$this->gatewayUri .= "refund/go";
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->gatewayUri);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$data = curl_exec($curl);
curl_close($curl);
return $data;
}
public function purchase($request, $response, $args)
{
$price = $request->getParam('price');
$type = $request->getParam('type');
if($price <= 0){
return json_encode(['code'=>-1,'errmsg'=>"非法的金额."]);
}
$user = Auth::getUser();
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
$pl->save();
$data['appId'] = Config::get('trimepay_appid');
$data['payType'] = $type;
$data['merchantTradeNo'] = $pl->tradeno;
$data['totalFee'] = (float)$price * 100;
$data['notifyUrl'] = Config::get("baseUrl")."/payment/notify";
$data['returnUrl'] = Config::get("baseUrl")."/user/payment/return";
$params = self::prepareSign($data);
$data['sign'] = self::sign($params);
switch ($type) {
case('WEPAY_JSAPI'):
$result['code'] = 0;
$result['data'] = "http://cashier.hlxpay.com/#/wepay/jsapi?payData=".base64_encode(json_encode($data));
$result['pid'] = $pl->tradeno;
return json_encode($result);
default:
$result = json_decode(self::post($data), TRUE);
$result['pid'] = $pl->tradeno;
return json_encode($result);
}
}
public function notify($request, $response, $args)
{
$data = array();
$data['payStatus']=$request->getParam('payStatus');
$data['payFee']=$request->getParam('payFee');
$data['callbackTradeNo']=$request->getParam('callbackTradeNo');
$data['payType']=$request->getParam('payType');
$data['merchantTradeNo']=$request->getParam('merchantTradeNo');
//file_put_contents(BASE_PATH.'/storage/trimepay_notify.log', json_encode($data)."\r\n", FILE_APPEND);
// 准备待签名数据
$str_to_sign = self::prepareSign($data);
// 验证签名
$resultVerify = self::verify($str_to_sign, $request->getParam('sign'));
if ($resultVerify) {
//file_put_contents('./trimepay_notify_success.log', json_encode($data)."\r\n", FILE_APPEND);
self::postPayment($data['merchantTradeNo'], "TrimePay");
echo 'SUCCESS';
}else{
echo 'FAIL';
}
}
public function refund($merchantTradeNo){
$data['appId'] = Config::get('trimepay_appid');
$data['merchantTradeNo'] = $merchantTradeNo;
$params = self::prepareSign($data);
$data['sign'] = self::sign($params);
return self::post($data, "refund");
}
public function getPurchaseHTML()
{
return View::getSmarty()->fetch("user/trimepay.tpl");
}
public function getReturnHTML($request, $response, $args)
{
$pid = $_GET['merchantTradeNo'];
$p = Paylist::where('tradeno','=',$pid)->first();
$money = $p->total;
if ($p->status == 1){
$success = 1;
} else {
$success = 0;
}
return View::getSmarty()->assign('money', $money)->assign('success', $success)->fetch('user/pay_success.tpl');
}
public function getStatus($request, $response, $args)
{
$p = Paylist::where("tradeno", $_POST['pid'])->first();
$return['ret'] = 1;
$return['result'] = $p->status;
return json_encode($return);
}
}

@ -0,0 +1,281 @@
<?php
/**
* Created by 傲慢与偏见.
* OSUser: D-L
* Date: 2017/10/12
* Time: 21:08
*/
namespace App\Services\Gateway;
use App\Models\Payback;
use App\Models\User;
use App\Models\YftOrder;
use App\Services\Auth;
use App\Services\View;
use App\Utils\Telegram;
use App\Services\Config;
use App\Controllers\QuickPayFunction;
class YftPay extends AbstractPayment
{
private $user;
public function __construct()
{
$this->user = Auth::getUser();
}
public function yft($request, $response, $args)
{
$price = $request->getParams()['price'];
return View::getSmarty()->assign('price', $price)->display('user/yft.tpl');
}
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 View::getSmarty()->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 View::getSmarty()->assign('orderList', $orderList)->assign('countPage', $countPage)->assign('currentPage', $pageNum)->display('admin/yftOrder.tpl');
}
public function purchase($request, $response, $args)
{
return $this->constructPayPara($request);
}
public function yftPay($request, $response, $args)
{
return $this->constructPayPara($request);
}
public function notify($request, $response, $args)
{
$newResponse = $response->withStatus(302)->withHeader('Location', '/user/code');
$yftLib = new QuickPayFunction();
$pay_config = new YftPayConfig();
$pay_config->init();
//价格
$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 = $yftLib->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";
}
}
public function getPurchaseHTML()
{
return '
<div class="card-main">
<div class="card-inner">
<form action="/user/code/yft" method="post" target="_blank">
<p class="card-heading">在线充值</p>
<div class="form-group form-group-label">
<label class="floating-label" for="price">充值金额</label>
<input class="form-control" id="price" name="price" type="text">
</div>
<div class="card-action">
<div class="card-action-btn pull-left">
<button type="submit" class="btn btn-flat waves-attach" id="yftCoin" ><span class="icon">check</span>&nbsp;充值</button>
</div>
</div>
</form>
</div>
</div>
';
}
public function getReturnHTML($request, $response, $args)
{
// TODO: Implement getReturnHTML() method.
}
public function getStatus($request, $response, $args)
{
// TODO: Implement getStatus() method.
}
/**
* @param $request
* @return string
*/
private function constructPayPara($request)
{
$yftLib = new QuickPayFunction();
$pay_config = new YftPayConfig();
$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');
//生成订单号
// 密码字符集,可任意添加你需要的字符
$date = time();
$date = "yft".date("YmdHis",$date);
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$password = "";
for ($i = 0; $i < 8; $i++) {
// 这里提供两种字符获取方式
// 第一种是使用 substr 截取$chars中的任意一位字符;
// 第二种是取字符数组 $chars 的任意元素
$password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
}
$ss_order_no = $date.$password;
/************************************************************/
//构造要请求的参数数组,无需改动
$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;
}
}

@ -1,8 +1,8 @@
<?php
namespace App\Controllers;
namespace App\Services\Gateway;
class PayConfig{
class YftPayConfig{
public $pay_config;

@ -15,7 +15,7 @@ class Mailgun extends Base
public function __construct()
{
$this->config = $this->getConfig();
$this->mg = new MailgunService($this->config["key"]);
$this->mg = MailgunService::create($this->config["key"]);
$this->domain = $this->config["domain"];
$this->sender = $this->config["sender"];
}
@ -31,14 +31,12 @@ class Mailgun extends Base
public function send($to, $subject, $text, $file)
{
$this->mg->sendMessage($this->domain,
[
$this->mg->messages()->send($this->domain,[
'from' => $this->sender,
'to' => $to,
'subject' => $subject,
'html' => $text
],
[
],[
'inline' => $file
]
);

@ -34,7 +34,7 @@ class Password
], [
//BASE_PATH.'/public/assets/email/styles.css'
]);
} catch (Exception $e) {
} catch (\Exception $e) {
return false;
}
return true;

@ -0,0 +1,65 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/24
* Time: 下午7:07
*/
namespace App\Services;
use App\Services\Config;
use App\Services\Gateway\{
AopF2F, Codepay, DoiAMPay, PaymentWall, ChenPay, SPay, TrimePay, YftPay
};
class Payment
{
public static function getClient(){
$method = Config::get("payment_system");
switch($method){
case("codepay"):
return new Codepay();
case("doiampay"):
return new DoiAMPay();
case("paymentwall"):
return new PaymentWall();
case("spay"):
return new SPay();
case("f2fpay"):
return new AopF2F();
case("yftpay"):
return new YftPay();
case("chenAlipay"):
return new ChenPay();
case("trimepay"):
return new TrimePay(Config::get('trimepay_secret'));
default:
return NULL;
}
}
public static function notify($request, $response, $args){
return self::getClient()->notify($request, $response, $args);
}
public static function returnHTML($request, $response, $args){
return self::getClient()->getReturnHTML($request, $response, $args);
}
public static function purchaseHTML(){
if (self::getClient() != NULL) {
return self::getClient()->getPurchaseHTML();
} else {
return '';
}
}
public static function getStatus($request, $response, $args){
return self::getClient()->getStatus($request, $response, $args);
}
public static function purchase($request, $response, $args){
return self::getClient()->purchase($request, $response, $args);
}
}

@ -3,6 +3,7 @@
namespace App\Services;
use Smarty;
use App\Utils;
class View
{
@ -18,13 +19,17 @@ class View
$theme=Config::get('theme');
}
$can_backtoadmin = 0;
if (Utils\Cookie::get('old_uid') && Utils\Cookie::get('old_email') && Utils\Cookie::get('old_key') && Utils\Cookie::get('old_ip') && Utils\Cookie::get('old_expire_in') && Utils\Cookie::get('old_local')) {
$can_backtoadmin = 1;
}
$smarty->settemplatedir(BASE_PATH.'/resources/views/'.$theme.'/'); //设置模板文件存放目录
$smarty->setcompiledir(BASE_PATH.'/storage/framework/smarty/compile/'); //设置生成文件存放目录
$smarty->setcachedir(BASE_PATH.'/storage/framework/smarty/cache/'); //设置缓存文件存放目录
// add config
$smarty->assign('config', Config::getPublicConfig());
$smarty->assign('user', Auth::getUser());
$smarty->assign('can_backtoadmin', $can_backtoadmin);
return $smarty;
}
}

@ -8,7 +8,7 @@ class Check
//
public static function isEmailLegal($email)
{
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
if (filter_var($email, FILTER_VALIDATE_EMAIL)&&strlen($email)<=32) {
return true;
} else {
return false;

@ -0,0 +1,56 @@
<?php
/**
* Created by PhpStorm.
* User: tonyzou
* Date: 2018/9/10
* Time: 上午9:54
*/
namespace App\Utils;
use App\Services\Config;
class CloudflareDriver
{
// @todo: parameters
public static function modifyRecord(\Cloudflare\API\Endpoints\DNS $dns, $zoneID, $recordID, $name, $content, $proxied = false)
{
$details = ['type' => 'A', 'name' => $name, 'content' => $content, 'proxied' => $proxied];
if ($dns->updateRecordDetails($zoneID, $recordID, $details)->success == true) {
return 1;
}
return 0;
}
public static function addRecord(\Cloudflare\API\Endpoints\DNS $dns, $zoneID, $type, $name, $content, $ttl = 120, $proxied = false)
{
if ($dns->addRecord($zoneID, $type, $name, $content, $ttl, $proxied) == true) {
return 1;
}
return 0;
}
public static function updateRecord($name, $content, $proxied = false)
{
$key = new \Cloudflare\API\Auth\APIKey(Config::get('cloudflare_email'), Config::get('cloudflare_key'));
$adapter = new \Cloudflare\API\Adapter\Guzzle($key);
$zones = new \Cloudflare\API\Endpoints\Zones($adapter);
$zoneID = $zones->getZoneID(Config::get('cloudflare_name'));
$dns = new \Cloudflare\API\Endpoints\DNS($adapter);
$r = $dns->listRecords($zoneID, '', $name);
$recordCount = $r->result_info->count;
$records = $r->result;
if ($recordCount == 0){
self::addRecord($dns, $zoneID, 'A', $name, $content);
} elseif ($recordCount >= 1){
foreach ($records as $record){
$recordID = $record->id;
self::modifyRecord($dns, $zoneID, $recordID, $name, $content, $proxied);
}
}
}
}

@ -0,0 +1,24 @@
<?php
/**
* Created by PhpStorm.
* User: Indexyz
* Date: 11/9/2018
* Time: 9:15 PM
*/
namespace App\Utils;
use Smarty;
class ConfRender {
public static function getTemplateRender() {
$smarty = new smarty();
$smarty->settemplatedir(BASE_PATH . '/resources/conf/');
$smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/');
$smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/');
$smarty->registerClass("config", "App\Services\Config");
return $smarty;
}
}

@ -10,59 +10,19 @@ namespace App\Utils;
use App\Services\View;
use App\Services\Auth;
use App\Models\Node;
use App\Models\TrafficLog;
use App\Models\InviteCode;
use App\Models\CheckInLog;
use App\Models\Ann;
use App\Models\Speedtest;
use App\Models\Shop;
use App\Models\Coupon;
use App\Models\Bought;
use App\Models\Ticket;
use App\Services\Config;
use App\Utils\Hash;
use App\Utils\Tools;
use App\Utils\Radius;
use App\Utils\Wecenter;
use App\Models\RadiusBan;
use App\Models\DetectLog;
use App\Models\DetectRule;
use voku\helper\AntiXSS;
use App\Models\User;
use App\Models\Code;
use App\Models\Ip;
use App\Models\Paylist;
use App\Models\LoginIp;
use App\Models\BlockIp;
use App\Models\UnblockIp;
use App\Models\Payback;
use App\Models\Relay;
use App\Utils\QQWry;
use App\Utils\GA;
use App\Utils\Geetest;
use App\Utils\Telegram;
use App\Utils\TelegramSessionManager;
use App\Utils\Pay;
use App\Utils\URL;
use App\Services\Mail;
class DoiAMPay{
public function smarty()
{
$this->smarty = View::getSmarty();
return $this->smarty;
}
public function view()
{
return $this->smarty();
}
public static function render(){
return View::getSmarty()->assign("enabled",Config::get("doiampay")['enabled'])->fetch("user/doiam.tpl");
}
public function handle($request, $response, $args){
$type = $request->getParam('type');
$price = $request->getParam('price');

@ -1,42 +0,0 @@
<?php
namespace App\Utils;
use App\Models\User;
use App\Services\Config;
class Duoshuo
{
public static function Add($user)
{
if (Config::get('duoshuo_shortname')!='') {
if ($user->is_admin==1) {
$role="administrator";
} else {
$role="user";
}
$data = array();
$data['short_name'] = Config::get('duoshuo_shortname');
$data['secret'] = Config::get('duoshuo_apptoken');
$data['users'] = array();
$data['users'][] = array(
'user_key' => $user->id,
'name' => $user->user_name,
'avatar_url' => "https://secure.gravatar.com/avatar/".md5($user->email)."&r=X&s=80",
'email' => $user->email,
'role' => $role
);
$param = http_build_query($data, '', '&');
$sock = new HTTPSocket;
$sock->connect("api.duoshuo.com", 80);
$sock->set_method('POST');
$sock->query('/users/import.json', $param);
}
}
}

@ -16,6 +16,9 @@ class Hash
case 'sha256':
return self::sha256WithSalt($str);
break;
case 'argon2i':
return self::argon2iWithSalt($str);
break;
default:
return self::md5WithSalt($str);
}
@ -38,7 +41,12 @@ class Hash
$salt = Config::get('salt');
return hash('sha256', $pwd.$salt);
}
public static function argon2iWithSalt($pwd)
{
$salt = Config::get('salt');
return hash('sha256',password_hash($pwd.$salt, PASSWORD_ARGON2I));
//由于直接Argon2字符超过64位数据库装不下,懒得去改数据库了,所有再套一层sha256在外面缩短下长度
}
// @TODO
public static function checkPassword($hashedPassword, $password)
{

@ -5,851 +5,10 @@ use App\Models\Code;
use App\Models\Paylist;
use App\Models\Payback;
use App\Services\Config;
use App\Services\Payment;
class Pay
{
public static function getHTML($user)
{
$driver = Config::get("payment_system");
switch ($driver) {
case "doiampay":
return Pay::doiampay_html($user);
case "paymentwall":
return Pay::pmw_html($user);
case 'spay':
return Pay::spay_html($user);
case 'zfbjk':
return Pay::zfbjk_html($user);
case 'f2fpay':
return Pay::f2fpay_html($user);
case 'yftpay':
return Pay::yftpay_html($user);
case 'codepay':
return Pay::codepay_html($user);
case 'f2fpay_codepay':
return Pay::f2fpay_codepay_html($user);
default:
return "";
}
return null;
}
/**
* DoiamPay
* @param User $user User
* @return String HTML
*/
private static function f2fpay_codepay_html($user)
{
return '
<p><i class="icon icon-lg">monetization_on</i>&nbsp;余额&nbsp;<font color="red" size="5">'.$user->money.'</font>&nbsp;元</p>
<p><img src="/images/qianbai-4.png" height="250" width="200" /></p>
<div class="form-group form-group-label">
<label class="floating-label" for="number">请选择充值金额</label>
<select id="type" class="form-control" name="amount">
<option></option>
<option value="'.Config::get('amount')[0].'">'.Config::get('amount')[0].'元</option>
<option value="'.Config::get('amount')[1].'">'.Config::get('amount')[1].'元</option>
<option value="'.Config::get('amount')[2].'">'.Config::get('amount')[2].'元</option>
<option value="'.Config::get('amount')[3].'">'.Config::get('amount')[3].'元</option>
<option value="'.Config::get('amount')[4].'">'.Config::get('amount')[4].'元</option>
</select>
</div>
<p></p>
<button class="btn btn-flat waves-attach" id="urlChange"><img src="/images/alipay.jpg" width="50px" height="50px" /></button>
<button class="btn btn-flat waves-attach" onclick="codepay()"><img src="/images/weixin.jpg" width="50px" height="50px" /></button>
<script>
function codepay() {
window.location.href=("/user/code/codepay?type=3&price="+$("#type").val());
}
</script>
';
}
public static function doiampay_html(User $user){
return \App\Utils\DoiAMPay::render();
}
private static function spay_html($user)
{
return '
<form action="/user/alipay" method="get" target="_blank" >
<h3>支付宝充值</h3>
<p>充值金额:
<select id="type" class="form-control" name="amount">
<option></option>
<option value="'.Config::get('amount')[0].'">'.Config::get('amount')[0].'元</option>
<option value="'.Config::get('amount')[1].'">'.Config::get('amount')[1].'元</option>
<option value="'.Config::get('amount')[2].'">'.Config::get('amount')[2].'元</option>
<option value="'.Config::get('amount')[3].'">'.Config::get('amount')[3].'元</option>
<option value="'.Config::get('amount')[4].'">'.Config::get('amount')[4].'元</option>
</select></p>
<input type="submit" value="提交" />
</form>
';
}
private static function zfbjk_html($user)
{
return '
<p>请扫码,给我转账来充值,记得备注上 <code>'.$user->id.'</code>。<br></p>
<img src="'.Config::get('zfbjk_qrcodeurl').'"/>
';
}
private static function f2fpay_html($user)
{
return '
<p><i class="icon icon-lg">monetization_on</i>&nbsp;余额&nbsp;<font color="red" size="5">'.$user->money.'</font>&nbsp;元</p>
<p><img src="/images/qianbai-4.png" height="250" width="202" /></p>
<div class="form-group form-group-label">
<label class="floating-label" for="number">请选择充值金额</label>
<select id="type" class="form-control" name="amount">
<option></option>
<option value="'.Config::get('amount')[0].'">'.Config::get('amount')[0].'元</option>
<option value="'.Config::get('amount')[1].'">'.Config::get('amount')[1].'元</option>
<option value="'.Config::get('amount')[2].'">'.Config::get('amount')[2].'元</option>
<option value="'.Config::get('amount')[3].'">'.Config::get('amount')[3].'元</option>
<option value="'.Config::get('amount')[4].'">'.Config::get('amount')[4].'元</option>
</select>
</div>
<p></p>
<a class="btn btn-flat waves-attach" id="urlChange" ><span class="icon">local_gas_station</span>&nbsp;充值</a>
';
}
private static function yftpay_html($user)
{
return '
<form action="/user/code/yft" method="post" target="_blank">
<div class="card-inner">
<p class="card-heading">在线充值</p>
<p><i class="icon icon-lg">monetization_on</i>&nbsp;余额&nbsp;<font color="red" size="5">'.$user->money.'</font>&nbsp;元</p>
<p><img src="/images/qianbai-4.png" height="250" width="200" /></p>
<div class="form-group form-group-label">
<label class="floating-label" for="price">输入充值金额</label>
<input class="form-control" id="price" name="price" type="text">
</div>
</div>
<div class="card-action">
<div class="card-action-btn pull-left">
<button type="submit" class="btn btn-flat waves-attach" id="yftCoin" ><span class="icon">check</span>&nbsp;充值</button>
</div>
</div>
</form>
';
}
private static function codepay_html($user)
{
return '
<p class="card-heading">请输入充值金额</p>
<form name="codepay" action="/user/code/codepay" method="get">
<input class="form-control" id="price" name="price" placeholder="输入充值金额后,点击你要付款的应用图标即可" autofocus="autofocus" type="number" min="0.01" max="1000" step="0.01" required="required">
<br>
<button class="btn btn-flat waves-attach" id="btnSubmit" type="submit" name="type" value="1" ><img src="/images/alipay.jpg" width="50px" height="50px" /></button>
<button class="btn btn-flat waves-attach" id="btnSubmit" type="submit" name="type" value="2" ><img src="/images/qqpay.jpg" width="50px" height="50px" /></button>
<button class="btn btn-flat waves-attach" id="btnSubmit" type="submit" name="type" value="3" ><img src="/images/weixin.jpg" width="50px" height="50px" /></button>
</form>
';
}
private static function pmw_html($user)
{
\Paymentwall_Config::getInstance()->set(array(
'api_type' => \Paymentwall_Config::API_VC,
'public_key' => Config::get('pmw_publickey'),
'private_key' => Config::get('pmw_privatekey')
));
$widget = new \Paymentwall_Widget(
$user->id, // id of the end-user who's making the payment
Config::get('pmw_widget'), // widget code, e.g. p1; can be picked inside of your merchant account
array(), // array of products - leave blank for Virtual Currency API
array(
'email' => $user->email,
'history'=>
array(
'registration_date'=>strtotime($user->reg_date),
'registration_ip'=>$user->reg_ip,
'payments_number'=>Code::where('userid', '=', $user->id)->where('type', '=', -1)->count(),
'membership'=>$user->class),
'customer'=>array(
'username'=>$user->user_name
)
) // additional parameters
);
return $widget->getHtmlCode(array("height"=>Config::get('pmw_height'),"width"=>"100%"));
}
private static function spay_gen($user, $amount)
{
/**************************请求参数**************************/
$alipay_config = Spay_tool::getConfig();
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $amount;
$pl->save();
//商户订单号,商户网站订单系统中唯一订单号,必填
$out_trade_no = $pl->id;
//订单名称,必填
$subject = $pl->id."UID".$user->id." 充值".$amount."元";
//付款金额,必填
$total_fee = (float)$amount;
//商品描述,可空
$body = $user->id;
/************************************************************/
//构造要请求的参数数组,无需改动
$parameter = array(
"service" => "create_direct_pay_by_user",
"partner" => trim($alipay_config['partner']),
"notify_url" => $alipay_config['notify_url'],
"return_url" => $alipay_config['return_url'],
"out_trade_no" => $out_trade_no,
"total_fee" => $total_fee
);
//建立请求
$alipaySubmit = new Spay_submit($alipay_config);
$html_text = $alipaySubmit->buildRequestForm($parameter, "get", "确认");
echo $html_text;
exit(0);
}
private static function get_alipay_config()
{
//获取支付宝接口配置
$config = array (
//签名方式,默认为RSA2(RSA2048)
'sign_type' => "RSA2",
//支付宝公钥
'alipay_public_key' => Config::get("alipay_public_key"),
//商户私钥
'merchant_private_key' => Config::get("merchant_private_key"),
//编码格式
'charset' => "UTF-8",
//支付宝网关
'gatewayUrl' => "https://openapi.alipay.com/gateway.do",
//应用ID
'app_id' => Config::get("f2fpay_app_id"),
//异步通知地址,只有扫码支付预下单可用
'notify_url' => Config::get("baseUrl")."/pay_callback",
//最大查询重试次数
'MaxQueryRetry' => "10",
//查询间隔
'QueryDuration' => "3"
);
return $config;
}
public static function alipay_get_qrcode($user, $amount, &$qrPay)
{
//创建订单
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $amount;
$pl->save();
//获取支付宝接口配置
$config = Pay::get_alipay_config();
//$timestamp
/**************************请求参数**************************/
// (必填) 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线,
// 需保证商户系统端不能重复,建议通过数据库sequence生成,
//$outTradeNo = "qrpay".date('Ymdhis').mt_rand(100,1000);
$outTradeNo = $pl->id;
// (必填) 订单标题,粗略描述用户的支付目的。如“xxx品牌xxx门店当面付扫码消费”
$subject = "¥".$pl->total." - ".Config::get("appName")." - {$user->user_name}({$user->email})";
// (必填) 订单总金额,单位为元,不能超过1亿元
// 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
$totalAmount = $pl->total;
// (不推荐使用) 订单可打折金额,可以配合商家平台配置折扣活动,如果订单部分商品参与打折,可以将部分商品总价填写至此字段,默认全部商品可打折
// 如果该值未传入,但传入了【订单总金额】,【不可打折金额】 则该值默认为【订单总金额】- 【不可打折金额】
//String discountableAmount = "1.00"; //
// (可选) 订单不可打折金额,可以配合商家平台配置折扣活动,如果酒水不参与打折,则将对应金额填写至此字段
// 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】
$undiscountableAmount = "0.01";
// 卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
// 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
//$sellerId = "";
// 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
$body = "用户名:".$user->user_name." 用户ID:".$user->id." 用户充值共计".$pl->total."元";
//商户操作员编号,添加此参数可以为商户操作员做销售统计
$operatorId = "bak_admin0001";
// (可选) 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
$storeId = "bak_store001";
// 支付宝的店铺编号
//$alipayStoreId= "2016041400077000000003314986";
// 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),系统商开发使用,详情请咨询支付宝技术支持
$providerId = ""; //系统商pid,作为系统商返佣数据提取的依据
$extendParams = new \ExtendParams();
$extendParams->setSysServiceProviderId($providerId);
$extendParamsArr = $extendParams->getExtendParams();
// 支付超时,线下扫码交易定义为5分钟
$timeExpress = "5m";
// 商品明细列表,需填写购买商品详细信息,
$goodsDetailList = array();
// 创建一个商品信息,参数含义分别为商品id(使用国标)、名称、单价(单位为分)、数量,如果需要添加商品类别,详见GoodsDetail
$goods1 = new \GoodsDetail();
$goods1->setGoodsId($pl->total);
$goods1->setGoodsName("充值");
$goods1->setPrice($pl->total);
$goods1->setQuantity(1);
//得到商品1明细数组
$goods1Arr = $goods1->getGoodsDetail();
$goodsDetailList = array($goods1Arr);
//第三方应用授权令牌,商户授权系统商开发模式下使用
$appAuthToken = "";//根据真实值填写
// 创建请求builder,设置请求参数
$qrPayRequestBuilder = new \AlipayTradePrecreateContentBuilder();
$qrPayRequestBuilder->setOutTradeNo($outTradeNo);
$qrPayRequestBuilder->setTotalAmount($totalAmount);
$qrPayRequestBuilder->setTimeExpress($timeExpress);
$qrPayRequestBuilder->setSubject($subject);
$qrPayRequestBuilder->setBody($body);
$qrPayRequestBuilder->setUndiscountableAmount($undiscountableAmount);
$qrPayRequestBuilder->setExtendParams($extendParamsArr);
$qrPayRequestBuilder->setGoodsDetailList($goodsDetailList);
$qrPayRequestBuilder->setStoreId($storeId);
$qrPayRequestBuilder->setOperatorId($operatorId);
//$qrPayRequestBuilder->setAlipayStoreId($alipayStoreId);
$qrPayRequestBuilder->setAppAuthToken($appAuthToken);
// 调用qrPay方法获取当面付应答
$qrPay = new \AlipayTradeService($config);
$qrPayResult = $qrPay->qrPay($qrPayRequestBuilder);
return $qrPayResult;
}
private static function f2fpay_gen($user, $amount)
{
//$qrPayResult = Pay::query_alipay_order(2017052112230123456);
//return ;
//生成二维码
$qrPayResult = Pay::alipay_get_qrcode($user, $amount, $qrPay);
// 根据状态值进行业务处理
switch ($qrPayResult->getTradeStatus()){
case "SUCCESS":
echo "支付金额: RMB ".$amount." 元";
echo "确认无误后请用支付宝App扫描二维码支付:"."<br>---------------------------------------<br>";
$response = $qrPayResult->getResponse();
$qrcode = $qrPay->create_erweima($response->qr_code);
echo $qrcode."<br>";
break;
case "FAILED":
echo "支付宝创建订单二维码失败!!!"."<br>--------------------------<br>";
if(!empty($qrPayResult->getResponse())){
print_r($qrPayResult->getResponse());
}
echo "请使用其他方式付款。";
break;
case "UNKNOWN":
echo "系统异常,状态未知!!!"."<br>--------------------------<br>";
if(!empty($qrPayResult->getResponse())){
print_r($qrPayResult->getResponse());
}
echo "请使用其他方式付款。";
break;
default:
echo "创建订单二维码返回异常!!!"."<br>--------------------------<br>";
echo "请使用其他方式付款。";
break;
}
if ($qrPayResult->getTradeStatus()) {
sleep(1);
echo "轮询处理:";
}
return ;
}
public static function getGen($user, $amount)
{
$driver = Config::get("payment_system");
switch ($driver) {
case "paymentwall":
return Pay::pmw_html();
case 'spay':
return Pay::spay_gen($user, $amount);
case 'zfbjk':
return Pay::alipay_html();
case 'f2fpay':
return Pay::f2fpay_gen($user, $amount);
default:
return "";
}
return null;
}
private static function spay_callback()
{
//计算得出通知验证结果
$alipayNotify = new Spay_notify(Spay_tool::getConfig());
$verify_result = $alipayNotify->verifyNotify();
if ($verify_result) {//验证成功
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//请在这里加上商户的业务逻辑程序代
//——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
//获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表
//商户订单号
$out_trade_no = $_POST['out_trade_no'];
//支付宝交易号
$trade_no = $_POST['trade_no'];
//交易状态
$trade_status = $_POST['trade_status'];
$trade = Paylist::where("id", '=', $out_trade_no)->where('status', 0)->where('total', $_POST['total_fee'])->first();
if ($trade == null) {
exit("success");
}
$trade->tradeno = $trade_no;
$trade->status = 1;
$trade->save();
//status
$trade_status = $_POST['trade_status'];
if ($_POST['trade_status'] == 'TRADE_FINISHED') {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的
//如果有做过处理,不执行商户的业务程序
//注意:
//退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
$user=User::find($trade->userid);
$user->money=$user->money+$_POST['total_fee'];
$user->save();
$codeq=new Code();
$codeq->code="支付宝 充值";
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$_POST['total_fee'];
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$_POST['total_fee'];
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
} elseif ($_POST['trade_status'] == 'TRADE_SUCCESS') {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的
//如果有做过处理,不执行商户的业务程序
//注意:
//付款完成后,支付宝系统发送该交易状态通知
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
$user=User::find($trade->userid);
$user->money=$user->money+$_POST['total_fee'];
$user->save();
$codeq=new Code();
$codeq->code="支付宝 充值";
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$_POST['total_fee'];
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$_POST['total_fee'];
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
}
//——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
echo "success"; //请不要修改或删除
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send("姐姐姐姐,一位不愿透露姓名的大老爷给我们捐了 ".$codeq->number." 元呢~");
} else {
Telegram::Send("姐姐姐姐,".$user->user_name." 大老爷给我们捐了 ".$codeq->number." 元呢~");
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
//验证失败
echo "fail";
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
}
}
private static function pmw_callback()
{
if (Config::get('pmw_publickey')!="") {
\Paymentwall_Config::getInstance()->set(array(
'api_type' => \Paymentwall_Config::API_VC,
'public_key' => Config::get('pmw_publickey'),
'private_key' => Config::get('pmw_privatekey')
));
$pingback = new \Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
if ($pingback->validate()) {
$virtualCurrency = $pingback->getVirtualCurrencyAmount();
if ($pingback->isDeliverable()) {
// deliver the virtual currency
} elseif ($pingback->isCancelable()) {
// withdraw the virual currency
}
$user=User::find($pingback->getUserId());
$user->money=$user->money+$pingback->getVirtualCurrencyAmount();
$user->save();
$codeq=new Code();
$codeq->code="Payment Wall 充值";
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$pingback->getVirtualCurrencyAmount();
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$pingback->getVirtualCurrencyAmount();
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
echo 'OK'; // Paymentwall expects response to be OK, otherwise the pingback will be resent
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send("姐姐姐姐,一位不愿透露姓名的大老爷给我们捐了 ".$codeq->number." 元呢~");
} else {
Telegram::Send("姐姐姐姐,".$user->user_name." 大老爷给我们捐了 ".$codeq->number." 元呢~");
}
}
} else {
echo $pingback->getErrorSummary();
}
} else {
echo 'error';
}
}
private static function zfbjk_callback($request)
{
//您在www.zfbjk.com的商户ID
$alidirect_pid = Config::get("zfbjk_pid");
//您在www.zfbjk.com的商户密钥
$alidirect_key = Config::get("zfbjk_key");
$tradeNo = $request->getParam('tradeNo');
$Money = $request->getParam('Money');
$title = $request->getParam('title');
$memo = $request->getParam('memo');
$alipay_account = $request->getParam('alipay_account');
$Gateway = $request->getParam('Gateway');
$Sign = $request->getParam('Sign');
if (!is_numeric($title)) {
exit("fail");
}
if (strtoupper(md5($alidirect_pid . $alidirect_key . $tradeNo . $Money . $title . $memo)) == strtoupper($Sign)) {
$trade = Paylist::where("tradeno", '=', $tradeNo)->first();
if ($trade != null) {
exit("success");
} else {
$user=User::where('id', '=', $title)->first();
if ($user == null) {
exit("IncorrectOrder");
}
$pl = new Paylist();
$pl->userid=$title;
$pl->tradeno=$tradeNo;
$pl->total=$Money;
$pl->datetime=time();
$pl->status=1;
$pl->save();
$user->money=$user->money+$Money;
$user->save();
$codeq=new Code();
$codeq->code="支付宝充值";
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$Money;
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$Money;
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send("姐姐姐姐,一位不愿透露姓名的大老爷给我们捐了 ".$codeq->number." 元呢~");
} else {
Telegram::Send("姐姐姐姐,".$user->user_name." 大老爷给我们捐了 ".$codeq->number." 元呢~");
}
}
exit("Success");
}
} else {
exit('Fail');
}
}
private static function f2fpay_callback()
{
$aop = new \AopClient();
$alipayrsaPublicKey = Config::get("alipay_public_key");
$aop->alipayrsaPublicKey = $alipayrsaPublicKey;
//获取支付宝返回参数
$arr=$_POST;
//调用验签的方法
$result = $aop->rsaCheckV1($arr,$alipayrsaPublicKey,$_POST['sign_type']);
if($result) {//验证成功
//系统订单号
$out_trade_no = $_POST['out_trade_no'];
//支付宝交易号
$trade_no = $_POST['trade_no'];
//交易状态
$trade_status = $_POST['trade_status'];
// 查询系统订单
$alipayPID = Config::get("f2fpay_p_id");
if ($_POST['seller_id']!=$alipayPID){
exit("success");
}
$trade = Paylist::where("id", '=', $out_trade_no)->where('status', 0)->where('total', $_POST['total_amount'])->first();
if ($trade == null) {//没有符合的订单,或订单已经处理
exit("success");
}
//订单查询到,处理业务
if($trade_status == 'TRADE_FINISHED'||$trade_status == 'TRADE_SUCCESS') {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//请务必判断请求时的total_amount与通知时获取的total_fee为一致的
//如果有做过处理,不执行商户的业务程序
//注意:
//付款完成后,支付宝系统发送该交易状态通知
//退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
//更新订单状态
$trade->tradeno = $trade_no;
$trade->status = 1;
$trade->save();
//更新用户账户
$user=User::find($trade->userid);
$user->money=$user->money+$_POST['total_amount'];
$user->save();
//更新充值(捐赠)记录
$codeq=new Code();
$codeq->code="支付宝 充值";
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$_POST['total_amount'];
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
//更新返利
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$_POST['total_amount'];
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send("一位不愿透露姓名的大老爷给我们捐了 ".$codeq->number." 元!");
} else {
Telegram::Send($user->user_name." 大老爷给我们捐了 ".$codeq->number." 元!");
}
}
//业务处理完毕,向支付宝系统返回成功
echo "success"; //请不要修改或删除
}
}else {
//验证失败
echo "fail"; //请不要修改或删除
}
}
private static function codepay_callback(){
//以下五行无需更改
ksort($_POST); //排序post参数
reset($_POST); //内部指针指向数组中的第一个元素
$codepay_key=Config::get('codepay_key'); //这是您的密钥
$sign = '';//初始化
foreach ($_POST AS $key => $val) { //遍历POST参数
if ($val == '' || $key == 'sign') continue; //跳过这些不签名
if ($sign) $sign .= '&'; //第一个字符串签名不加& 其他加&连接起来参数
$sign .= "$key=$val"; //拼接为url参数形式
}
if (!$_POST['pay_no'] || md5($sign . $codepay_key) != $_POST['sign']) { //不合法的数据
exit('fail'); //返回失败,等待下次回调
} else { //合法的数据
//业务处理
$pay_id = $_POST['pay_id']; //需要充值的ID 或订单号 或用户名
$money = (float)$_POST['money']; //实际付款金额
$price = (float)$_POST['price']; //订单的原价
//$param = $_POST['param']; //自定义参数
$pay_no = $_POST['pay_no']; //流水号
$codeq=Code::where("code", "=", $pay_no)->first();
if ($codeq==null){
$user=User::find($pay_id);
$codeq=new Code();
$codeq->code=$pay_no;
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$price;
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
$user->money=$user->money+$price;
$user->save();
//更新返利
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$price;
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send("一位不愿透露姓名的大老爷给我们捐了 ".$codeq->number." 元!");
} else {
Telegram::Send($user->user_name." 大老爷给我们捐了 ".$codeq->number." 元!");
}
}
}
exit('success'); //返回成功 不要删除哦
}
return;
}
private static function notify(){
//系统订单号
$trade_no = $_POST['pay_no'];
//交易用户
$trade_id = strtok($_POST['pay_id'], "@");
//金额
$trade_num = $_POST['price'];
$param = urldecode($_POST['param']);
$codeq=Code::where("code", "=", $trade_no)->first();
if($codeq!=null){
exit('success'); //说明数据已经处理完毕
return;
}
if($param!=Config::get('alipay')||$trade_no==''){ //鉴权失败
exit('fail');
return;
}
//更新用户账户
$user=User::find($trade_id);
$codeq=new Code();
$codeq->code=$trade_no;
$codeq->isused=1;
$codeq->type=-1;
$codeq->number=$_POST['price'];
$codeq->usedatetime=date("Y-m-d H:i:s");
$codeq->userid=$user->id;
$codeq->save();
$user->money=$user->money+$trade_num;
$user->save();
//更新返利
if ($user->ref_by!=""&&$user->ref_by!=0&&$user->ref_by!=null) {
$gift_user=User::where("id", "=", $user->ref_by)->first();
$gift_user->money=($gift_user->money+($codeq->number*(Config::get('code_payback')/100)));
$gift_user->save();
$Payback=new Payback();
$Payback->total=$trade_num;
$Payback->userid=$user->id;
$Payback->ref_by=$user->ref_by;
$Payback->ref_get=$codeq->number*(Config::get('code_payback')/100);
$Payback->datetime=time();
$Payback->save();
}
exit('success'); //返回成功 不要删除哦
}
public static function callback($request)
{
$driver = Config::get("payment_system");
switch ($driver) {
case "paymentwall":
return Pay::pmw_callback();
case 'spay':
return Pay::spay_callback();
case 'zfbjk':
return Pay::zfbjk_callback($request);
case 'f2fpay':
return Pay::f2fpay_callback();
case 'codepay':
return Pay::codepay_callback();
default:
return "";
}
return null;
}
public static function f2fpay_pay_callback($request)
{
return Pay::f2fpay_callback();
}
public static function codepay_pay_callback($request)
{
return Pay::codepay_callback();
}
}

@ -14,8 +14,11 @@ class Telegram
{
if (Config::get('enable_telegram') == 'true') {
$bot = new \TelegramBot\Api\BotApi(Config::get('telegram_token'));
$bot->sendMessage(Config::get('telegram_chatid'), $messageText);
try{
$bot->sendMessage(Config::get('telegram_chatid'), $messageText);
} catch (\Exception $e) {
echo $e->getMessage();
}
}
}
@ -24,8 +27,11 @@ class Telegram
{
if (Config::get('enable_telegram') == 'true') {
$bot = new \TelegramBot\Api\BotApi(Config::get('telegram_token'));
$bot->sendMessage(Config::get('telegram_chatid'), $messageText, "Markdown");
try{
$bot->sendMessage(Config::get('telegram_chatid'), $messageText, "Markdown");
} catch (\Exception $e) {
echo $e->getMessage();
}
}
}
}

@ -29,6 +29,10 @@ class TelegramProcess
$user->save();
$bot->sendMessage($message->getChat()->getId(), "签到成功!获得了 ".$traffic." MB 流量!", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
break;
case 'prpr':
$prpr = array('⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄', '(≧ ﹏ ≦)', '(*/ω\*)', 'ヽ(*。>Д<)o゜', '(つ ﹏ ⊂)', '( > < )');
$bot->sendMessage($message->getChat()->getId(), $prpr[mt_rand(0,5)], $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
break;
default:
$bot->sendMessage($message->getChat()->getId(), "???", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
}
@ -44,8 +48,10 @@ class TelegramProcess
if ($message->getChat()->getId() > 0) {
//个人
$bot->sendChatAction($message->getChat()->getId(), 'typing');
$commands = array("ping", "chat", "traffic", "checkin", "help");
if(in_array($command, $commands)){
$bot->sendChatAction($message->getChat()->getId(), 'typing');
}
switch ($command) {
case 'ping':
$bot->sendMessage($message->getChat()->getId(), 'Pong!这个群组的 ID 是 '.$message->getChat()->getId().'!');
@ -59,6 +65,9 @@ class TelegramProcess
case 'checkin':
TelegramProcess::needbind_method($bot, $message, $command, $user, $message->getMessageId());
break;
case 'prpr':
TelegramProcess::needbind_method($bot, $message, $command, $user, $message->getMessageId());
break;
case 'help':
$help_list = "命令列表:
/ping 获取群组ID
@ -165,9 +174,10 @@ class TelegramProcess
if (Config::get('telegram_group_quiet') == 'true') {
return;
}
$bot->sendChatAction($message->getChat()->getId(), 'typing');
$commands = array("ping", "chat", "traffic", "checkin", "help");
if(in_array($command, $commands)){
$bot->sendChatAction($message->getChat()->getId(), 'typing');
}
switch ($command) {
case 'ping':
$bot->sendMessage($message->getChat()->getId(), 'Pong!这个群组的 ID 是 '.$message->getChat()->getId().'!', $parseMode = null, $disablePreview = false, $replyToMessageId = $message->getMessageId());
@ -185,6 +195,9 @@ class TelegramProcess
case 'checkin':
TelegramProcess::needbind_method($bot, $message, $command, $user, $message->getMessageId());
break;
case 'prpr':
TelegramProcess::needbind_method($bot, $message, $command, $user, $message->getMessageId());
break;
case 'help':
$help_list_group = "命令列表:
/ping 获取群组ID
@ -204,6 +217,9 @@ class TelegramProcess
$bot->sendMessage($message->getChat()->getId(), '不约,叔叔我们不约。', $parseMode = null, $disablePreview = false, $replyToMessageId = $message->getMessageId());
}
}
if ($message->getNewChatMember() != null && Config::get('enable_welcome_message') == 'true') {
$bot->sendMessage($message->getChat()->getId(), "欢迎 ".$message->getNewChatMember()->getFirstName()." ".$message->getNewChatMember()->getLastName(), $parseMode = null, $disablePreview = false);
}
}
}
@ -217,7 +233,7 @@ class TelegramProcess
// or initialize with botan.io tracker api key
// $bot = new \TelegramBot\Api\Client('YOUR_BOT_API_TOKEN', 'YOUR_BOTAN_TRACKER_API_KEY');
$command_list = array("ping", "chat" ,"traffic", "help", "checkin");
$command_list = array("ping", "chat" ,"traffic", "help", "prpr", "checkin");
foreach ($command_list as $command) {
$bot->command($command, function ($message) use ($bot, $command) {
TelegramProcess::telegram_process($bot, $message, $command);

@ -36,12 +36,14 @@ class Tools
}
}
//虽然名字是toMB,但是实际上功能是from MB to B
public static function toMB($traffic)
{
$mb = 1048576;
return $traffic * $mb;
}
//虽然名字是toGB,但是实际上功能是from GB to B
public static function toGB($traffic)
{
$gb = 1048576 * 1024;
@ -70,6 +72,18 @@ class Tools
}
//获取随机字符串
public static function genRandomNum($length = 8)
{
// 来自Miku的 6位随机数 注册验证码 生成方案
$chars = '0123456789';
$char = '';
for ($i = 0; $i < $length; $i++) {
$char .= $chars[mt_rand(0, strlen($chars) - 1)];
}
return $char;
}
public static function genRandomChar($length = 8)
{
// 密码字符集,可任意添加你需要的字符
@ -88,8 +102,7 @@ class Tools
public static function is_ip($a)
{
$b = preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $a);
return $b;
return preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $a);
}
@ -131,14 +144,11 @@ class Tools
{
//检索User数据表现有port
$det = User::pluck('port')->toArray();
$port = array_diff(range(Config::get('min_port'), Config::get('max_port')), $det);
shuffle($port);
return $port[0];
}
public static function base64_url_encode($input)
{
return strtr(base64_encode($input), array('+' => '-', '/' => '_', '=' => ''));
@ -169,10 +179,7 @@ class Tools
public static function is_validate($str)
{
$pattern = "/[^A-Za-z0-9\-_\.]/";
if (preg_match($pattern, $str)) {
return false;
}
return true;
return !preg_match($pattern, $str);
}
public static function is_relay_rule_avaliable($rule, $ruleset, $node_id)
@ -430,4 +437,13 @@ class Tools
{
return str_replace("::ffff:", "", $rawIp);
}
public static function isInt($str)
{
if($str[0]=='-'){
$str=substr($str,1);
}
return ctype_digit($str);
}
}

@ -4,6 +4,7 @@ use App\Models\User;
use App\Models\Node;
use App\Models\Relay;
use App\Services\Config;
use App\Controllers\LinkController;
class URL
{
@ -63,6 +64,21 @@ class URL
return 3;
}
}
public static function parse_args($origin) {
// parse xxx=xxx|xxx=xxx to array(xxx => xxx, xxx => xxx)
$args_explode = explode('|', $origin);
$return_array = [];
foreach ($args_explode as $arg) {
$split_point = strpos($arg, '=');
$return_array[substr($arg, 0, $split_point)] = substr($arg, $split_point + 1);
}
return $return_array;
}
public static function SSCanConnect($user, $mu_port = 0) {
if($mu_port != 0) {
$mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
@ -77,6 +93,7 @@ class URL
return false;
}
}
public static function SSRCanConnect($user, $mu_port = 0) {
if($mu_port != 0) {
$mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
@ -91,6 +108,78 @@ class URL
return false;
}
}
public static function getClashInfo($user) {
$result = [];
$v2ray_nodes = $nodes=Node::where(
function ($query) {
$query->where('sort', 11);
}
)->where(
function ($query) use ($user){
$query->where("node_group", "=", $user->node_group)
->orWhere("node_group", "=", 0);
}
)->where("type", "1")->where("node_class", "<=", $user->class)->orderBy("name")->get();
foreach ($v2ray_nodes as $v2ray_node) {
$node_explode = explode(';', $v2ray_node->server);
$docs = [
"name" => $v2ray_node->name,
"type" => "vmess",
"server" => $node_explode[0],
"port" => $node_explode[1],
"uuid" => $user->getUuid(),
"alterId" => $node_explode[2],
"cipher" => "auto",
];
if (count($node_explode) >= 4) {
if ($node_explode[3] == 'ws') {
$docs['network'] = 'ws';
} else if ($node_explode[3] == 'tls') {
$docs['tls'] = true;
}
}
if (count($node_explode) >= 5) {
if ($node_explode[4] == "ws") {
$docs['network'] = 'ws';
}
}
$result[] = $docs;
}
if (self::SSCanConnect($user, 0)) {
$shadowsocks_nodes = Node::where(
function ($query) {
$query->where('sort', 0)
->orwhere('sort', 10);
}
)->where(
function ($query) use ($user){
$query->where("node_group", "=", $user->node_group)
->orWhere("node_group", "=", 0);
}
)->where("type", "1")->where("node_class", "<=", $user->class)->orderBy("name")->get();
foreach ($shadowsocks_nodes as $node) {
$result[] = [
"name" => $node->name,
"type" => "ss",
"server" => $node->server,
"port" => $user->port,
// TODO: method mapper
"cipher" => $user->method,
"password" => $user->passwd,
];
}
}
return $result;
}
public static function getSSConnectInfo($user) {
$new_user = clone $user;
if(URL::CanObfsConnect($new_user->obfs) == 5) {
@ -105,6 +194,7 @@ class URL
$new_user->protocol = str_replace("_compatible", "", $new_user->protocol);
return $new_user;
}
public static function getSSRConnectInfo($user) {
$new_user = clone $user;
if(URL::CanObfsConnect($new_user->obfs) == 4) {
@ -213,13 +303,26 @@ class URL
return $return_array;
}
public static function getAllUrl($user, $is_mu, $is_ss = 0, $enter = 0) {
$items = URL::getAllItems($user, $is_mu, $is_ss);
$return_url = '';
$return_url .= URL::getUserTraffic($user, $is_mu).($enter == 0 ? ' ' : "\n");
$return_url .= URL::getUserClassExpiration($user, $is_mu).($enter == 0 ? ' ' : "\n");
if(strtotime($user->expire_in)<time()){
return $return_url;
}
$items = URL::getAllItems($user, $is_mu, $is_ss);
foreach($items as $item) {
$return_url .= URL::getItemUrl($item, $is_ss).($enter == 0 ? ' ' : "\n");
}
if(Config::get('mergeSub') and in_array($is_mu, array(0, 1))){
$is_mu = $is_mu==0?1:0;
$items = URL::getAllItems($user, $is_mu, $is_ss);
foreach($items as $item) {
$return_url .= URL::getItemUrl($item, $is_ss).($enter == 0 ? ' ' : "\n");
}
}
return $return_url;
}
public static function getItemUrl($item, $is_ss) {
$ss_obfs_list = Config::getSupportParam('ss_obfs');
if(!$is_ss) {
@ -251,21 +354,170 @@ class URL
}
}
public static function getV2Url($user, $node){
$v2url = "";
$node_explode = explode(';', $node->server);
$item = [
'v'=>'2',
'host'=>'',
'path'=>'',
'tls'=>''
];
$item['ps'] = $node->name;
$item['add'] = $node_explode[0];
$item['port'] = $node_explode[1];
$item['id'] = $user->getUuid();
$item['aid'] = $node_explode[3];
$item['aid'] = $node_explode[2];
$item['net'] = "tcp";
$item['type'] = "none";
$arr = array('v'=>'2', 'ps'=>$item['ps'], 'add'=>$item['add'], 'port'=>$item['port'], 'id'=>$item['id'], 'aid'=>$item['aid'], 'net'=>'tcp', 'type'=>'none', 'host'=>'', 'path'=>'', 'tls'=>'');
$v2url = "vmess://".Tools::base64_url_encode((json_encode($arr, JSON_UNESCAPED_UNICODE)));
//$v2url = "{"."\n \"v\": \"2\",\n \"ps\": \"".$item['ps']."\",\n \"add\": \"".$item['add']."\",\n \"port\": \"".$item['port']."\",\n \"id\": \"".$item['id']."\",\n \"aid\": \"".$item['aid']."\",\n \"net\": \"".$item['net']."\",\n \"type\": \"".$item['type']."\",\n \"host\": \"\",\n \"path\": \"\",\n \"tls\": \"\"";
return $v2url;
if (count($node_explode) >= 4) {
$item['net'] = $node_explode[3];
if ($item['net'] == 'ws') {
$item['path'] = '/';
} else if ($item['net'] == 'tls') {
$item['tls'] = 'tls';
}
}
if (count($node_explode) >= 5 ) {
if (in_array($item['net'], array("kcp", "http"))){
$item['type'] = $node_explode[4];
} else if ($node_explode[4]=='ws'){
$item['net'] = 'ws';
}
}
if (count($node_explode) >= 6) {
$item = array_merge($item, URL::parse_args($node_explode[5]));
}
return "vmess://".base64_encode((json_encode($item, JSON_UNESCAPED_UNICODE)));
}
public static function getAllVMessUrl($user) {
$nodes = Node::where('sort', 11)->where(
function ($query) use ($user){
$query->where("node_group", "=", $user->node_group)
->orWhere("node_group", "=", 0);
}
)->where("type", "1")->where("node_class", "<=", $user->class)->orderBy("name")->get();
$result = "";
foreach ($nodes as $node) {
$result .= (URL::getV2Url($user, $node) . "\n");
}
return $result;
}
public static function getAllSSDUrl($user){
if (!URL::SSCanConnect($user)){
return null;
}
$array_all=array();
$array_all['airport']=Config::get("appName");
$array_all['port']=$user->port;
$array_all['encryption']=$user->method;
$array_all['password']=$user->passwd;
$array_all['traffic_used']=Tools::flowToGB($user->u+$user->d);
$array_all['traffic_total']=Tools::flowToGB($user->transfer_enable);
$array_all['expiry']=$user->class_expire;
$array_all['url']=Config::get('baseUrl').'/link/'.LinkController::GenerateSSRSubCode($user->id, 0).'?mu=3';
$plugin_options='';
if(strpos($user->obfs,'http')!=FALSE){
$plugin_options='obfs=http';
}
if(strpos($user->obfs,'tls')!=FALSE){
$plugin_options='obfs=tls';
}
if($plugin_options!=''){
$array_all['plugin']='simple-obfs';//目前只支持这个
$array_all['plugin_options']=$plugin_options;
if($user->obfs_param!=''){
$array_all['plugin_options'].=';obfs-host='.$user->obfs_param;
}
}
$nodes_muport=Node::where('type',1)->where('sort', '=', 9)->orderBy('name')->get();
$array_server=array();
$nodes = Node::where('type',1)->where('node_class','<=',$user->class)
->where(function ($func){
$func->where('sort', '=', 0)
->orwhere('sort', '=', 10);
})
->where(function ($func) use ($user){
$func->where('node_group', '=', $user->group)
->orwhere('node_group', '=', 0);
})->orderBy('name')->get();
$server_index=1;
foreach($nodes as $node){
$server=array();
$server['id']=$server_index;
$server['server']=$node->server;
//判断是否是中转起源节点
$relay_rule = Relay::where('source_node_id', $node->id)->where(
function ($query) use ($user) {
$query->Where('user_id', '=', $user->id)
->orWhere('user_id', '=', 0);
}
)->orderBy('priority','DESC')->orderBy('id')->first();
if ($relay_rule != null) {
//是中转起源节点
$server['remarks']=$node->name.' => '.$relay_rule->dist_node()->name;
$server['ratio']=$node->traffic_rate+$relay_rule->dist_node()->traffic_rate;
array_push($array_server,$server);
$server_index++;
continue;
}
//不是中转起源节点
$server['ratio']=$node->traffic_rate;
//包含普通
if($node->mu_only==0||$node->mu_only==-1){
$server['remarks']=$node->name;
array_push($array_server,$server);
$server_index++;
}
//包含单多
if($node->mu_only==0||$node->mu_only==1){
$nodes_muport=Node::where('type','1')->where('sort', '=', 9)
->where(function ($query) use ($user) {
$query->Where('node_group', '=', $user->group)
->orWhere('node_group', '=', 0);
})
->where('node_class', '<=', $user->class)
->orderBy('server')->get();
foreach($nodes_muport as $node_muport){
$muport_user=User::where('port','=',$node_muport->server)->first();
if(!URL::SSCanConnect($muport_user)){
continue;
}
$server['id']=$server_index;
$server['remarks']=$node->name.' - 单多'.$node_muport->server.'端口';
$server['port']=$node_muport->server;
$server['encryption']=$muport_user->method;
$server['password']=$muport_user->passwd;
$server['plugin']='simple-obfs';//目前只支持这个
$plugin_options='';
if(strpos($muport_user->obfs,'http')!=FALSE){
$plugin_options='obfs=http';
}
if(strpos($muport_user->obfs,'tls')!=FALSE){
$plugin_options='obfs=tls';
}
$server['plugin_options']=$plugin_options.';obfs-host='.$user->getMuMd5();
array_push($array_server,$server);
$server_index++;
}
}
}
$array_all['servers']=$array_server;
$json_all=json_encode($array_all);
return 'ssd://'.Tools::base64_url_encode($json_all);
}
public static function getJsonObfs($item) {
$ss_obfs_list = Config::getSupportParam('ss_obfs');
$plugin = "";
@ -286,13 +538,18 @@ class URL
$plugin = "";
if(in_array($item['obfs'], $ss_obfs_list)) {
if(strpos($item['obfs'], 'http') !== FALSE) {
$plugin .= ",obfs=http";
} else {
$plugin .= ",obfs=tls";
$plugin .= "obfs=http";
}
else {
$plugin .= "obfs=tls";
}
if($item['obfs_param'] != '') {
$plugin .= ",obfs-host=".$item['obfs_param'];
}
else {
$plugin .= ",obfs-host=wns.windows.com";
}
}
return $plugin;
}
@ -314,7 +571,7 @@ class URL
$query->Where("user_id", "=", $user->id)
->orWhere("user_id", "=", 0);
}
)->first();
)->orderBy('priority','DESC')->orderBy('id')->first();
$node_name = $node->name;
if ($relay_rule != null) {
$node_name .= " - ".$relay_rule->dist_node()->name;
@ -327,7 +584,9 @@ class URL
$mu_user->obfs_param = $user->getMuMd5();
$mu_user->protocol_param = $user->id.":".$user->passwd;
$user = $mu_user;
$node_name .= " - ".$mu_port." 单端口";
if(!Config::get('mergeSub')){
$node_name .= " - ".$mu_port." 单端口";
}
}
if($is_ss) {
if(!URL::SSCanConnect($user)) {
@ -350,7 +609,7 @@ class URL
$return_array['obfs'] = $user->obfs;
$return_array['obfs_param'] = $user->obfs_param;
$return_array['group'] = Config::get('appName');
if($mu_port != 0) {
if($mu_port != 0 && !Config::get('mergeSub')) {
$return_array['group'] .= ' - 单端口';
}
return $return_array;
@ -359,4 +618,30 @@ class URL
$new_user = clone $user;
return $new_user;
}
public static function getUserTraffic($user, $is_mu = 0){
$group_name = Config::get('appName');
if(!Config::get('mergeSub') and $is_mu == 1){
$group_name .= ' - 单端口';
}
if(strtotime($user->expire_in)>time()){
$ssurl = "www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("剩余流量:".number_format(($user->transfer_enable-($user->u+$user->d))/$user->transfer_enable*100,2)."% ".$user->unusedTraffic())."&group=".Tools::base64_url_encode($group_name);
}else{
$ssurl = "www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("账户已过期,请续费后使用")."&group=".Tools::base64_url_encode($group_name);
}
return "ssr://".Tools::base64_url_encode($ssurl);
}
public static function getUserClassExpiration($user, $is_mu = 0){
$group_name = Config::get('appName');
if(!Config::get('mergeSub') and $is_mu == 1){
$group_name .= ' - 单端口';
}
if(strtotime($user->expire_in)>time()){
$ssurl = "www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("过期时间:".$user->class_expire)."&group=".Tools::base64_url_encode($group_name);
}else{
$ssurl = "www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("账户已过期,请续费后使用")."&group=".Tools::base64_url_encode($group_name);
}
return "ssr://".Tools::base64_url_encode($ssurl);
}
}

@ -1,157 +0,0 @@
<?php
namespace App\Utils;
use App\Models\User;
use App\Models\WecenterUser;
use App\Services\Config;
use App\Utils;
class Wecenter
{
/**
* 添加或者更新密码信息
*/
public static function Add($user, $pwd)
{
if (Config::get('enable_wecenter')=='true') {
$email=$user->email;
$exists=WecenterUser::where("email", $email)->first();
if ($exists==null) {
$exists=new WecenterUser();
$exists->password=md5(md5($pwd).Config::get('salt'));
$exists->user_name=$user->user_name;
$exists->email=$email;
$exists->salt=Config::get('salt');
$exists->group_id=5;
$exists->save();
} else {
$exists->password=md5(md5($pwd).Config::get('salt'));
$exists->salt=Config::get('salt');
$exists->save();
}
}
}
public static function Delete($email)
{
if (Config::get('enable_wecenter')=='true') {
WecenterUser::where("email", $email)->delete();
}
}
public static function ChangeUserName($email1, $email2, $pwd, $username)
{
if (Config::get('enable_wecenter')=='true') {
$exists=WecenterUser::where("email", $email1)->first();
if ($exists!=null) {
$exists->password=md5(md5($pwd).Config::get('salt'));
$exists->user_name=$username;
$exists->email=$email2;
$exists->salt=Config::get('salt');
$exists->save();
} else {
$exists=new WecenterUser();
$exists->password=md5(md5($pwd).Config::get('salt'));
$exists->user_name=$username;
$exists->email=$email2;
$exists->salt=Config::get('salt');
$exists->group_id=5;
$exists->save();
}
}
}
public static function Login($user, $pwd, $time)
{
if (Config::get('enable_wecenter')=='true') {
$email=$user->email;
$exists=WecenterUser::where("email", $email)->first();
$expire_in = $time+time();
Utils\Cookie::setwithdomain([Config::get('wecenter_cookie_prefix')."_user_login"=>Wecenter::encode_hash(json_encode(array(
'uid' => $exists->uid,
'user_name' => $user->email,
'password' => md5(md5($pwd).Config::get('salt'))
)), md5(Config::get('wecenter_cookie_key') . $_SERVER['HTTP_USER_AGENT']))], $expire_in, Config::get('wecenter_system_main_domain'));
}
}
public static function Loginout()
{
if (Config::get('enable_wecenter')=='true') {
Utils\Cookie::setwithdomain([Config::get('wecenter_cookie_prefix')."_user_login"=>"loginout"], time()-86400, Config::get('wecenter_system_main_domain'));
}
}
public static function encode_hash($hash_data, $hash_key = null)
{
$mcrypt = mcrypt_module_open(Wecenter::get_algorithms(), '', MCRYPT_MODE_ECB, '');
mcrypt_generic_init($mcrypt, Wecenter::get_key($mcrypt, $hash_key), mcrypt_create_iv(mcrypt_enc_get_iv_size($mcrypt), MCRYPT_RAND));
$result = mcrypt_generic($mcrypt, gzcompress($hash_data));
mcrypt_generic_deinit($mcrypt);
mcrypt_module_close($mcrypt);
return Wecenter::get_algorithms() . '|' . Wecenter::str_to_hex($result);
}
private static function get_key($mcrypt, $key = null)
{
if (!$key) {
$key = Config::get('wecenter_cookie_key');
}
return substr($key, 0, mcrypt_enc_get_key_size($mcrypt));
}
private static function get_algorithms()
{
$algorithms = mcrypt_list_algorithms();
foreach ($algorithms as $algorithm) {
if (strstr($algorithm, '-256')) {
return $algorithm;
}
}
foreach ($algorithms as $algorithm) {
if (strstr($algorithm, '-128')) {
return $algorithm;
}
}
return end($algorithms);
}
private static function str_to_hex($string)
{
$hex = null;
for ($i = 0; $i < strlen($string); $i++) {
$ord = ord($string[$i]);
$hexCode = dechex($ord);
$hex .= substr('0' . $hexCode, -2);
}
return strtoupper($hex);
}
private static function hex_to_str($hex)
{
$string = null;
for ($i = 0; $i < strlen($hex)-1; $i += 2) {
$string .= chr(hexdec($hex[$i] . $hex[$i + 1]));
}
return $string;
}
}

@ -1,28 +0,0 @@
<?php
/**
* Created by 傲慢与偏见.
* OSUser: D-L
* Date: 2017/10/12
* Time: 21:08
*/
namespace App\Utils;
class YftOrderNumUtil
{
public static function generate_yftOrder($length = 8)
{
// 密码字符集,可任意添加你需要的字符
$date = time();
$date = "yft".date("YmdHis",$date);
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$password = "";
for ($i = 0; $i < $length; $i++) {
// 这里提供两种字符获取方式
// 第一种是使用 substr 截取$chars中的任意一位字符;
// 第二种是取字符数组 $chars 的任意元素
$password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
}
return $date.$password;
}
}

@ -20,7 +20,6 @@ require BASE_PATH."/config/.config.php";
Boot::loadEnv();
Boot::setDebug();
//Boot::setVersion(VERSION);
// config time zone

@ -1,18 +1,17 @@
{
"require": {
"slim/slim": "*",
"slim/slim": "~3.0",
"slim/csrf": "*",
"smarty/smarty": "3.*",
"mailgun/mailgun-php": "~1.7.2",
"mailgun/mailgun-php": "^2.6.0",
"predis/predis": "~1.0",
"phpmailer/phpmailer": "~5.2",
"vlucas/phpdotenv": "~2.1",
"zeuxisoo/slim-whoops": "0.5.*",
"firebase/php-jwt": "~3.0",
"aws/aws-sdk-php": "3.*",
"gregwar/captcha": "1.*",
"cloudxns/cloud-xns-api-sdk-php": "*",
"guzzlehttp/guzzle": " ~5.0",
"guzzlehttp/guzzle": "^6.2.2",
"voku/anti-xss": "^1.2",
"paymentwall/paymentwall-php": "^2.1",
"telegram-bot/api": "^2.2",
@ -21,7 +20,11 @@
"sendgrid/sendgrid": "^5.1",
"esdeathlove/datatables": "^1.6",
"slim/twig-view": "1.2.0",
"ramsey/uuid": "^3.0@dev"
"ramsey/uuid": "^3.0@dev",
"cloudflare/sdk": "1.1.1",
"chen-see/chen-pay": "^1.0@dev",
"league/omnipay": "^3",
"lokielse/omnipay-alipay": "*"
},
"autoload": {
"classmap": [

2272
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -1,29 +1,41 @@
<?php
// ss-panel-v3-mod_UIChanges配置
// true为开启,false为关闭
//基础设置,正确填写以下内容你的网站就能使用了-----------------------------------------------------------------------
$System_Config['key'] = '1145141919810'; // !!! 瞎 jb 修改此key为随机字符串确保网站安全 !!!
$System_Config['debug'] = 'false'; // 正式环境请确保为 false
$System_Config['appName'] = 'sspanel'; //站点名称
$System_Config['baseUrl'] = 'http://url.com'; // 站点地址
$System_Config['muKey'] = 'NimaQu'; // mu key 用于校验ss-go mu的请求
$System_Config['db_driver'] = 'mysql'; //数据库程序
$System_Config['db_host'] = 'localhost'; //数据库地址
$System_Config['db_database'] = 'sspanel'; //数据库名
$System_Config['db_username'] = 'root'; //数据库用户名
$System_Config['db_password'] = 'sspanel'; //用户名对应的密码
//------------------------------以下为自定义设置,请按个人需求填写--------------------------------------------
//邮件设置-----------------------------------------------------------------------
$System_Config['mailDriver'] = 'mailgun'; // mailgun or smtp or sendgrid 选择发送邮件的方式
//注释里请勿使用英文方括号、分号、单引号,否则迁移Config时会出错
//config迁移附注(由开发者填写本次config迁移后需要注意的地方,站长勿动)
//如需换行,直接换行即可,无需换行符
//【新增/删除】config无需写入迁移附注
$System_Config['config_migrate_notice']=
'node_offline_warn 被改名为 enable_detect_offline
enable_register 和 enable_invite_code 合并为 register_mode
enable_auto_clean_unused 和 enable_auto_clean_unused_days 合并为auto_clean_unused_days
enable_auto_clean_uncheck 和 enable_auto_clean_uncheck_days 合并为 auto_clean_uncheck_days
enable_account_expire_delete 和 enable_account_expire_delete_days 合并为account_expire_delete_days
enable_class_expire_reset_traffic 重命名为 class_expire_reset_traffic
现在,用户账户过期时,流量会被强制重置为0
enable_geetest_* 已变更为 enable_*_captcha
';
$System_Config['version']='0'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
//基本设置--------------------------------------------------------------------------------------------
$System_Config['key'] = '1145141919810'; //!!! 瞎 jb 修改此key为随机字符串确保网站安全 !!!
$System_Config['debug'] = 'false'; //正式环境请确保为 false
$System_Config['appName'] = 'sspanel'; //站点名称
$System_Config['baseUrl'] = 'http://url.com'; //站点地址
$System_Config['subUrl'] = $System_Config['baseUrl'].'/link/'; //订阅地址,如需和站点名称相同,请不要修改
$System_Config['muKey'] = 'NimaQu'; //用于校验ss-go mu的请求,可以随意修改,但请保持前后端一致
$System_Config['db_driver'] = 'mysql'; //数据库程序
$System_Config['db_host'] = 'localhost'; //数据库地址
$System_Config['db_database'] = 'sspanel'; //数据库名
$System_Config['db_username'] = 'root'; //数据库用户名
$System_Config['db_password'] = 'sspanel'; //用户名对应的密码
//邮件设置--------------------------------------------------------------------------------------------
$System_Config['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid
$System_Config['sendPageLimit']= 50; //发信分页 解决大站发公告超时问题
# mailgun
$System_Config['mailgun_key'] = '';
@ -33,7 +45,7 @@ $System_Config['mailgun_sender'] = '';
# smtp
$System_Config['smtp_host'] = '';
$System_Config['smtp_username'] = '';
$System_Config['smtp_port'] = '';
$System_Config['smtp_port'] = '465';
$System_Config['smtp_name'] = '';
$System_Config['smtp_sender'] = '';
$System_Config['smtp_passsword'] = '';
@ -44,129 +56,122 @@ $System_Config['sendgrid_key'] = '';
$System_Config['sendgrid_sender'] = '';
//备份设置-----------------------------------------------------------------------
$System_Config['enable_auto_backup']='false';
$System_Config['auto_backup_email']='your email';
$System_Config['auto_backup_webroot']='your base dir ,such as /home/wwwroot/ss.panel/';
$System_Config['auto_backup_passwd']='zip password';
//用户注册设置--------------------------------------------------------------------
$System_Config['defaultTraffic'] = '1'; // 用户初始流量 单位GB
$System_Config['user_expire_in_default']='3650'; //用户账户过期时间,在注册时设置。(天)
$System_Config['user_class_default']='1'; //用户注册等级,在注册时设置。
$System_Config['user_class_expire_default']='2'; //用户等级过期时间,在注册时设置。(小时)
$System_Config['user_conn']='0'; //用户注册客户端数量限制,0为不限制
$System_Config['user_speedlimit']='0'; //用户注册速度默认限制,0为不限制
$System_Config['reg_auto_reset_day']='0'; //注册时的流量重置日
$System_Config['reg_auto_reset_bandwidth']='0'; //需要重置的流量,0不重置
$System_Config['ramdom_group']='0'; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。
$System_Config['reg_method']='rc4-md5'; //注册时默认加密方式
$System_Config['reg_protocol']='origin'; //注册时默认协议
$System_Config['reg_protocol_param']=''; //注册时默认协议参数
$System_Config['reg_obfs']='plain'; //注册时默认混淆方式
$System_Config['reg_obfs_param']=''; //注册时默认混淆参数
$System_Config['reg_forbidden_ip']='127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割
$System_Config['min_port']='10000'; //用户端口池最小值
$System_Config['max_port']='65535'; //用户端口池最大值
$System_Config['reg_forbidden_port']=''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段
$System_Config['mu_suffix']='microsoft.com'; //单端口多用户混淆参数后缀
$System_Config['mu_regex']='%5m%id.%suffix'; //单端口多用户混淆参数表达式,%5m代表取用户特征 md5 的前五位,%id 代表用户id,%suffix 代表上面这个后缀。
//邀请链接
$System_Config['enable_invite_code']='false'; //是否强制开启邀请,为true则注册必须使用邀请链接 且 邀请人等级为0时邀请链接不可用
$System_Config['inviteNum'] = '10'; // 注册后的邀请链接可用次数
$System_Config['invite_get_money']='1'; //新用户通过私人邀请链接注册,获得奖励金额(鼓励消费)
//邮箱验证
$System_Config['enable_email_verify']='true'; //是否启用注册邮箱验证码
$System_Config['email_verify_ttl']='3600'; //邮箱验证码有效期
$System_Config['email_verify_iplimit']='10'; //单IP可请求验证码次数(上面那个周期内)
//已注册用户设置------------------------------------------------------------------
$System_Config['checkinMin'] = '1'; //用户签到签到最少流量 单位MB
$System_Config['checkinMax'] = '50'; //用户签到签到最多流量
$System_Config['code_payback']='20'; //充值返利百分比
$System_Config['invite_gift']='2'; //邀请新用户获得流量奖励,单位G
$System_Config['enable_donate']='false'; //是否开启用户捐赠功能
$System_Config['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定
$System_Config['enable_class_expire_reset']='true'; //等级到期时是否重置流量
$System_Config['enable_class_expire_reset_traffic']='0'; //等级到期时重置为的流量值,GB
$System_Config['enable_account_expire_reset']='false'; //账户到期时是否重置流量
$System_Config['enable_account_expire_reset_traffic']='0'; //账户到期时重置为的流量值,GB
$System_Config['enable_bought_reset']='false'; //购买时是否重置流量
$System_Config['enable_account_expire_delete']='false'; //账户到期之后是否会删除账户
$System_Config['enable_account_expire_delete_days']='0'; //账户到期几天之后会删除账户
$System_Config['enable_auto_clean_uncheck']='false'; //没签到的0级用户自动清理开关
$System_Config['enable_auto_clean_uncheck_days']='7'; //自动清理多少天没签到的0级用户
$System_Config['auto_clean_min_money']='1'; //自动清理时余额低于多少的0级用户会被清理(int变量 不要写小数)
$System_Config['enable_auto_clean_unused']='false'; //未使用的0级用户自动清理开关
$System_Config['enable_auto_clean_unused_days']='30'; //自动清理多少天没使用的0级用户
$System_Config['enable_kill']='true'; //是否允许用户注销账户
//Telegram bot设置--------------------------------------------------------------
$System_Config['enable_telegram']='false'; //是否开启Telegram bot
$System_Config['telegram_token']=''; //Telegram bot,bot 的 token ,跟 father bot 申请
$System_Config['telegram_chatid']=''; //Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。
$System_Config['enable_tuling']='false'; //是否开启图灵机器人
$System_Config['tuling_apikey']=''; //图灵机器人API Key
$System_Config['tuling_apisecert']=''; //图灵机器人密钥
$System_Config['telegram_bot']='_bot'; //Telegram 机器人账号
$System_Config['telegram_group_quiet']='false'; //Telegram 机器人在群组中不回应
$System_Config['telegram_qrcode']='zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local
$System_Config['telegram_request_token']=''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成
//复杂一些,用于校验请求,更新这个参数之后请 php xcat setTelegram
//客服系统设置--------------------------------------------------------------------
//注册地址 https://crisp.chat/
$System_Config['enable_crisp']='false'; //是否开启客服系统
$System_Config['crisp_id']='null'; //客服系统ID ID查看路径:crisp.chat-->设置-->设置网站-->显示整合性-->html
//验证码设置---------------------------------------------------------------------
//自己去 Geetest.com 申请
$System_Config['geetest_id']='';
$System_Config['geetest_key']='';
$System_Config['enable_geetest_reg']='false'; //启用注册验证码
$System_Config['enable_geetest_login']='false'; //启用登录验证码
$System_Config['enable_geetest_checkin']='false'; //启用签到验证码
//支付系统设置--------------------------------------------------------------------
#取值 codepay,doiampay,paymentwall,zfbjk,spay,f2fpay,yftpay,none,f2fpay_codepay
//备份设置--------------------------------------------------------------------------------------------
$System_Config['auto_backup_email']=''; //接收备份的邮箱
$System_Config['auto_backup_passwd']=''; //备份的压缩密码
//用户注册设置-----------------------------------------------------------------------------------------
$System_Config['register_mode'] = 'open'; //注册模式。close:关闭,open:开放,invite:仅限邀请码
$System_Config['defaultTraffic'] = '1'; //用户初始流量 单位GB
$System_Config['user_expire_in_default']='3650'; //用户账户过期时间,在注册时设置。(天)
$System_Config['user_class_default']='0'; //用户注册等级,在注册时设置。
$System_Config['user_class_expire_default']='24'; //用户等级过期时间,在注册时设置。(小时)
$System_Config['user_conn']='0'; //用户注册客户端数量限制,0为不限制
$System_Config['user_speedlimit']='0'; //用户注册速度默认限制,0为不限制
$System_Config['reg_auto_reset_day']='0'; //注册时的流量重置日,0为不重置
$System_Config['reg_auto_reset_bandwidth']='0'; //需要重置的流量,0为不重置
$System_Config['ramdom_group']='0'; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。
$System_Config['reg_method']='rc4-md5'; //注册时默认加密方式
$System_Config['reg_protocol']='origin'; //注册时默认协议
$System_Config['reg_protocol_param']=''; //注册时默认协议参数
$System_Config['reg_obfs']='plain'; //注册时默认混淆方式
$System_Config['reg_obfs_param']=''; //注册时默认混淆参数
$System_Config['reg_forbidden_ip']='127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割
$System_Config['min_port']='10000'; //用户端口池最小值
$System_Config['max_port']='65535'; //用户端口池最大值
$System_Config['reg_forbidden_port']=''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段
$System_Config['mu_suffix']='microsoft.com'; //单端口多用户混淆参数后缀,可以随意修改,但请保持前后端一致
$System_Config['mu_regex']='%5m%id.%suffix'; //单端口多用户混淆参数表达式,%5m代表取用户特征 md5 的前五位,%id 代表用户id,%suffix 代表上面这个后缀。
#邀请链接
$System_Config['inviteNum'] = '10'; //注册后的邀请链接可用次数
$System_Config['invite_get_money']='1'; //新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
$System_Config['invite_price']='-1'; //用户购买邀请码所需要的价格,价格小于0时视为不开放购买
$System_Config['custom_invite_price']='-1'; //用户定制邀请码所需要的价格,价格小于0时视为不开放购买
#邮箱验证
$System_Config['enable_email_verify']='false'; //是否启用注册邮箱验证码
$System_Config['email_verify_ttl']='3600'; //邮箱验证码有效期
$System_Config['email_verify_iplimit']='10'; //验证码有效期内,单IP可请求验证码次数
//已注册用户设置---------------------------------------------------------------------------------------
#基础
$System_Config['checkinMin'] = '1'; //用户签到最少流量 单位MB
$System_Config['checkinMax'] = '50'; //用户签到最多流量
$System_Config['auto_clean_uncheck_days']='-1'; //自动清理多少天没签到的0级用户,小于等于0时关闭
$System_Config['auto_clean_unused_days']='-1'; //自动清理多少天没使用的0级用户,小于等于0时关闭
$System_Config['auto_clean_min_money']='1'; //余额低于多少的0级用户可以被清理
$System_Config['code_payback']='20'; //充值返利百分比
$System_Config['invite_gift']='2'; //邀请新用户获得流量奖励,单位G
$System_Config['enable_bought_reset']='true'; //购买时是否重置流量
$System_Config['port_price']='-1'; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买
$System_Config['port_price_specify']='-1'; //用户指明钦定端口所需要的价格,价格小于0时视为不开放购买
#高级
$System_Config['class_expire_reset_traffic']='0'; //等级到期时重置为的流量值,单位GB,小于0时不重置
$System_Config['account_expire_delete_days']='-1'; //账户到期几天之后会删除账户,小于0时不删除
$System_Config['enable_kill']='true'; //是否允许用户注销账户
$System_Config['notify_limit_mode'] = 'false'; //false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
$System_Config['notify_limit_value'] = '20'; //当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
$System_Config['mergeSub'] = false; //合并订阅设置 可选项 false / true
//Telegram bot设置------------------------------------------------------------------------------------
$System_Config['enable_telegram']='false'; //是否开启Telegram bot
$System_Config['telegram_token']=''; //Telegram bot,bot 的 token ,跟 father bot 申请
$System_Config['telegram_chatid']=''; //Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。
$System_Config['enable_tuling']='false'; //是否开启图灵机器人
$System_Config['tuling_apikey']=''; //图灵机器人API Key
$System_Config['tuling_apisecert']=''; //图灵机器人密钥
$System_Config['telegram_bot']='_bot'; //Telegram 机器人账号
$System_Config['telegram_group_quiet']='false'; //Telegram 机器人在群组中不回应
$System_Config['telegram_qrcode']='zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local
$System_Config['telegram_request_token']=''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram
$System_Config['enable_welcome_message']='true'; //机器人发送欢迎消息
$System_Config['finance_public']='false'; //财务报告是否向Telegram群公开
$System_Config['telegram_grouplink']=''; //telegram群邀请链接
//沟通设置--------------------------------------------------------------------------------------------
#客服系统设置,注册地址 https://crisp.chat/
$System_Config['enable_crisp']='false'; //是否开启客服系统
$System_Config['crisp_id']='null'; //客服系统ID ID查看路径:crisp.chat-->设置-->网站设置-->显示整合-->html
#工单系统设置
$System_Config['enable_ticket']='true'; //是否开启工单系统
#管理员联系方式设置
$System_Config['enable_admin_contact']='false'; //是否开启管理员联系方式
$System_Config['admin_contact1'] = 'QQ:1233456'; //QQ、邮箱、微信仅用于举例
$System_Config['admin_contact2'] = '邮箱123456@qq.com'; //也可以写电话、tg等其他联系方式
$System_Config['admin_contact3'] = '微信~123456'; //没有格式要求,想怎么写就怎么写,可留空
//验证码设置------------------------------------------------------------------------------------------
$System_Config['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验)
$System_Config['recaptcha_sitekey'] = '';
$System_Config['recaptcha_secret'] = '';
$System_Config['geetest_id'] = '';
$System_Config['geetest_key'] = '';
$System_Config['enable_reg_captcha'] = 'false'; //启用注册验证码
$System_Config['enable_login_captcha'] = 'false'; //启用登录验证码
$System_Config['enable_checkin_captcha'] = 'false'; //启用签到验证码
//支付系统设置----------------------------------------------------------------------------------------
#取值 none | codepay | trimepay | f2fpay | yftpay | chenAlipay | paymentwall | spay
$System_Config['payment_system']='none';
#codepay码支付
#wiki地址:https://goo.gl/dRwRDi http://t.cn/RnsWjtB
$System_Config['codepay_id']=''; //码支付ID
$System_Config['codepay_key']=''; //码支付通信密钥
#doiampay,https://www.daimiyun.cn/register.php?aff=624
$System_Config['doiampay']=[
'enabled' => [
'wepay'=>1, // 微信支付1 启用 0 关闭
'alipay'=>1, // 支付宝1 启用 0 关闭
'qqpay'=>1, // QQ支付1 启用 0 关闭
],
'mchdata' => [
'wepay'=>[
'mchid' => 188888888, // 商户号
'phone' => 18888888888, //手机号
'token' => "example" // 安全验证码
],
'alipay'=>[
'mchid' => 188888888, // 商户号
'phone' => 188888888, //手机号
'token' => "188888888" // 安全验证码
],
'qqpay'=>[
'mchid' => 188888888, // 商户号
'phone' => 188888888, //手机号
'token' => "188888888" // 安全验证码
],
]
];
$System_Config['codepay_id']=''; //码支付ID
$System_Config['codepay_key']=''; //码支付通信密钥
#alipay,f2fpay
$System_Config['f2fpay_app_id']='';
@ -183,6 +188,7 @@ $System_Config['pmw_height']='350px';
#alipay,spay
$System_Config['alipay_id']='';
$System_Config['alipay_key']='';
$System_Config['amount']=[2,23,233,2333,23333]; //充值金额选项设定
#yftpay,https://pay.anypay.me/
$System_Config['yft_secret']='';
@ -193,35 +199,71 @@ $System_Config['zfbjk_pid']='';
$System_Config['zfbjk_key']='';
$System_Config['zfbjk_qrcodeurl']='';
#充值金额选项设定//f2fpay和spay可用
$System_Config['amount']=[2,23,233,2333,23333];
#Trimepay https://portal.trimepay.com/#/auth/register/134
$System_Config['trimepay_appid']=''; //AppID
$System_Config['trimepay_secret']=''; //AppSecret
//其他面板显示设置------------------------------------------------------------------------------------------
#后台商品列表 销量统计
$System_Config['sales_period']='30'; //统计指定周期内的销量,值为【expire/任意大于0的整数】
#国旗
$System_Config['enable_flag']='false'; //启用该项之前务必先仔细阅读教程
$System_Config['flag_regex']='/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版)
#捐赠
$System_Config['enable_donate']='false'; //是否显示用户捐赠(所有收入将被公开)
#iOS账户显示
$System_Config['display_ios_class']='-1'; //至少等级为多少的用户可以看见,小于0时关闭此功能
$System_Config['ios_account']=''; //iOS账户
$System_Config['ios_password']=''; //iOS密码
//节点检测-----------------------------------------------------------------------------------------------
#GFW检测,请通过crontab进行【开启/关闭】
$System_Config['detect_gfw_interval']='3600'; //检测间隔,单位:秒,低于推荐值会爆炸
$System_Config['detect_gfw_port']='22'; //所有节点服务器都打开的TCP端口,常用的为22(SSH端口)
$System_Config['detect_gfw_url']='https://cn-qz-tcping.torch.njs.app/{ip}/{port}'; //检测节点是否被gfw墙了的API的URL
$System_Config['detect_gfw_judge']='$json_tcping[\'status\']=="true"'; //判断是否被墙的依据,json_tcping为上方URL返回的json数组
$System_Config['detect_gfw_count']='3'; //尝试次数
#离线检测
$System_Config['enable_detect_offline']='true';
//杂项(一般不需要更改-------------------------------------------------------------
$System_Config['authDriver'] = 'cookie'; //不能更改此项
$System_Config['salt'] = ''; // 密码加密用,请留空
$System_Config['sessionDriver'] = 'cookie'; // 可选: cookie,redis
$System_Config['cacheDriver'] = 'cookie'; // 可选: cookie,redis
$System_Config['tokenDriver'] = 'db'; // 可选: db,redis
$System_Config['jump_delay']='1200'; //跳转延时,ms 1000ms=1s 不建议太长
$System_Config['theme'] = 'material'; // 主题
$System_Config['pacp_offset']='-20000'; //VPN 端口偏移
//V2Ray相关设置------------------------------------------------------------------------------------------
$System_Config['v2ray_port']='443'; //V2Ray端口
$System_Config['v2ray_protocol']='HTTP/2 + TLS'; //V2Ray协议
$System_Config['v2ray_alter_id']='32';
$System_Config['v2ray_level']='0';
//以下所有均为高级设置(一般用不上,不用改---------------------------------------------------------------------
#杂项
$System_Config['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定
$System_Config['authDriver'] = 'cookie'; //不能更改此项
$System_Config['salt'] = ''; //密码加密用,请留空
$System_Config['sessionDriver'] = 'cookie'; //可选: cookie,redis
$System_Config['cacheDriver'] = 'cookie'; //可选: cookie,redis
$System_Config['tokenDriver'] = 'db'; //可选: db,redis
$System_Config['jump_delay']='1200'; //跳转延时,单位ms,不建议太长
$System_Config['theme'] = 'material'; //主题
$System_Config['pacp_offset']='-20000'; //VPN 端口偏移
$System_Config['pacpp_offset']='-20000';
$System_Config['Speedtest_duration']='6'; //显示多长时间的测速记录
$System_Config['node_offline_warn']='true'; //节点离线设置
$System_Config['login_warn']='false'; //异地登陆提示
$System_Config['timeZone'] = 'PRC'; // PRC 天朝时间 UTC 格林时间
$System_Config['pwdMethod'] = 'sha256'; // 密码加密 可选 md5,sha256
$System_Config['Speedtest_duration']='6'; //显示多长时间的测速记录
$System_Config['login_warn']='false'; //异地登陆提示
$System_Config['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间
$System_Config['pwdMethod'] = 'sha256'; //密码加密 可选 md5,sha256,argon2i(argon2i需要至少php7.2)
$System_Config['db_charset'] = 'utf8';
$System_Config['db_collation'] = 'utf8_general_ci';
$System_Config['db_prefix'] = '';
# aws
#aws
$System_Config['aws_access_key_id'] = '';
$System_Config['aws_secret_access_key'] = '';
# redis
#redis
$System_Config['redis_scheme'] = 'tcp';
$System_Config['redis_host'] = '127.0.0.1';
$System_Config['redis_port'] = '6379';
@ -229,53 +271,33 @@ $System_Config['redis_database'] = '0';
$System_Config['redis_password']="";
#Radius设置
$System_Config['enable_radius']='false'; //是否开启Radius
$System_Config['radius_db_host']=''; //以下4项为Radius数据库设置
$System_Config['enable_radius']='false'; //是否开启Radius
$System_Config['radius_db_host']=''; //以下4项为Radius数据库设置
$System_Config['radius_db_database']='';
$System_Config['radius_db_user']='';
$System_Config['radius_db_password']='';
$System_Config['radius_secret']=''; //Radius连接密钥
#多说设置
$System_Config['enable_duoshuo']='false'; //是否开启多说
$System_Config['duoshuo_shortname']="";
$System_Config['duoshuo_apptoken']="";
#Wecenter设置
$System_Config['enable_wecenter']='false'; //是否开启Wecenter
$System_Config['wecenter_db_host']='localhost'; //以下4项为Wecenter数据库设置
$System_Config['wecenter_db_database']='';
$System_Config['wecenter_db_user']='';
$System_Config['wecenter_db_password']='';
$System_Config['wecenter_system_main_domain']=''; //系统根域名 zhaoj.in 这样
$System_Config['wecenter_cookie_prefix']='mmg_'; //G_COOKIE_PREFIX
$System_Config['wecenter_cookie_key']=''; //G_COOKIE_HASH_KEY
$System_Config['wecenter_url']=''; //访问路径,不开启这个功能的话就清空这个设置项吧
//可从安装好的 wecenter 目录下的 system/config.inc.php 得到
$System_Config['radius_secret']=''; //Radius连接密钥
#Cloudxns
$System_Config['enable_cloudxns']='false'; //是否开启Cloudxns
$System_Config['cloudxns_apikey']=''; //自己去 cloudxns.net 申请
$System_Config['enable_cloudxns']='false'; //是否开启Cloudxns
$System_Config['cloudxns_apikey']=''; //自己去 cloudxns.net 申请
$System_Config['cloudxns_apisecret']='';
$System_Config['cloudxns_domain']='zhaoj.in'; //你的域名
$System_Config['cloudxns_domain']='zhaoj.in'; //你的域名
#不安全中转模式,这个开启之后使用除了 auth_aes128_md5 或者 auth_aes128_sha1 以外的协议地用户也可以设置和使用中转,但是,强烈推荐不开启。
$System_Config['relay_insecure_mode']='false';//默认关闭不安全中转
#Cloudflare
$System_Config['cloudflare_enable']='false'; //是否开启 Cloudflare 解析
$System_Config['cloudflare_email']='user@example.com'; //Cloudflare 邮箱地址
$System_Config['cloudflare_key']='c2547eb745079dac9320b638f5e225cf483cc5cfdda41'; //Cloudflare API Key
$System_Config['cloudflare_name']='example.com'; //域名
#不安全中转模式,这个开启之后使用除了 auth_aes128_md5 或者 auth_aes128_sha1 以外的协议地用户也可以设置和使用中转
$System_Config['relay_insecure_mode']='false'; //强烈推荐不开启
#是否夹带统计代码,自己在 resources/views/{主题名} 下创建一个 analytics.tpl ,如果有必要就用 literal 界定符
$System_Config['enable_analytics_code']='false';
$System_Config['v2ray_port']='443';
$System_Config['v2ray_protocol']='HTTP/2 + TLS';
$System_Config['v2ray_alter_id']='32';
$System_Config['v2ray_level']='0';
#在套了CDN之后获取用户真实ip,如果您不知道这是什么,请不要乱动
if ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ) {
$list = explode("," , $_SERVER["HTTP_X_FORWARDED_FOR"]);
$_SERVER["REMOTE_ADDR"] = $list[0];
}

@ -2,7 +2,7 @@
use Slim\App;
use Slim\Container;
use App\Controllers;
//use App\Controllers;
use App\Middleware\Auth;
use App\Middleware\Guest;
use App\Middleware\Admin;
@ -54,7 +54,7 @@ $container['notAllowedHandler'] = function ($c) {
};
};
if ($debug==false) {
if ($debug == false) {
$container['errorHandler'] = function ($c) {
return function ($request, $response, $exception) use ($c) {
return $response->withAddedHeader('Location', '/500');
@ -71,19 +71,11 @@ $app->get('/', 'App\Controllers\HomeController:index');
$app->get('/404', 'App\Controllers\HomeController:page404');
$app->get('/405', 'App\Controllers\HomeController:page405');
$app->get('/500', 'App\Controllers\HomeController:page500');
$app->get('/pwm_pingback', 'App\Controllers\HomeController:pay_callback');
$app->post('/notify', 'App\Controllers\HomeController:notify');
$app->post('/alipay_callback', 'App\Controllers\HomeController:pay_callback');
$app->post('/pay_callback', 'App\Controllers\HomeController:f2fpay_pay_callback');
$app->get('/pay_callback', 'App\Controllers\HomeController:pay_callback');
$app->get('/yft/notify', 'App\Services\Gateway\YftPay:notify');//yft uses GET
$app->get('/tos', 'App\Controllers\HomeController:tos');
$app->get('/staff', 'App\Controllers\HomeController:staff');
$app->get('/gfwlistjs', 'App\Controllers\LinkController:GetGfwlistJs');
$app->post('/telegram_callback', 'App\Controllers\HomeController:telegram');
$app->get('/yft/notify','App\Controllers\YFTPayCallBackController:yft_notify');
$app->get('/codepay_callback', 'App\Controllers\HomeController:codepay_callback');
$app->post('/codepay_callback', 'App\Controllers\HomeController:codepay_pay_callback');
// User Center
$app->group('/user', function () {
@ -122,8 +114,9 @@ $app->group('/user', function () {
$this->post('/ticket', 'App\Controllers\UserController:ticket_add');
$this->get('/ticket/{id}/view', 'App\Controllers\UserController:ticket_view');
$this->put('/ticket/{id}', 'App\Controllers\UserController:ticket_update');
$this->post('/invite', 'App\Controllers\UserController:doInvite');
$this->post('/buy_invite', 'App\Controllers\UserController:buyInvite');
$this->post('/custom_invite', 'App\Controllers\UserController:customInvite');
$this->get('/edit', 'App\Controllers\UserController:edit');
$this->post('/password', 'App\Controllers\UserController:updatePassword');
$this->post('/wechat', 'App\Controllers\UserController:updateWechat');
@ -138,17 +131,17 @@ $app->group('/user', function () {
$this->get('/kill', 'App\Controllers\UserController:kill');
$this->post('/kill', 'App\Controllers\UserController:handleKill');
$this->get('/logout', 'App\Controllers\UserController:logout');
$this->get('/backtoadmin', 'App\Controllers\UserController:backtoadmin');
$this->get('/code', 'App\Controllers\UserController:code');
//易付通路由定义 start
$this->post('/code/yft/pay', 'App\Controllers\YftPay:yftPay');
$this->get('/code/yft/pay/result', 'App\Controllers\YftPay:yftPayResult');
$this->post('/code/yft', 'App\Controllers\YftPay:yft');
$this->get('/yftOrder','App\Controllers\YftPay:yftOrder');
//易付通路由定义 end
//易付通路由定义 start
$this->post('/code/yft/pay', 'App\Services\Gateway\YftPay:yftPay');
$this->get('/code/yft/pay/result', 'App\Services\Gateway\YftPay:notify');
$this->post('/code/yft', 'App\Services\Gateway\YftPay:yft');
$this->get('/yftOrder', 'App\Services\Gateway\YftPay:yftOrder');
//易付通路由定义 end
$this->get('/alipay', 'App\Controllers\UserController:alipay');
$this->post('/code/f2fpay', 'App\Controllers\UserController:f2fpay');
$this->get('/code/f2fpay', 'App\Controllers\UserController:f2fpayget');
$this->get('/code/codepay', 'App\Controllers\UserController:codepay');
$this->post('/code/f2fpay', 'App\Services\Payment:purchase');
$this->get('/code/codepay', 'App\Services\Payment:purchase');
$this->get('/code_check', 'App\Controllers\UserController:code_check');
$this->post('/code', 'App\Controllers\UserController:codepost');
$this->post('/gacheck', 'App\Controllers\UserController:GaCheck');
@ -156,6 +149,7 @@ $app->group('/user', function () {
$this->get('/gareset', 'App\Controllers\UserController:GaReset');
$this->get('/telegram_reset', 'App\Controllers\UserController:telegram_reset');
$this->post('/resetport', 'App\Controllers\UserController:ResetPort');
$this->post('/specifyport', 'App\Controllers\UserController:SpecifyPort');
$this->post('/pacset', 'App\Controllers\UserController:PacSet');
$this->get('/getpcconf', 'App\Controllers\UserController:GetPcConf');
$this->get('/getiosconf', 'App\Controllers\UserController:GetIosConf');
@ -164,8 +158,20 @@ $app->group('/user', function () {
$this->delete('/bought', 'App\Controllers\UserController:deleteBoughtGet');
$this->get('/url_reset', 'App\Controllers\UserController:resetURL');
$this->get('/inviteurl_reset', 'App\Controllers\UserController:resetInviteURL');
//Reconstructed Payment System
$this->post('/payment/purchase', 'App\Services\Payment:purchase');
$this->get('/payment/return', 'App\Services\Payment:returnHTML');
})->add(new Auth());
$app->group('/payment', function () {
$this->post('/notify', 'App\Services\Payment:notify');
$this->post('/notify/{type}', 'App\Services\Payment:notify');
$this->post('/status', 'App\Services\Payment:getStatus');
});
// Auth
$app->group('/auth', function () {
$this->get('/login', 'App\Controllers\AuthController:login');
@ -176,6 +182,7 @@ $app->group('/auth', function () {
$this->post('/register', 'App\Controllers\AuthController:registerHandle');
$this->post('/send', 'App\Controllers\AuthController:sendVerify');
$this->get('/logout', 'App\Controllers\AuthController:logout');
$this->get('/telegram_oauth', 'App\Controllers\AuthController:telegram_oauth');
})->add(new Guest());
// Password
@ -190,6 +197,7 @@ $app->group('/password', function () {
$app->group('/admin', function () {
$this->get('', 'App\Controllers\AdminController:index');
$this->get('/', 'App\Controllers\AdminController:index');
$this->get('/trafficlog', 'App\Controllers\AdminController:trafficLog');
$this->post('/trafficlog/ajax', 'App\Controllers\AdminController:ajax_trafficLog');
// Node Mange
@ -282,7 +290,8 @@ $app->group('/admin', function () {
$this->get('/user/{id}/edit', 'App\Controllers\Admin\UserController:edit');
$this->put('/user/{id}', 'App\Controllers\Admin\UserController:update');
$this->delete('/user', 'App\Controllers\Admin\UserController:delete');
$this->get('/user/ajax', 'App\Controllers\Admin\UserController:ajax');
$this->post('/user/changetouser', 'App\Controllers\Admin\UserController:changetouser');
$this->post('/user/ajax', 'App\Controllers\Admin\UserController:ajax');
$this->get('/coupon', 'App\Controllers\AdminController:coupon');
@ -295,7 +304,7 @@ $app->group('/admin', function () {
$this->get('/sys', 'App\Controllers\AdminController:sys');
$this->get('/logout', 'App\Controllers\AdminController:logout');
$this->post('/payback/ajax', 'App\Controllers\AdminController:ajax_payback');
$this->get('/yftOrder','App\Controllers\YftPay:yftOrderForAdmin');
$this->get('/yftOrder', 'App\Services\Gateway\YftPay:yftOrderForAdmin');
})->add(new Admin());
// API
@ -304,6 +313,7 @@ $app->group('/api', function () {
$this->post('/token', 'App\Controllers\ApiController:newToken');
$this->get('/node', 'App\Controllers\ApiController:node')->add(new Api());
$this->get('/user/{id}', 'App\Controllers\ApiController:userInfo')->add(new Api());
$this->get('/sublink','App\Controllers\Client\ClientApiController:GetSubLink');
});
// mu
@ -348,16 +358,30 @@ $app->group('/link', function () {
$this->get('/{token}', 'App\Controllers\LinkController:GetContent');
});
$app->group('/user',function(){
$this->post("/doiam","App\Utils\DoiAMPay:handle");
$app->group('/user', function () {
$this->post("/doiam", "App\Services\Payment:purchase");
})->add(new Auth());
$app->group("/doiam",function(){
$this->post("/callback/{type}","App\Utils\DoiAMPay:handle_callback");
$this->get("/return/alipay","App\Utils\DoiAMPay:handle_return");
$this->post("/status","App\Utils\DoiAMPay:status");
$app->group("/doiam", function () {
$this->post("/callback/{type}", "App\Services\Payment:notify");
$this->get("/return/alipay", "App\Services\Payment:returnHTML");
$this->post("/status", "App\Services\Payment:getStatus");
});
/**
* chenPay
*/
$app->group('/user', function () {
$this->get("/chenPay", "App\Services\Payment:purchase");
$this->get('/orderDelete', 'App\Controllers\UserController:orderDelete');
})->add(new Auth());
$app->group("/chenPay", function () {
$this->get("/status", "App\Services\Payment:getStatus");
});
$app->group('/admin', function () {
$this->get('/editConfig', 'App\Controllers\AdminController:editConfig');
$this->post('/saveConfig', 'App\Controllers\AdminController:saveConfig');
})->add(new Admin());
// chenPay end
// Run Slim Routes for App
$app->run();

@ -9,10 +9,10 @@
<link rel="bookmark" href="/favicon.ico" type="image/x-icon"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<link rel="shortcut icon" type="image/ico" href="images/ssr.ico">
<link rel="stylesheet" href="assets/css/main.css" />
<link rel="stylesheet" href="/assets/css/main.css" />
<noscript>
<link rel="stylesheet" href="assets/css/noscript.css" />
<link rel="stylesheet" href="/assets/css/noscript.css" />
</noscript>
</head>
<body>
@ -33,8 +33,8 @@
<footer id="footer"><p class="copyright">&copy;2015-2017 网站名称</p></footer>
</div>
<div id="bg"></div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body></html>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.11.3"></script>
<script src="https://cdn.jsdelivr.net/gh/ajlkn/skel@3.0.1/dist/skel.min.js"></script>
<script src="/assets/js/util.js"></script>
<script src="/assets/js/main.js"></script>
</body></html>

@ -1,4 +1,4 @@
@import url(font-awesome.min.css);
@import url(https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css);
@import url(mikufont.css);
/*
Dimension by HTML5 UP

@ -4,13 +4,13 @@
font-family: 'Source Sans Pro';
font-style: italic;
font-weight: 300;
src: url('/assets/fonts/source-sans-pro-300italic.eot'); /* IE9 Compat Modes */
src: url('../fonts/source-sans-pro-300italic.eot'); /* IE9 Compat Modes */
src: local('Source Sans Pro'), local('SourceSans Pro-Italic'),
url('/assets/fonts/source-sans-pro-300italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/source-sans-pro-300italic.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/source-sans-pro-300italic.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/source-sans-pro-300italic.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/source-sans-pro-300italic.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
url('../fonts/source-sans-pro-300italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/source-sans-pro-300italic.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/source-sans-pro-300italic.woff') format('woff'), /* Modern Browsers */
url('../fonts/source-sans-pro-300italic.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/source-sans-pro-300italic.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
}
/* source-sans-pro-600italic */
@ -18,13 +18,13 @@
font-family: 'Source Sans Pro';
font-style: italic;
font-weight: 600;
src: url('/assets/fonts/source-sans-pro-600italic.eot'); /* IE9 Compat Modes */
src: url('../fonts/source-sans-pro-600italic.eot'); /* IE9 Compat Modes */
src: local('Source Sans Pro'), local('SourceSans Pro-Italic'),
url('/assets/fonts/source-sans-pro-600italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/source-sans-pro-600italic.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/source-sans-pro-600italic.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/source-sans-pro-600italic.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/source-sans-pro-600italic.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
url('../fonts/source-sans-pro-600italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/source-sans-pro-600italic.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/source-sans-pro-600italic.woff') format('woff'), /* Modern Browsers */
url('../fonts/source-sans-pro-600italic.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/source-sans-pro-600italic.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
}
/* source-sans-pro-300 */
@ -32,13 +32,13 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: url('/assets/fonts/source-sans-pro-300.eot'); /* IE9 Compat Modes */
src: url('../fonts/source-sans-pro-300.eot'); /* IE9 Compat Modes */
src: local('Source Sans Pro'), local('SourceSans Pro-Normal'),
url('/assets/fonts/source-sans-pro-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/source-sans-pro-300.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/source-sans-pro-300.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/source-sans-pro-300.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/source-sans-pro-300.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
url('../fonts/source-sans-pro-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/source-sans-pro-300.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/source-sans-pro-300.woff') format('woff'), /* Modern Browsers */
url('../fonts/source-sans-pro-300.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/source-sans-pro-300.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
}
/* source-sans-pro-600 */
@ -46,12 +46,12 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 600;
src: url('/assets/fonts/source-sans-pro-600.eot'); /* IE9 Compat Modes */
src: url('../fonts/source-sans-pro-600.eot'); /* IE9 Compat Modes */
src: local('Source Sans Pro'), local('SourceSans Pro-Normal'),
url('/assets/fonts/source-sans-pro-600.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/source-sans-pro-600.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/source-sans-pro-600.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/source-sans-pro-600.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/source-sans-pro-600.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
url('../fonts/source-sans-pro-600.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/source-sans-pro-600.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/source-sans-pro-600.woff') format('woff'), /* Modern Browsers */
url('../fonts/source-sans-pro-600.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/source-sans-pro-600.svg#SourceSans Pro') format('svg'); /* Legacy iOS */
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

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

Loading…
Cancel
Save