diff --git a/README.md b/README.md index 2d334d32..99584acd 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ SSPanel UIM 支持安装在 LNMP、宝塔面板、Plesk 面板、oneinstack 等 ``` 账号:admin 密码:admin -mukey=NimaQu +mukey ShirakamiFubuki ``` ## 文档 @@ -166,9 +166,7 @@ SSPanel UIM 离不开所有 [贡献代码](https://github.com/Anankke/SSPanel-Ui #### 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) +- [hkserversolution-推荐UIM面板服务器放置](https://www.hkserversolution.com/aff.php?aff=60) #### laurieryayoi diff --git a/app/Command/Update.php b/app/Command/Update.php index 331bd8ac..513439ad 100644 --- a/app/Command/Update.php +++ b/app/Command/Update.php @@ -8,7 +8,7 @@ class Update { public static function update($xcat) { - global $System_Config; + global $_ENV; $copy_result = copy(BASE_PATH . '/config/.config.php', BASE_PATH . '/config/.config.php.bak'); if ($copy_result == true) { echo('备份成功' . PHP_EOL); @@ -33,17 +33,17 @@ class Update $config_new = file_get_contents(BASE_PATH . '/config/.config.example.php'); //执行版本升级 - $version_old = $System_Config['version'] ?? 0; + $version_old = $_ENV['version'] ?? 0; self::old_to_new($version_old); //将旧config迁移到新config上 $migrated = array(); - foreach ($System_Config as $key => $value_reserve) { + foreach ($_ENV as $key => $value_reserve) { if ($key == 'config_migrate_notice' || $key == 'version') { continue; } - $regex = '/System_Config\[\'' . $key . '\'\].*?;/s'; + $regex = '/_ENV\[\'' . $key . '\'\].*?;/s'; $matches_new = array(); preg_match($regex, $config_new, $matches_new); if (isset($matches_new[0]) == false) { @@ -55,18 +55,18 @@ class Update preg_match($regex, $config_old, $matches_old); $config_new = str_replace($matches_new[0], $matches_old[0], $config_new); - $migrated[] = 'System_Config[\'' . $key . '\']'; + $migrated[] = '_ENV[\'' . $key . '\']'; } echo(PHP_EOL); //检查新增了哪些config - $regex_new = '/System_Config\[\'.*?\'\]/s'; + $regex_new = '/_ENV\[\'.*?\'\]/s'; $matches_new_all = array(); preg_match_all($regex_new, $config_new, $matches_new_all); $differences = array_diff($matches_new_all[0], $migrated); foreach ($differences as $difference) { - if ($difference == 'System_Config[\'config_migrate_notice\']' || - $difference == 'System_Config[\'version\']') { + if ($difference == '_ENV[\'config_migrate_notice\']' || + $difference == '_ENV[\'version\']') { continue; } //匹配注释 @@ -95,7 +95,7 @@ class Update echo('新增配置项通常带有默认值,因此通常即使不作任何改动网站也可以正常运行' . PHP_EOL); //输出notice - $regex_notice = '/System_Config\[\'config_migrate_notice\'\].*?(?=\';)/s'; + $regex_notice = '/_ENV\[\'config_migrate_notice\'\].*?(?=\';)/s'; $matches_notice = array(); preg_match($regex_notice, $config_new, $matches_notice); $notice_new = $matches_notice[0]; @@ -108,8 +108,8 @@ class Update ) + 1 ); echo('以下是迁移附注:'); - if (isset($System_Config['config_migrate_notice'])) { - if ($System_Config['config_migrate_notice'] != $notice_new) { + if (isset($_ENV['config_migrate_notice'])) { + if ($_ENV['config_migrate_notice'] != $notice_new) { echo($notice_new); } } else { diff --git a/app/Controllers/AdminController.php b/app/Controllers/AdminController.php index 586e2a90..9c2cfb5a 100644 --- a/app/Controllers/AdminController.php +++ b/app/Controllers/AdminController.php @@ -60,6 +60,33 @@ class AdminController extends UserController return $this->view()->assign('table_config', $table_config)->display('admin/invite.tpl'); } + public function chgInvite($request, $response, $args) + { + $prefix = $request->getParam('prefix'); + + if ($request->getParam('userid')!=NULL && $request->getParam('refid')!=NULL) { + if (strpos($request->getParam('userid'), "@")!=false) { + $user=User::where("email", "=", $request->getParam('userid'))->first(); + } else { + $user=User::Where("id", "=", $request->getParam('userid'))->first(); + } + + if ($user==null) { + $res['ret'] = 0; + $res['msg'] = "邀请者更改失败,检查用户id是否输入正确"; + return $response->getBody()->write(json_encode($res)); + } + $uid = $user->id; + } else { + $uid=0; + } + $user->ref_by = $request->getParam('refid'); + $user->save(); + $res['ret'] = 1; + $res['msg'] = "邀请者更改成功"; + return $response->getBody()->write(json_encode($res)); + } + public function addInvite($request, $response, $args) { $num = $request->getParam('num'); diff --git a/app/Controllers/Client/ClientApiController.php b/app/Controllers/Client/ClientApiController.php index 7f24b4f0..7f34ccf1 100644 --- a/app/Controllers/Client/ClientApiController.php +++ b/app/Controllers/Client/ClientApiController.php @@ -56,13 +56,16 @@ class ClientApiController extends BaseController public function GetSubLink($request, $response, $args) { $accessToken = Helper::getParam($request, 'access_token'); + $sub = (Helper::getParam($request, 'sub') != '' + ? Helper::getParam($request, 'sub') + : 1); $storage = Factory::createTokenStorage(); $token = $storage->get($accessToken); $user = User::find($token->userId); $ssr_sub_token = LinkController::GenerateSSRSubCode($user->id, 0); $res['ret'] = 1; $res['msg'] = 'ok'; - $res['data'] = Config::get('subUrl') . $ssr_sub_token . '?sub=1'; + $res['data'] = Config::get('subUrl') . $ssr_sub_token . '?sub=' . $sub; return $this->echoJson($response, $res); } } diff --git a/app/Models/User.php b/app/Models/User.php old mode 100755 new mode 100644 index cbb688bb..bc094405 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -39,8 +39,8 @@ class User extends Model public function getGravatarAttribute() { - // $hash = md5(strtolower(trim($this->attributes['email']))); - return '/images/Avatar.jpg';//.$hash; + $hash = md5(strtolower(trim($this->attributes['email']))); + return 'https://gravatar.loli.net/avatar/' . $hash; } public function isAdmin() @@ -58,7 +58,11 @@ class User extends Model public function getMuMd5() { - $str = str_replace(array('%id', '%suffix'), array($this->attributes['id'], Config::get('mu_suffix')), Config::get('mu_regex')); + $str = str_replace( + array('%id', '%suffix'), + array($this->attributes['id'], Config::get('mu_suffix')), + Config::get('mu_regex') + ); preg_match_all("|%-?[1-9]\d*m|U", $str, $matches, PREG_PATTERN_ORDER); foreach ($matches[0] as $key) { $key_match = str_replace(array('%', 'm'), '', $key); @@ -130,7 +134,10 @@ class User extends Model public function getUuid() { - return Uuid::uuid3(Uuid::NAMESPACE_DNS, $this->attributes['id'] . '|' . $this->attributes['passwd'])->toString(); + return Uuid::uuid3( + Uuid::NAMESPACE_DNS, + $this->attributes['id'] . '|' . $this->attributes['passwd'] + )->toString(); } public function trafficUsagePercent() @@ -201,7 +208,10 @@ class User extends Model public function getGAurl() { $ga = new GA(); - $url = $ga->getUrl(urlencode(Config::get('appName') . '-' . $this->attributes['user_name'] . '-两步验证码'), $this->attributes['ga_token']); + $url = $ga->getUrl( + urlencode(Config::get('appName') . '-' . $this->attributes['user_name'] . '-两步验证码'), + $this->attributes['ga_token'] + ); return $url; } @@ -322,22 +332,39 @@ class User extends Model $location = $iplocation->getlocation($reg_location); $reg_location .= "\n" . iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']); - $return_array = array('DT_RowId' => 'row_1_' . $id, $id, $id, - $this->attributes['user_name'], $this->attributes['remark'], - $this->attributes['email'], $this->attributes['money'], - $im_type, $im_value, - $this->attributes['node_group'], $account_expire_in, - $this->attributes['class'], $class_expire_in, - $this->attributes['passwd'], $this->attributes['port'], + $return_array = array( + 'DT_RowId' => 'row_1_' . $id, + $id, + $id, + $this->attributes['user_name'], + $this->attributes['remark'], + $this->attributes['email'], + $this->attributes['money'], + $im_type, + $im_value, + $this->attributes['node_group'], + $account_expire_in, + $this->attributes['class'], + $class_expire_in, + $this->attributes['passwd'], + $this->attributes['port'], $this->attributes['method'], - $this->attributes['protocol'], $this->attributes['obfs'], - $this->online_ip_count(), $this->lastSsTime(), - $used_traffic, $enable_traffic, - $this->lastCheckInTime(), $today_traffic, - $is_enable, $this->attributes['reg_date'], + $this->attributes['protocol'], + $this->attributes['obfs'], + $this->online_ip_count(), + $this->lastSsTime(), + $used_traffic, + $enable_traffic, + $this->lastCheckInTime(), + $today_traffic, + $is_enable, + $this->attributes['reg_date'], $reg_location, - $this->attributes['auto_reset_day'], $this->attributes['auto_reset_bandwidth'], - $ref_user_id, $ref_user_name); + $this->attributes['auto_reset_day'], + $this->attributes['auto_reset_bandwidth'], + $ref_user_id, + $ref_user_name + ); return $return_array; } @@ -390,4 +417,40 @@ class User extends Model $logs = DetectBanLog::where('user_id', $this->attributes['id'])->orderBy("id", "desc")->first(); return $logs->detect_number; } + public function yesterdayIncome() + { + return Code::where('usedatetime', 'like', date('Y-m-d%', strtotime('-1 days')))->sum(number); + } + + public function todayIncome() + { + return Code::where('usedatetime', 'like', date('Y-m-d%'))->sum(number); + } + + public function thisMonthIncome() + { + return Code::where('usedatetime', 'like', date('Y-m%'))->sum(number); + } + + public function lastMonthIncome() + { + return Code::where('usedatetime', 'like', date('Y-m%', strtotime('-1 months')))->sum(number); + } + + public function totalIncome() + { + return Code::where('usedatetime', 'like', date('%'))->sum(number); + } + + public function paidUserCount() + { + return self::where('class', '!=', '0')->count(); + } + + public function disableReason() + { + $reason_id = DetectLog::where('user_id', '=', $this->attributes['id'])->orderBy('id', 'DESC')->first(); + $reason = DetectRule::where('id', '=', $reason_id->list_id)->get(); + return $reason[0]->text; + } } diff --git a/app/Services/Config.php b/app/Services/Config.php index c2d13e60..05998522 100755 --- a/app/Services/Config.php +++ b/app/Services/Config.php @@ -4,16 +4,10 @@ namespace App\Services; class Config { + // TODO: remove public static function get($key) { - global $System_Config; - return $System_Config[$key]; - } - - public static function set($key, $value) - { - global $System_Config; - $System_Config[$key] = $value; + return $_ENV[$key]; } public static function getPublicConfig() @@ -92,9 +86,8 @@ class Config public static function getMuKey() { - global $System_Config; - $muKeyList = array_key_exists('muKeyList', $System_Config) ? $System_Config['muKeyList'] : [' ']; - return array_merge(explode(',', $System_Config['muKey']), $muKeyList); + $muKeyList = array_key_exists('muKeyList', $_ENV) ? $_ENV['muKeyList'] : [' ']; + return array_merge(explode(',', $_ENV['muKey']), $muKeyList); } public static function getSupportParam($type) diff --git a/config/.config.example.php b/config/.config.example.php index ff940910..7053dac8 100644 --- a/config/.config.example.php +++ b/config/.config.example.php @@ -5,27 +5,27 @@ //config迁移附注(由开发者填写本次config迁移后需要注意的地方,站长勿动) //如需换行,直接换行即可,无需换行符 //【新增/删除】config无需写入迁移附注 -$System_Config['config_migrate_notice']= +$_ENV['config_migrate_notice']= 'enable_geetest_* 已变更为 enable_*_captcha crisp已被替换为mylivechat telegrma_qrcode被重命名为qrcode '; -$System_Config['version']='1'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动 +$_ENV['version']='1'; //仅当涉及【需要修改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'; //用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作! -$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'; //用户名对应的密码 +$_ENV['key'] = '1145141919810'; //!!! 瞎 jb 修改此key为随机字符串确保网站安全 !!! +$_ENV['debug'] = false; //正式环境请确保为 false +$_ENV['appName'] = 'sspanel'; //站点名称 +$_ENV['baseUrl'] = 'http://url.com'; //站点地址 +$_ENV['subUrl'] = $_ENV['baseUrl'].'/link/'; //订阅地址,如需和站点名称相同,请不要修改 +$_ENV['muKey'] = 'NimaQu'; //用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作! +$_ENV['db_driver'] = 'mysql'; //数据库程序 +$_ENV['db_host'] = 'localhost'; //数据库地址 +$_ENV['db_database'] = 'sspanel'; //数据库名 +$_ENV['db_username'] = 'root'; //数据库用户名 +$_ENV['db_password'] = 'sspanel'; //用户名对应的密码 // 新旧首页设置-------------------------------------------------------------------------------------------- $System_Config['newIndex'] = 'true'; //使用新的 Node.js 开发的首页请填写 true,其他值为使用先前的首页,如您使用其他主题请保持 true @@ -36,208 +36,208 @@ $System_Config['newIndex'] = 'true'; //使用新的 Node.js 开发的首页请 $System_Config['sub_message'] = []; //邮件设置-------------------------------------------------------------------------------------------- -$System_Config['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid -$System_Config['sendPageLimit']= 50; //发信分页 解决大站发公告超时问题 +$_ENV['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid +$_ENV['sendPageLimit']= 50; //发信分页 解决大站发公告超时问题 # mailgun -$System_Config['mailgun_key'] = ''; -$System_Config['mailgun_domain'] = ''; -$System_Config['mailgun_sender'] = ''; +$_ENV['mailgun_key'] = ''; +$_ENV['mailgun_domain'] = ''; +$_ENV['mailgun_sender'] = ''; # smtp -$System_Config['smtp_host'] = ''; -$System_Config['smtp_username'] = ''; -$System_Config['smtp_port'] = '465'; -$System_Config['smtp_name'] = ''; -$System_Config['smtp_sender'] = ''; -$System_Config['smtp_passsword'] = ''; -$System_Config['smtp_ssl'] = 'true'; +$_ENV['smtp_host'] = ''; +$_ENV['smtp_username'] = ''; +$_ENV['smtp_port'] = '465'; +$_ENV['smtp_name'] = ''; +$_ENV['smtp_sender'] = ''; +$_ENV['smtp_passsword'] = ''; +$_ENV['smtp_ssl'] = 'true'; # sendgrid -$System_Config['sendgrid_key'] = ''; -$System_Config['sendgrid_sender'] = ''; +$_ENV['sendgrid_key'] = ''; +$_ENV['sendgrid_sender'] = ''; //备份设置-------------------------------------------------------------------------------------------- -$System_Config['auto_backup_email']=''; //接收备份的邮箱 -$System_Config['auto_backup_passwd']=''; //备份的压缩密码 -$System_Config['backup_notify']='true'; //备份通知到TG群中 +$_ENV['auto_backup_email']=''; //接收备份的邮箱 +$_ENV['auto_backup_passwd']=''; //备份的压缩密码 +$_ENV['backup_notify']='true'; //备份通知到TG群中 //用户注册设置----------------------------------------------------------------------------------------- -$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 代表上面这个后缀。 +$_ENV['register_mode'] = 'open'; //注册模式。close:关闭,open:开放,invite:仅限邀请码 +$_ENV['defaultTraffic'] = '1'; //用户初始流量 单位GB +$_ENV['user_expire_in_default']='3650'; //用户账户过期时间,在注册时设置。(天) +$_ENV['user_class_default']='0'; //用户注册等级,在注册时设置。 +$_ENV['user_class_expire_default']='24'; //用户等级过期时间,在注册时设置。(小时) +$_ENV['user_conn']='0'; //用户注册客户端数量限制,0为不限制 +$_ENV['user_speedlimit']='0'; //用户注册速度默认限制,0为不限制 +$_ENV['reg_auto_reset_day']='0'; //注册时的流量重置日,0为不重置 +$_ENV['reg_auto_reset_bandwidth']='0'; //需要重置的流量,0为不重置 +$_ENV['ramdom_group']='0'; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。 +$_ENV['reg_method']='chacha20-ietf'; //注册时默认加密方式 +$_ENV['reg_protocol']='auth_aes128_sha1'; //注册时默认协议 +$_ENV['reg_protocol_param']=''; //注册时默认协议参数 +$_ENV['reg_obfs']='http_simple'; //注册时默认混淆方式 +$_ENV['reg_obfs_param']='www.jd.hk'; //注册时默认混淆参数 +$_ENV['reg_forbidden_ip']='127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割 +$_ENV['min_port']='10000'; //用户端口池最小值 +$_ENV['max_port']='65535'; //用户端口池最大值 +$_ENV['reg_forbidden_port']=''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段 +$_ENV['mu_suffix']='microsoft.com'; //单端口多用户混淆参数后缀,可以随意修改,但请保持前后端一致 +$_ENV['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时视为不开放购买 +$_ENV['inviteNum'] = '10'; //注册后的邀请链接可用次数 +$_ENV['invite_get_money']='1'; //新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金) +$_ENV['invite_price']='-1'; //用户购买邀请码所需要的价格,价格小于0时视为不开放购买 +$_ENV['custom_invite_price']='-1'; //用户定制邀请码所需要的价格,价格小于0时视为不开放购买 #邮箱验证 -$System_Config['enable_email_verify']='false'; //是否启用注册邮箱验证码 -$System_Config['email_verify_ttl']='3600'; //邮箱验证码有效期 -$System_Config['email_verify_iplimit']='10'; //验证码有效期内,单IP可请求验证码次数 +$_ENV['enable_email_verify']='false'; //是否启用注册邮箱验证码 +$_ENV['email_verify_ttl']='3600'; //邮箱验证码有效期 +$_ENV['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['enable_bought_extend']='true'; //购买时是否延长等级期限(同等级配套) -$System_Config['port_price']='-1'; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买 -$System_Config['port_price_specify']='-1'; //用户指明钦定端口所需要的价格,价格小于0时视为不开放购买 +$_ENV['checkinMin'] = '1'; //用户签到最少流量 单位MB +$_ENV['checkinMax'] = '50'; //用户签到最多流量 +$_ENV['auto_clean_uncheck_days']='-1'; //自动清理多少天没签到的0级用户,小于等于0时关闭 +$_ENV['auto_clean_unused_days']='-1'; //自动清理多少天没使用的0级用户,小于等于0时关闭 +$_ENV['auto_clean_min_money']='1'; //余额低于多少的0级用户可以被清理 +$_ENV['code_payback']='20'; //充值返利百分比 +$_ENV['invite_gift']='2'; //邀请新用户获得流量奖励,单位G +$_ENV['enable_bought_reset']='true'; //购买时是否重置流量 +$_ENV['enable_bought_extend']='true'; //购买时是否延长等级期限(同等级配套) +$_ENV['port_price']='-1'; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买 +$_ENV['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,此项在 Rico && GeekQu 仓库已废弃 -$System_Config['protocol_specify'] = 'true'; //允许用户自行切换加密、协议、混淆,允许请填写 true,禁止用户自行修改将使用下方配置的方案 -$System_Config['keep_connect'] = 'false'; //是否开启用户流量耗尽后降低速率至 1Mbps 而不断网 +$_ENV['class_expire_reset_traffic']='0'; //等级到期时重置为的流量值,单位GB,小于0时不重置 +$_ENV['account_expire_delete_days']='-1'; //账户到期几天之后会删除账户,小于0时不删除 +$_ENV['enable_kill']='true'; //是否允许用户注销账户 +$_ENV['notify_limit_mode'] = 'false'; //false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒 +$_ENV['notify_limit_value'] = '20'; //当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量 +$_ENV['mergeSub'] = 'false'; //合并订阅设置 可选项 false / true,此项在 Rico && GeekQu 仓库已废弃 +$_ENV['protocol_specify'] = 'true'; //允许用户自行切换加密、协议、混淆,允许请填写 true,禁止用户自行修改将使用下方配置的方案 +$_ENV['keep_connect'] = 'false'; //是否开启用户流量耗尽后降低速率至 1Mbps 而不断网 #加密、协议、混淆切换方案 -$System_Config['user_agreement_scheme'] = [ +$_ENV['user_agreement_scheme'] = [ ['id'=>1,'name'=>'SS 推荐配置','method'=>'chacha20-ietf-poly1305','protocol'=>'origin','obfs'=>'plain'], ['id'=>2,'name'=>'SSR 推荐配置','method'=>'chacha20-ietf','protocol'=>'auth_aes128_sha1','obfs'=>'http_simple_compatible'], ['id'=>3,'name'=>'SS/SSR 兼容配置','method'=>'chacha20-ietf','protocol'=>'auth_aes128_sha1_compatible','obfs'=>'plain'] ]; -$System_Config['subscribeLog'] = 'false'; //是否记录用户订阅日志 -$System_Config['subscribeLog_keep_days'] = '7'; //订阅记录保留天数 +$_ENV['subscribeLog'] = 'false'; //是否记录用户订阅日志 +$_ENV['subscribeLog_keep_days'] = '7'; //订阅记录保留天数 //Bot 设置-------------------------------------------------------------------------------------------- #通用 -$System_Config['qrcode']='zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local -$System_Config['finance_public']='false'; //财务报告是否向群公开 -$System_Config['enable_welcome_message']='true'; //机器人发送欢迎消息 +$_ENV['qrcode']='zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local +$_ENV['finance_public']='false'; //财务报告是否向群公开 +$_ENV['enable_welcome_message']='true'; //机器人发送欢迎消息 #Discord -$System_Config['enable_discord']='false'; //是否开启Discord bot(仍未完成) -$System_Config['discord_token']=''; //Discord bot,bot 的 token,在 https://discordapp.com/developers/applications/ 申请 +$_ENV['enable_discord']='false'; //是否开启Discord bot(仍未完成) +$_ENV['discord_token']=''; //Discord bot,bot 的 token,在 https://discordapp.com/developers/applications/ 申请 #Telegram -$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_request_token']=''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram +$_ENV['enable_telegram']='false'; //是否开启Telegram bot +$_ENV['telegram_token']=''; //Telegram bot,bot 的 token ,跟 father bot 申请 +$_ENV['telegram_chatid']=''; //Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。 +$_ENV['enable_tuling']='false'; //是否开启图灵机器人 +$_ENV['tuling_apikey']=''; //图灵机器人API Key +$_ENV['tuling_apisecert']=''; //图灵机器人密钥 +$_ENV['telegram_bot']='_bot'; //Telegram 机器人账号 +$_ENV['telegram_group_quiet']='false'; //Telegram 机器人在群组中不回应 +$_ENV['telegram_request_token']=''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram //沟通设置-------------------------------------------------------------------------------------------- #客服系统设置,注册地址 https://www.mylivechat.com -$System_Config['enable_mylivechat']='false'; //是否开启客服系统 -$System_Config['mylivechat_id']='null'; //客服系统ID +$_ENV['enable_mylivechat']='false'; //是否开启客服系统 +$_ENV['mylivechat_id']='null'; //客服系统ID # PushBear 基于微信模板的向关注了二维码的用户以微信方式推送消息 https://pushbear.ftqq.com/ -$System_Config['usePushBear'] = 'false'; // true 启用 false 禁用 -$System_Config['PushBear_sendkey'] = ''; //请填写您在PushBear获取的sendkey 请仔细检查勿粘贴错 +$_ENV['usePushBear'] = 'false'; // true 启用 false 禁用 +$_ENV['PushBear_sendkey'] = ''; //请填写您在PushBear获取的sendkey 请仔细检查勿粘贴错 #工单系统设置 -$System_Config['enable_ticket']='true'; //是否开启工单系统 -$System_Config['mail_ticket']='true'; //是否开启工单邮件提醒 +$_ENV['enable_ticket']='true'; //是否开启工单系统 +$_ENV['mail_ticket']='true'; //是否开启工单邮件提醒 # Server酱 用户提交新工单或者回复工单时用微信提醒机场主 http://sc.ftqq.com/ -$System_Config['useScFtqq'] = 'false'; //是否开启工单Server酱提醒 -$System_Config['ScFtqq_SCKEY'] = ''; //请填写您在Server酱获取的SCKEY 请仔细检查勿粘贴错 +$_ENV['useScFtqq'] = 'false'; //是否开启工单Server酱提醒 +$_ENV['ScFtqq_SCKEY'] = ''; //请填写您在Server酱获取的SCKEY 请仔细检查勿粘贴错 #管理员联系方式设置 -$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'; //没有格式要求,想怎么写就怎么写,可留空 +$_ENV['enable_admin_contact']='false'; //是否开启管理员联系方式 +$_ENV['admin_contact1'] = 'QQ:1233456'; //QQ、邮箱、微信仅用于举例 +$_ENV['admin_contact2'] = '邮箱123456@qq.com'; //也可以写电话、tg等其他联系方式 +$_ENV['admin_contact3'] = '微信~123456'; //没有格式要求,想怎么写就怎么写,可留空 //验证码设置------------------------------------------------------------------------------------------ -$System_Config['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验) +$_ENV['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验) -$System_Config['recaptcha_sitekey'] = ''; -$System_Config['recaptcha_secret'] = ''; +$_ENV['recaptcha_sitekey'] = ''; +$_ENV['recaptcha_secret'] = ''; -$System_Config['geetest_id'] = ''; -$System_Config['geetest_key'] = ''; +$_ENV['geetest_id'] = ''; +$_ENV['geetest_key'] = ''; -$System_Config['enable_reg_captcha'] = 'false'; //启用注册验证码 -$System_Config['enable_login_captcha'] = 'false'; //启用登录验证码 -$System_Config['enable_checkin_captcha'] = 'false'; //启用签到验证码 +$_ENV['enable_reg_captcha'] = 'false'; //启用注册验证码 +$_ENV['enable_login_captcha'] = 'false'; //启用登录验证码 +$_ENV['enable_checkin_captcha'] = 'false'; //启用签到验证码 //支付系统设置---------------------------------------------------------------------------------------- #取值 none | codepay | trimepay | f2fpay | chenAlipay | paymentwall | spay |tomatopay | payjs -$System_Config['payment_system']='none'; +$_ENV['payment_system']='none'; #codepay码支付 #wiki地址:https://goo.gl/dRwRDi http://t.cn/RnsWjtB -$System_Config['codepay_id']=''; //码支付ID -$System_Config['codepay_key']=''; //码支付通信密钥 +$_ENV['codepay_id']=''; //码支付ID +$_ENV['codepay_key']=''; //码支付通信密钥 #alipay,f2fpay -$System_Config['f2fpay_app_id']=''; -$System_Config['f2fpay_p_id']=''; -$System_Config['alipay_public_key']=''; -$System_Config['merchant_private_key']=''; -$System_Config['f2fNotifyUrl']=null; //自定义当面付回调地址 +$_ENV['f2fpay_app_id']=''; +$_ENV['f2fpay_p_id']=''; +$_ENV['alipay_public_key']=''; +$_ENV['merchant_private_key']=''; +$_ENV['f2fNotifyUrl']=null; //自定义当面付回调地址 #PaymentWall -$System_Config['pmw_publickey']=''; -$System_Config['pmw_privatekey']=''; -$System_Config['pmw_widget']='m2_1'; -$System_Config['pmw_height']='350px'; +$_ENV['pmw_publickey']=''; +$_ENV['pmw_privatekey']=''; +$_ENV['pmw_widget']='m2_1'; +$_ENV['pmw_height']='350px'; #alipay,spay -$System_Config['alipay_id']=''; -$System_Config['alipay_key']=''; -$System_Config['amount']=[2,23,233,2333,23333]; //充值金额选项设定 +$_ENV['alipay_id']=''; +$_ENV['alipay_key']=''; +$_ENV['amount']=[2,23,233,2333,23333]; //充值金额选项设定 #alipay,zfbjk.com -$System_Config['zfbjk_pid']=''; -$System_Config['zfbjk_key']=''; -$System_Config['zfbjk_qrcodeurl']=''; +$_ENV['zfbjk_pid']=''; +$_ENV['zfbjk_key']=''; +$_ENV['zfbjk_qrcodeurl']=''; #Trimepay https://portal.trimepay.com/#/auth/register/134 -$System_Config['trimepay_appid']=''; //AppID -$System_Config['trimepay_secret']=''; //AppSecret +$_ENV['trimepay_appid']=''; //AppID +$_ENV['trimepay_secret']=''; //AppSecret # BitPay 数字货币支付(比特币、以太坊、EOS等) 商户后台获取授权码 https://merchants.mugglepay.com/ # 客服和技术 24x7 在线支持: https://t.me/joinchat/GLKSKhUnE4GvEAPgqtChAQ -$System_Config['bitpay_secret']=''; +$_ENV['bitpay_secret']=''; #PayJs -$System_Config['payjs_mchid']=''; -$System_Config['payjs_key']=''; +$_ENV['payjs_mchid']=''; +$_ENV['payjs_key']=''; //其他面板显示设置------------------------------------------------------------------------------------------ @@ -249,87 +249,87 @@ $System_Config['remote_documents'] = 'true'; //是否从远程加载文档 $System_Config['documents_source'] = 'https://raw.githubusercontent.com/GeekQu/PANEL_DOC/master/GeekQu'; //远程文档加载地址 #后台商品列表 销量统计 -$System_Config['sales_period']='30'; //统计指定周期内的销量,值为【expire/任意大于0的整数】 +$_ENV['sales_period']='30'; //统计指定周期内的销量,值为【expire/任意大于0的整数】 #国旗 -$System_Config['enable_flag']='false'; //启用该项之前务必先仔细阅读教程 -$System_Config['flag_regex']='/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版) +$_ENV['enable_flag']='false'; //启用该项之前务必先仔细阅读教程 +$_ENV['flag_regex']='/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版) #捐赠 -$System_Config['enable_donate']='false'; //是否显示用户捐赠(所有收入将被公开) +$_ENV['enable_donate']='false'; //是否显示用户捐赠(所有收入将被公开) #iOS账户显示 -$System_Config['display_ios_class']='-1'; //至少等级为多少的用户可以看见,小于0时关闭此功能 -$System_Config['display_ios_topup']='0'; //满足等级要求后,累计充值高于多少的用户可以看见 -$System_Config['ios_account']=''; //iOS账户 -$System_Config['ios_password']=''; //iOS密码 +$_ENV['display_ios_class']='-1'; //至少等级为多少的用户可以看见,小于0时关闭此功能 +$_ENV['display_ios_topup']='0'; //满足等级要求后,累计充值高于多少的用户可以看见 +$_ENV['ios_account']=''; //iOS账户 +$_ENV['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'; //尝试次数 +$_ENV['detect_gfw_interval']='3600'; //检测间隔,单位:秒,低于推荐值会爆炸 +$_ENV['detect_gfw_port']='22'; //所有节点服务器都打开的TCP端口,常用的为22(SSH端口) +$_ENV['detect_gfw_url']='https://cn-qz-tcping.torch.njs.app/{ip}/{port}'; //检测节点是否被gfw墙了的API的URL +$_ENV['detect_gfw_judge']='$json_tcping[\'status\']=="true"'; //判断是否被墙的依据,json_tcping为上方URL返回的json数组 +$_ENV['detect_gfw_count']='3'; //尝试次数 #离线检测 -$System_Config['enable_detect_offline']='true'; +$_ENV['enable_detect_offline']='true'; #离线检测是否推送到Server酱 请配置好上文的Server配置 -$System_Config['enable_detect_offline_useScFtqq']='true'; +$_ENV['enable_detect_offline_useScFtqq']='true'; //以下所有均为高级设置(一般用不上,不用改--------------------------------------------------------------------- #杂项 -$System_Config['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定 -$System_Config['rememberMeDuration']='7'; //登录时记住账号时长天数 -$System_Config['authDriver'] = 'cookie'; //不能更改此项 -$System_Config['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2) -$System_Config['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项 -$System_Config['sessionDriver'] = 'cookie'; //可选: cookie,redis -$System_Config['cacheDriver'] = 'cookie'; //可选: cookie,redis -$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['login_warn']='false'; //异地登陆提示 -$System_Config['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间 -$System_Config['db_charset'] = 'utf8'; -$System_Config['db_collation'] = 'utf8_general_ci'; -$System_Config['db_prefix'] = ''; -$System_Config['muKeyList'] = [' ']; //多 key 列表 -$System_Config['mu_port_migration'] = 'false'; //为后端直接下发偏移后的端口 -$System_Config['relay_port_migration'] = 'false'; //为中转规则下发偏移后的端口,此项未经测试 -$System_Config['add_emoji_to_node_name'] = 'false'; //为部分订阅中默认添加 emoji -$System_Config['add_appName_to_ss_uri'] = 'true'; //为 SS 节点名称中添加站点名 +$_ENV['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定 +$_ENV['rememberMeDuration']='7'; //登录时记住账号时长天数 +$_ENV['authDriver'] = 'cookie'; //不能更改此项 +$_ENV['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2) +$_ENV['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项 +$_ENV['sessionDriver'] = 'cookie'; //可选: cookie,redis +$_ENV['cacheDriver'] = 'cookie'; //可选: cookie,redis +$_ENV['tokenDriver'] = 'db'; //可选: db,redis +$_ENV['jump_delay']='1200'; //跳转延时,单位ms,不建议太长 +$_ENV['theme'] = 'material'; //主题 +$_ENV['pacp_offset']='-20000'; //VPN 端口偏移 +$_ENV['pacpp_offset']='-20000'; +$_ENV['Speedtest_duration']='6'; //显示多长时间的测速记录 +$_ENV['login_warn']='false'; //异地登陆提示 +$_ENV['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间 +$_ENV['db_charset'] = 'utf8'; +$_ENV['db_collation'] = 'utf8_general_ci'; +$_ENV['db_prefix'] = ''; +$_ENV['muKeyList'] = [' ']; //多 key 列表 +$_ENV['mu_port_migration'] = 'false'; //为后端直接下发偏移后的端口 +$_ENV['relay_port_migration'] = 'false'; //为中转规则下发偏移后的端口,此项未经测试 +$_ENV['add_emoji_to_node_name'] = 'false'; //为部分订阅中默认添加 emoji +$_ENV['add_appName_to_ss_uri'] = 'true'; //为 SS 节点名称中添加站点名 // 审计自动封禁开关 -$System_Config['enable_auto_detect_ban'] = 'false'; +$_ENV['enable_auto_detect_ban'] = 'false'; // 管理员不受审计限制 -$System_Config['auto_detect_ban_allow_admin'] = 'true'; +$_ENV['auto_detect_ban_allow_admin'] = 'true'; // 审计封禁的例外用户 ID -$System_Config['auto_detect_ban_allow_users'] = []; +$_ENV['auto_detect_ban_allow_users'] = []; // 审计封禁判断类型: // - 1 = 仁慈模式,每触碰多少次封禁一次 // - 2 = 疯狂模式,累计触碰次数按阶梯进行不同时长的封禁 -$System_Config['auto_detect_ban_type'] = '1'; +$_ENV['auto_detect_ban_type'] = '1'; // 仁慈模式每次执行封禁所需的触发次数 -$System_Config['auto_detect_ban_number'] = '30'; +$_ENV['auto_detect_ban_number'] = '30'; // 仁慈模式每次封禁的时长 (分钟) -$System_Config['auto_detect_ban_time'] = '60'; +$_ENV['auto_detect_ban_time'] = '60'; // 疯狂模式阶梯 // key 为触发次数 // - type:可选 time 按时间 或 kill 删号 // - time:时间,单位分钟 -$System_Config['auto_detect_ban'] = [ +$_ENV['auto_detect_ban'] = [ 100 => [ 'type' => 'time', 'time' => '120' @@ -349,42 +349,42 @@ $System_Config['auto_detect_ban'] = [ ]; #aws -$System_Config['aws_access_key_id'] = ''; -$System_Config['aws_secret_access_key'] = ''; +$_ENV['aws_access_key_id'] = ''; +$_ENV['aws_secret_access_key'] = ''; #redis -$System_Config['redis_scheme'] = 'tcp'; -$System_Config['redis_host'] = '127.0.0.1'; -$System_Config['redis_port'] = '6379'; -$System_Config['redis_database'] = '0'; -$System_Config['redis_password']= ''; +$_ENV['redis_scheme'] = 'tcp'; +$_ENV['redis_host'] = '127.0.0.1'; +$_ENV['redis_port'] = '6379'; +$_ENV['redis_database'] = '0'; +$_ENV['redis_password']= ''; #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连接密钥 +$_ENV['enable_radius']='false'; //是否开启Radius +$_ENV['radius_db_host']=''; //以下4项为Radius数据库设置 +$_ENV['radius_db_database']=''; +$_ENV['radius_db_user']=''; +$_ENV['radius_db_password']=''; +$_ENV['radius_secret']=''; //Radius连接密钥 #Cloudxns -$System_Config['enable_cloudxns']='false'; //是否开启Cloudxns -$System_Config['cloudxns_apikey']=''; //自己去 cloudxns.net 申请 -$System_Config['cloudxns_apisecret']=''; -$System_Config['cloudxns_domain']=''; //你的域名 +$_ENV['enable_cloudxns']='false'; //是否开启Cloudxns +$_ENV['cloudxns_apikey']=''; //自己去 cloudxns.net 申请 +$_ENV['cloudxns_apisecret']=''; +$_ENV['cloudxns_domain']=''; //你的域名 #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'; //域名 +$_ENV['cloudflare_enable']='false'; //是否开启 Cloudflare 解析 +$_ENV['cloudflare_email']='user@example.com'; //Cloudflare 邮箱地址 +$_ENV['cloudflare_key']='c2547eb745079dac9320b638f5e225cf483cc5cfdda41'; //Cloudflare API Key +$_ENV['cloudflare_name']='example.com'; //域名 #不安全中转模式,这个开启之后使用除了 auth_aes128_md5 或者 auth_aes128_sha1 以外的协议地用户也可以设置和使用中转 -$System_Config['relay_insecure_mode']='false'; //强烈推荐不开启 +$_ENV['relay_insecure_mode']='false'; //强烈推荐不开启 #是否夹带统计代码,自己在 resources/views/{主题名} 下创建一个 analytics.tpl ,如果有必要就用 literal 界定符 -$System_Config['enable_analytics_code']='false'; -$System_Config['sspanelAnalysis'] = 'true'; +$_ENV['enable_analytics_code']='false'; +$_ENV['sspanelAnalysis'] = 'true'; #在套了CDN之后获取用户真实ip,如果您不知道这是什么,请不要乱动 if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) { @@ -392,10 +392,11 @@ $list = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $_SERVER['REMOTE_ADDR'] = $list[0]; } -// make replace System_Config with env + +// make replace _ENV with env function findKeyName($name) { - global $System_Config; - foreach($System_Config as $configKey => $configValue) { + global $_ENV; + foreach($_ENV as $configKey => $configValue) { if (strtoupper($configKey) == $name) { return $configKey; } @@ -405,15 +406,15 @@ function findKeyName($name) { } foreach(getenv() as $envKey => $envValue) { - global $System_Config; + global $_ENV; $envUpKey = strtoupper($envKey); // Key starts with UIM_ if (substr($envUpKey, 0 , 4) == "UIM_") { - // Vaild env key, set to System_Config + // Vaild env key, set to _ENV $configKey = substr($envUpKey, 4); $realKey = findKeyName($configKey); if ($realKey != NULL) { - $System_Config[$realKey] = $envValue; + $_ENV[$realKey] = $envValue; } } } diff --git a/config/routes.php b/config/routes.php index ac67205a..22997cb4 100644 --- a/config/routes.php +++ b/config/routes.php @@ -305,6 +305,7 @@ $app->group('/admin', function () { $this->get('/profile', App\Controllers\AdminController::class . ':profile'); $this->get('/invite', App\Controllers\AdminController::class . ':invite'); $this->post('/invite', App\Controllers\AdminController::class . ':addInvite'); + $this->post('/chginvite', App\Controllers\AdminController::class . ':chgInvite'); $this->get('/sys', App\Controllers\AdminController::class . ':sys'); $this->get('/logout', App\Controllers\AdminController::class . ':logout'); $this->post('/payback/ajax', App\Controllers\AdminController::class . ':ajax_payback'); diff --git a/resources/views/material/admin/code/index.tpl b/resources/views/material/admin/code/index.tpl index ef800f48..f10478d4 100644 --- a/resources/views/material/admin/code/index.tpl +++ b/resources/views/material/admin/code/index.tpl @@ -15,6 +15,13 @@
系统中金额流转记录。
+
+ 今日流水:¥{$user->todayIncome()}
+ 昨日流水:¥{$user->yesterdayIncome()}
+ 这月流水:¥{$user->thisMonthIncome()}
+ 上月流水:¥{$user->lastMonthIncome()}
+ 总共流水:¥{$user->totalIncome()}
+
显示表项: {include file='table/checkbox.tpl'}
diff --git a/resources/views/material/admin/invite.tpl b/resources/views/material/admin/invite.tpl index 82654494..c1105245 100644 --- a/resources/views/material/admin/invite.tpl +++ b/resources/views/material/admin/invite.tpl @@ -16,7 +16,32 @@info填写用户的ID
+系统中所有用户的列表。
++ 付费用户:{$user->paidUserCount()} +
显示表项: {include file='table/checkbox.tpl'}
@@ -275,4 +278,4 @@ }) - \ No newline at end of file + diff --git a/resources/views/material/user/disable.tpl b/resources/views/material/user/disable.tpl index cb1b81b8..6f5d524a 100644 --- a/resources/views/material/user/disable.tpl +++ b/resources/views/material/user/disable.tpl @@ -15,7 +15,10 @@您由于某些原因而被管理员禁用了账户,请联系管理员。
+您由于以下原因而被管理员禁用了账户,请联系管理员。
++ 禁用原因:{$user->disableReason()} +
{if $config["enable_admin_contact"] == 'true'}管理员联系方式:
{if $config["admin_contact1"]!=null} diff --git a/resources/views/material/user/index.tpl b/resources/views/material/user/index.tpl index b5e8cdcb..5bb192fc 100644 --- a/resources/views/material/user/index.tpl +++ b/resources/views/material/user/index.tpl @@ -528,37 +528,6 @@ table tr td:first-child { return new Date(str_date_splited[0], str_date_splited[1] - 1, str_date_splited[2], str_date_splited[3], str_date_splited[4], str_date_splited[5]); } - /* - * Author: neoFelhz & CloudHammer - * https://github.com/CloudHammer/CloudHammer/make-sspanel-v3-mod-great-again - * License: MIT license & SATA license - */ - function CountDown() { - var levelExpire = DateParse("{$user->class_expire}"); - var accountExpire = DateParse("{$user->expire_in}"); - var nowDate = new Date(); - var a = nowDate.getTime(); - var b = levelExpire - a; - var c = accountExpire - a; - var levelExpireDays = Math.floor(b / (24 * 3600 * 1000)); - var accountExpireDays = Math.floor(c / (24 * 3600 * 1000)); - if (levelExpireDays < 0 || levelExpireDays > 315360000000) { - document.getElementById('days-level-expire').innerHTML = "无限期"; - for (var i = 0; i < document.getElementsByClassName('label-level-expire').length; i += 1) { - document.getElementsByClassName('label-level-expire')[i].style.display = 'none'; - } - } else { - document.getElementById('days-level-expire').innerHTML = levelExpireDays; - } - if (accountExpireDays < 0 || accountExpireDays > 315360000000) { - document.getElementById('days-account-expire').innerHTML = "无限期"; - for (var i = 0; i < document.getElementsByClassName('label-account-expire').length; i += 1) { - document.getElementsByClassName('label-account-expire')[i].style.display = 'none'; - } - } else { - document.getElementById('days-account-expire').innerHTML = accountExpireDays; - } - } +