Browse Source

feat(conf): un-string variable type

SakuraSa233 6 years ago
parent
commit
74e5f87b84

+ 3 - 3
app/Command/FinanceMail.php

@@ -83,7 +83,7 @@ class FinanceMail
             }
         }
 
-        if (Config::get('finance_public') == 'true') {
+        if (Config::get('finance_public') == true) {
             $sts = new Analytics();
             Telegram::Send(
                 '新鲜出炉的财务日报~' . PHP_EOL .
@@ -150,7 +150,7 @@ class FinanceMail
             }
         }
 
-        if (Config::get('finance_public') == 'true') {
+        if (Config::get('finance_public') == true) {
             $sts = new Analytics();
             Telegram::Send(
                 '新鲜出炉的财务周报~' . PHP_EOL .
@@ -197,7 +197,7 @@ class FinanceMail
             }
         }
 
-        if (Config::get('finance_public') == 'true') {
+        if (Config::get('finance_public') == true) {
             $sts = new Analytics();
             Telegram::Send(
                 '新鲜出炉的财务月报~' . PHP_EOL .

+ 11 - 11
app/Command/Job.php

@@ -71,7 +71,7 @@ class Job
                 '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
             );
-            if (Config::get('enable_radius') == 'true') {
+            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',
@@ -97,7 +97,7 @@ class Job
         system('rm -rf /tmp/ssmodbackup', $ret);
         system('rm /tmp/ssmodbackup.zip', $ret);
 
-        if (Config::get('backup_notify') == 'true') {
+        if (Config::get('backup_notify') == true) {
             Telegram::Send('备份完毕了喵~今天又是安全祥和的一天呢。');
         }
     }
@@ -433,12 +433,12 @@ class Job
         $adminUser = User::where('is_admin', '=', '1')->get();
 
         //节点掉线检测
-        if (Config::get('enable_detect_offline') == 'true') {
+        if (Config::get('enable_detect_offline') == true) {
             $nodes = Node::all();
 
             foreach ($nodes as $node) {
                 if ($node->isNodeOnline() === false && !file_exists(BASE_PATH . '/storage/' . $node->id . '.offline')) {
-                    if (Config::get('useScFtqq') == 'true' && Config::get('enable_detect_offline_useScFtqq') == 'true') {
+                    if (Config::get('useScFtqq') == true && Config::get('enable_detect_offline_useScFtqq') == true) {
                         $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
                         $text = '管理员您好,系统发现节点 ' . $node->name . ' 掉线了,请您及时处理。';
                         $postdata = http_build_query(
@@ -474,7 +474,7 @@ class Job
                             echo $e->getMessage();
                         }
 
-                        if (Config::get('enable_cloudxns') == 'true' && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
+                        if (Config::get('enable_cloudxns') == true && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
                             $api = new Api();
                             $api->setApiKey(Config::get('cloudxns_apikey'));//修改成自己API KEY
                             $api->setSecretKey(Config::get('cloudxns_apisecret'));//修改成自己的SECERET KEY
@@ -534,7 +534,7 @@ class Job
                     fwrite($myfile, $txt);
                     fclose($myfile);
                 } elseif ($node->isNodeOnline() === true && file_exists(BASE_PATH . '/storage/' . $node->id . '.offline')) {
-                    if (Config::get('useScFtqq') == 'true' && Config::get('enable_detect_offline_useScFtqq') == 'true') {
+                    if (Config::get('useScFtqq') == true && Config::get('enable_detect_offline_useScFtqq') == true) {
                         $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
                         $text = '管理员您好,系统发现节点 ' . $node->name . ' 恢复上线了。';
                         $postdata = http_build_query(
@@ -570,7 +570,7 @@ class Job
                             echo $e->getMessage();
                         }
 
-                        if (Config::get('enable_cloudxns') == 'true' && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
+                        if (Config::get('enable_cloudxns') == true && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
                             $api = new Api();
                             $api->setApiKey(Config::get('cloudxns_apikey'));//修改成自己API KEY
                             $api->setSecretKey(Config::get('cloudxns_apisecret'));//修改成自己的SECERET KEY
@@ -619,7 +619,7 @@ class Job
 
 
         //登录地检测
-        if (Config::get('login_warn') == 'true') {
+        if (Config::get('login_warn') == true) {
             $iplocation = new QQWry();
             $Logs = LoginIp::where('datetime', '>', time() - 60)->get();
             foreach ($Logs as $log) {
@@ -713,7 +713,7 @@ class Job
             if (!file_exists(BASE_PATH . '/storage/traffic_notified/') && !mkdir($concurrentDirectory = BASE_PATH . '/storage/traffic_notified/') && !is_dir($concurrentDirectory)) {
                 throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
             }
-            if (Config::get('notify_limit_mode') != 'false') {
+            if (Config::get('notify_limit_mode') != false) {
                 $user_traffic_left = $user->transfer_enable - $user->u - $user->d;
                 $under_limit = 'false';
 
@@ -921,7 +921,7 @@ class Job
                             } catch (Exception $e) {
                                 echo $e->getMessage();
                             }
-                            if (Config::get('enable_cloudxns') == 'true' && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
+                            if (Config::get('enable_cloudxns') == true && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
                                 $api = new Api();
                                 $api->setApiKey(Config::get('cloudxns_apikey'));
                                 //修改成自己API KEY
@@ -987,7 +987,7 @@ class Job
                             } catch (Exception $e) {
                                 echo $e->getMessage();
                             }
-                            if (Config::get('enable_cloudxns') == 'true' && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
+                            if (Config::get('enable_cloudxns') == true && ($node->sort == 0 || $node->sort == 10 || $node->sort == 12 || $node->sort == 13)) {
                                 $api = new Api();
                                 $api->setApiKey(Config::get('cloudxns_apikey'));
                                 //修改成自己API KEY

+ 1 - 1
app/Command/SyncRadius.php

@@ -20,7 +20,7 @@ class SyncRadius
 {
     public static function synclogin()
     {
-        if (Config::get('enable_radius') == 'false') {
+        if (Config::get('enable_radius') == false) {
             return;
         }
         $tempuserbox = array();

+ 1 - 1
app/Controllers/Admin/NodeController.php

@@ -85,7 +85,7 @@ class NodeController extends AdminController
         $node->save();
 
         $domain_name = explode('.' . Config::get('cloudflare_name'), $node->server);
-        if (Config::get('cloudflare_enable') == 'true') {
+        if (Config::get('cloudflare_enable') == true) {
             CloudflareDriver::updateRecord($domain_name[0], $node->node_ip);
         }
 

+ 10 - 10
app/Controllers/AuthController.php

@@ -29,7 +29,7 @@ class AuthController extends BaseController
     {
         $GtSdk = null;
         $recaptcha_sitekey = null;
-        if (Config::get('enable_login_captcha') === 'true') {
+        if (Config::get('enable_login_captcha') === true) {
             switch (Config::get('captcha_provider')) {
                 case 'recaptcha':
                     $recaptcha_sitekey = Config::get('recaptcha_sitekey');
@@ -41,7 +41,7 @@ class AuthController extends BaseController
             }
         }
 
-        if (Config::get('enable_telegram') === 'true') {
+        if (Config::get('enable_telegram') === true) {
             $login_text = TelegramSessionManager::add_login_session();
             $login = explode('|', $login_text);
             $login_token = $login[0];
@@ -93,7 +93,7 @@ class AuthController extends BaseController
         $code = $request->getParam('code');
         $rememberMe = $request->getParam('remember_me');
 
-        if (Config::get('enable_login_captcha') === 'true') {
+        if (Config::get('enable_login_captcha') === true) {
             switch (Config::get('captcha_provider')) {
                 case 'recaptcha':
                     $recaptcha = $request->getParam('recaptcha');
@@ -218,7 +218,7 @@ class AuthController extends BaseController
 
         $GtSdk = null;
         $recaptcha_sitekey = null;
-        if (Config::get('enable_reg_captcha') === 'true') {
+        if (Config::get('enable_reg_captcha') === true) {
             switch (Config::get('captcha_provider')) {
                 case 'recaptcha':
                     $recaptcha_sitekey = Config::get('recaptcha_sitekey');
@@ -242,7 +242,7 @@ class AuthController extends BaseController
 
     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);
 
@@ -335,7 +335,7 @@ class AuthController extends BaseController
         // check code
 
 
-        if (Config::get('enable_reg_captcha') === 'true') {
+        if (Config::get('enable_reg_captcha') === true) {
             switch (Config::get('captcha_provider')) {
                 case 'recaptcha':
                     $recaptcha = $request->getParam('recaptcha');
@@ -402,7 +402,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;
@@ -437,7 +437,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
@@ -530,7 +530,7 @@ class AuthController extends BaseController
             return $response->getBody()->write(json_encode($res));
         }
 
-        if (Config::get('enable_telegram') === 'true') {
+        if (Config::get('enable_telegram') === true) {
             $ret = TelegramSessionManager::check_login_session($token, $number);
             $res['ret'] = $ret;
             return $response->getBody()->write(json_encode($res));
@@ -542,7 +542,7 @@ class AuthController extends BaseController
 
     public function telegram_oauth($request, $response, $args)
     {
-        if (Config::get('enable_telegram') === 'true') {
+        if (Config::get('enable_telegram') === true) {
             $auth_data = $request->getQueryParams();
             if ($this->telegram_oauth_check($auth_data) === true) { // Looks good, proceed.
                 $telegram_id = $auth_data['id'];

+ 1 - 1
app/Controllers/HomeController.php

@@ -37,7 +37,7 @@ class HomeController extends BaseController
             }
         }
 
-        if (Config::get('enable_telegram') == 'true') {
+        if (Config::get('enable_telegram') == true) {
             $login_text = TelegramSessionManager::add_login_session();
             $login = explode('|', $login_text);
             $login_token = $login[0];

+ 13 - 13
app/Controllers/UserController.php

@@ -58,7 +58,7 @@ class UserController extends BaseController
 
         $GtSdk = null;
         $recaptcha_sitekey = null;
-        if (Config::get('enable_checkin_captcha') == 'true') {
+        if (Config::get('enable_checkin_captcha') == true) {
             switch (Config::get('captcha_provider')) {
                 case 'recaptcha':
                     $recaptcha_sitekey = Config::get('recaptcha_sitekey');
@@ -112,7 +112,7 @@ class UserController extends BaseController
 
     public function donate($request, $response, $args)
     {
-        if (Config::get('enable_donate') != 'true') {
+        if (Config::get('enable_donate') != true) {
             exit(0);
         }
 
@@ -268,7 +268,7 @@ class UserController extends BaseController
             $res['ret'] = 1;
             $res['msg'] = '充值成功,充值的金额为' . $codeq->number . '元。';
 
-            if (Config::get('enable_donate') == 'true') {
+            if (Config::get('enable_donate') == true) {
                 if ($this->user->is_hide == 1) {
                     Telegram::Send('姐姐姐姐,一位不愿透露姓名的大老爷给我们捐了 ' . $codeq->number . ' 元呢~');
                 } else {
@@ -648,7 +648,7 @@ class UserController extends BaseController
 
                 $node_prefix[$name_cheif][] = $node;
 
-                if (Config::get('enable_flag') == 'true') {
+                if (Config::get('enable_flag') == true) {
                     $regex = Config::get('flag_regex');
                     $matches = array();
                     preg_match($regex, $name_cheif, $matches);
@@ -1176,7 +1176,7 @@ class UserController extends BaseController
 
     public function ticket($request, $response, $args)
     {
-        if (Config::get('enable_ticket') != 'true') {
+        if (Config::get('enable_ticket') != true) {
             exit(0);
         }
         $pageNum = $request->getQueryParams()['page'] ?? 1;
@@ -1219,7 +1219,7 @@ class UserController extends BaseController
         $ticket->datetime = time();
         $ticket->save();
 
-        if (Config::get('mail_ticket') == 'true' && $markdown != '') {
+        if (Config::get('mail_ticket') == true && $markdown != '') {
             $adminUser = User::where('is_admin', '=', '1')->get();
             foreach ($adminUser as $user) {
                 $subject = Config::get('appName') . '-新工单被开启';
@@ -1236,7 +1236,7 @@ class UserController extends BaseController
             }
         }
 
-        if (Config::get('useScFtqq') == 'true' && $markdown != '') {
+        if (Config::get('useScFtqq') == true && $markdown != '') {
             $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
             $postdata = http_build_query(
                 array(
@@ -1286,7 +1286,7 @@ class UserController extends BaseController
         }
 
         if ($status == 1 && $ticket_main->status != $status) {
-            if (Config::get('mail_ticket') == 'true' && $markdown != '') {
+            if (Config::get('mail_ticket') == true && $markdown != '') {
                 $adminUser = User::where('is_admin', '=', '1')->get();
                 foreach ($adminUser as $user) {
                     $subject = Config::get('appName') . '-工单被重新开启';
@@ -1302,7 +1302,7 @@ class UserController extends BaseController
                     }
                 }
             }
-            if (Config::get('useScFtqq') == 'true' && $markdown != '') {
+            if (Config::get('useScFtqq') == true && $markdown != '') {
                 $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
                 $postdata = http_build_query(
                     array(
@@ -1321,7 +1321,7 @@ class UserController extends BaseController
                 $useScFtqq = Config::get('ScFtqq_SCKEY');
             }
         } else {
-            if (Config::get('mail_ticket') == 'true' && $markdown != '') {
+            if (Config::get('mail_ticket') == true && $markdown != '') {
                 $adminUser = User::where('is_admin', '=', '1')->get();
                 foreach ($adminUser as $user) {
                     $subject = Config::get('appName') . '-工单被回复';
@@ -1337,7 +1337,7 @@ class UserController extends BaseController
                     }
                 }
             }
-            if (Config::get('useScFtqq') == 'true' && $markdown != '') {
+            if (Config::get('useScFtqq') == true && $markdown != '') {
                 $ScFtqq_SCKEY = Config::get('ScFtqq_SCKEY');
                 $postdata = http_build_query(
                     array(
@@ -1649,7 +1649,7 @@ class UserController extends BaseController
 
     public function doCheckIn($request, $response, $args)
     {
-        if (Config::get('enable_checkin_captcha') == 'true') {
+        if (Config::get('enable_checkin_captcha') == true) {
             switch (Config::get('captcha_provider')) {
                 case 'recaptcha':
                     $recaptcha = $request->getParam('recaptcha');
@@ -1718,7 +1718,7 @@ class UserController extends BaseController
             return $this->echoJson($response, $res);
         }
 
-        if (Config::get('enable_kill') == 'true') {
+        if (Config::get('enable_kill') == true) {
             Auth::logout();
             $user->kill_user();
             $res['ret'] = 1;

+ 1 - 1
app/Controllers/VueController.php

@@ -39,7 +39,7 @@ class VueController extends BaseController
             }
         }
 
-        if (Config::get('enable_telegram') == 'true') {
+        if (Config::get('enable_telegram') == true) {
             $login_text = TelegramSessionManager::add_login_session();
             $login = explode('|', $login_text);
             $login_token = $login[0];

+ 2 - 2
app/Models/Shop.php

@@ -135,7 +135,7 @@ class Shop extends Model
             switch ($key) {
                 case 'bandwidth':
                     if ($is_renew == 0) {
-                        if (Config::get('enable_bought_reset') == 'true') {
+                        if (Config::get('enable_bought_reset') == true) {
                             $user->transfer_enable = $value * 1024 * 1024 * 1024;
                             $user->u = 0;
                             $user->d = 0;
@@ -160,7 +160,7 @@ class Shop extends Model
                     }
                     break;
                 case 'class':
-                    if (Config::get('enable_bought_extend') == 'true') {
+                    if (Config::get('enable_bought_extend') == true) {
                         if ($user->class == $value) {
                             $user->class_expire = date('Y-m-d H:i:s', strtotime($user->class_expire) + $content['class_expire'] * 86400);
                         } else {

+ 1 - 1
app/Services/Auth/Cookie.php

@@ -43,7 +43,7 @@ class Cookie extends Base
             return $user;
         }
 
-        if (Config::get('enable_login_bind_ip') == 'true') {
+        if (Config::get('enable_login_bind_ip') == true) {
             $nodes = Node::where('node_ip', '=', $_SERVER['REMOTE_ADDR'])->first();
             if (($nodes == null) && $ipHash != md5($_SERVER['REMOTE_ADDR'] . Config::get('key') . $uid . $expire_in)) {
                 return $user;

+ 1 - 1
app/Services/Auth/Redis.php

@@ -48,7 +48,7 @@ class Redis extends Base
 
         $ip = $this->client->get($sid . 'ip');
         $nodes = Node::where('node_ip', '=', $_SERVER['REMOTE_ADDR'])->first();
-        if ($ip != $_SERVER['REMOTE_ADDR'] && $nodes == null && Config::get('enable_login_bind_ip') == 'true') {
+        if ($ip != $_SERVER['REMOTE_ADDR'] && $nodes == null && Config::get('enable_login_bind_ip') == true) {
             $user = new User();
             $user->isLogin = false;
             return $user;

+ 1 - 1
app/Services/Boot.php

@@ -28,7 +28,7 @@ class Boot
         // Init Eloquent ORM Connection
         $capsule = new Capsule();
         $capsule->addConnection(Config::getDbConfig());
-        if (Config::get('enable_radius') == 'true') {
+        if (Config::get('enable_radius') == true) {
             $capsule->addConnection(Config::getRadiusDbConfig(), 'radius');
         }
         $capsule->bootEloquent();

+ 1 - 1
app/Services/Gateway/AbstractPayment.php

@@ -83,7 +83,7 @@ abstract class AbstractPayment
             $Payback->save();
         }
 
-        if (Config::get('enable_donate') == 'true') {
+        if (Config::get('enable_donate') == true) {
             if ($user->is_hide == 1) {
                 Telegram::Send('一位不愿透露姓名的大老爷给我们捐了 ' . $codeq->number . ' 元!');
             } else {

+ 1 - 1
app/Services/Gateway/PaymentWall.php

@@ -64,7 +64,7 @@ class PaymentWall extends AbstractPayment
                     $Payback->save();
                 }
                 echo 'OK'; // Paymentwall expects response to be OK, otherwise the pingback will be resent
-                if (Config::get('enable_donate') == 'true') {
+                if (Config::get('enable_donate') == true) {
                     if ($user->is_hide == 1) {
                         Telegram::Send('姐姐姐姐,一位不愿透露姓名的大老爷给我们捐了 ' . $codeq->number . ' 元呢~');
                     } else {

+ 1 - 1
app/Services/Mail/Smtp.php

@@ -21,7 +21,7 @@ class Smtp extends Base
         $mail->SMTPAuth = true;                               // Enable SMTP authentication
         $mail->Username = $this->config['username'];                 // SMTP username
         $mail->Password = $this->config['passsword'];                    // SMTP password
-        if (Config::get('smtp_ssl') == 'true') {
+        if ($_ENV['smtp_ssl'] == true) {
             $mail->SMTPSecure = (Config::get('smtp_port') == '587' ? 'tls' : 'ssl');                            // Enable TLS encryption, `ssl` also accepted
         }
         $mail->Port = $this->config['port'];                                    // TCP port to connect to

+ 5 - 5
app/Utils/Radius.php

@@ -17,7 +17,7 @@ class Radius
      */
     public static function Add($user, $pwd)
     {
-        if (Config::get('enable_radius') == 'true') {
+        if (Config::get('enable_radius') == true) {
             $email = $user->email;
             $email = str_replace(array('@', '.'), '', $email);
 
@@ -51,7 +51,7 @@ class Radius
 
     public static function Delete($email)
     {
-        if (Config::get('enable_radius') == 'true') {
+        if (Config::get('enable_radius') == true) {
             $email = str_replace(array('@', '.'), '', $email);
 
 
@@ -66,7 +66,7 @@ class Radius
 
     public static function ChangeUserName($origin_email, $new_email, $passwd)
     {
-        if (Config::get('enable_radius') == 'true') {
+        if (Config::get('enable_radius') == true) {
             $email1 = str_replace(array('@', '.'), '', $origin_email);
             $email2 = str_replace(array('@', '.'), '', $new_email);
 
@@ -105,7 +105,7 @@ class Radius
 
     public static function AddNas($ip, $name)
     {
-        if (Config::get('enable_radius') == 'true') {
+        if (Config::get('enable_radius') == true) {
             $exists = RadiusNas::where('shortname', $ip)->first();
             if ($exists == null) {
                 $exists = new RadiusNas();
@@ -121,7 +121,7 @@ class Radius
 
     public static function DelNas($ip)
     {
-        if (Config::get('enable_radius') == 'true') {
+        if (Config::get('enable_radius') == true) {
             RadiusNas::where('shortname', $ip)->delete();
         }
     }

+ 2 - 2
app/Utils/Telegram.php

@@ -14,7 +14,7 @@ class Telegram
      */
     public static function Send($messageText)
     {
-        if (Config::get('enable_telegram') == 'true') {
+        if (Config::get('enable_telegram') == true) {
             $bot = new BotApi(Config::get('telegram_token'));
             try {
                 $bot->sendMessage(Config::get('telegram_chatid'), $messageText);
@@ -27,7 +27,7 @@ class Telegram
 
     public static function SendMarkdown($messageText)
     {
-        if (Config::get('enable_telegram') == 'true') {
+        if (Config::get('enable_telegram') == true) {
             $bot = new BotApi(Config::get('telegram_token'));
             try {
                 $bot->sendMessage(Config::get('telegram_chatid'), $messageText, 'Markdown');

+ 2 - 2
app/Utils/TelegramProcess.php

@@ -221,7 +221,7 @@ class TelegramProcess
             }
         } else {
             //群组
-            if (Config::get('telegram_group_quiet') == 'true') {
+            if (Config::get('telegram_group_quiet') == true) {
                 return;
             }
             $bot->sendChatAction($message->getChat()->getId(), 'typing');
@@ -257,7 +257,7 @@ class TelegramProcess
                             $reply['message'] = '不约,叔叔我们不约';
                         }
                     }
-                    if ($message->getNewChatMember() != null && Config::get('enable_welcome_message') == 'true') {
+                    if ($message->getNewChatMember() != null && Config::get('enable_welcome_message') == true) {
                         $reply['message'] = '欢迎 ' . $message->getNewChatMember()->getFirstName() . ' ' . $message->getNewChatMember()->getLastName();
                     } else {
                         $reply['message'] = null;

+ 1 - 1
app/Utils/Tools.php

@@ -280,7 +280,7 @@ class Tools
 
         $relay_able_list = Config::getSupportParam('relay_able_protocol');
 
-        return in_array($user->protocol, $relay_able_list) || Config::get('relay_insecure_mode') == 'true';
+        return in_array($user->protocol, $relay_able_list) || Config::get('relay_insecure_mode') == true;
     }
 
     public static function has_conflict_rule($input_rule, $ruleset, $edit_rule_id = 0, $origin_node_id = 0, $user_id = 0)

+ 1 - 1
app/Utils/Tuling.php

@@ -8,7 +8,7 @@ class Tuling
 {
     public static function chat($user, $text)
     {
-        if (Config::get('enable_tuling') == 'true') {
+        if (Config::get('enable_tuling') == true) {
             $data = array();
             $data['key'] = Config::get('tuling_apikey');
             $data['userid'] = $user;

+ 5 - 5
app/Utils/URL.php

@@ -243,7 +243,7 @@ class URL
         if (strtotime($user->expire_in) < time()) {
             return $return_url;
         }
-        if (Config::get('mergeSub') == 'true') {
+        if (Config::get('mergeSub') == true) {
             $items = array_merge(self::getAllItems($user, 1, $is_ss), self::getAllItems($user, 0, $is_ss));
         } else {
             $items = self::getAllItems($user, $is_mu, $is_ss);
@@ -531,7 +531,7 @@ class URL
             $mu_user->obfs_param = $user->getMuMd5();
             $mu_user->protocol_param = $user->id . ':' . $user->passwd;
             $user = $mu_user;
-            if (Config::get('mergeSub') != 'true') {
+            if (Config::get('mergeSub') != true) {
                 $node_name .= ' - ' . $mu_port . ' 单端口';
             }
         }
@@ -571,7 +571,7 @@ class URL
         $return_array['method'] = $user->method;
         $return_array['remark'] = $node_name;
         $return_array['group'] = Config::get('appName');
-        if ($mu_port != 0 && Config::get('mergeSub') != 'true') {
+        if ($mu_port != 0 && Config::get('mergeSub') != true) {
             $return_array['group'] .= ' - 单端口';
         }
         $return_array['ratio'] = ($relay_rule != null
@@ -588,7 +588,7 @@ class URL
     public static function getUserTraffic($user, $is_mu = 0)
     {
         $group_name = Config::get('appName');
-        if ($is_mu == 1 && Config::get('mergeSub') != 'true') {
+        if ($is_mu == 1 && Config::get('mergeSub') != true) {
             $group_name .= ' - 单端口';
         }
         if (strtotime($user->expire_in) > time()) {
@@ -607,7 +607,7 @@ class URL
     public static function getUserClassExpiration($user, $is_mu = 0)
     {
         $group_name = Config::get('appName');
-        if ($is_mu == 1 && Config::get('mergeSub') != 'true') {
+        if ($is_mu == 1 && Config::get('mergeSub') != true) {
             $group_name .= ' - 单端口';
         }
         if (strtotime($user->expire_in) > time()) {

+ 145 - 145
config/.config.example.php

@@ -11,7 +11,7 @@ crisp已被替换为mylivechat
 telegrma_qrcode被重命名为qrcode
 
 ';
-$_ENV['version']='1';	//仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
+$_ENV['version'] = '1';	//仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
 
 
 //基本设置--------------------------------------------------------------------------------------------
@@ -19,8 +19,8 @@ $_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['subUrl'] = $_ENV['baseUrl'] . '/link/';	//订阅地址,如需和站点名称相同,请不要修改
+$_ENV['muKey'] = 'default_mu_key';								//用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作!
 $_ENV['db_driver'] = 'mysql';							//数据库程序
 $_ENV['db_host'] = 'localhost';						//数据库地址
 $_ENV['db_database'] = 'sspanel';						//数据库名
@@ -40,11 +40,11 @@ $_ENV['mailgun_sender'] = '';
 # smtp
 $_ENV['smtp_host'] = '';
 $_ENV['smtp_username'] = '';
-$_ENV['smtp_port'] = '465';
+$_ENV['smtp_port'] = 465;
 $_ENV['smtp_name'] = '';
 $_ENV['smtp_sender'] = '';
 $_ENV['smtp_passsword'] = '';
-$_ENV['smtp_ssl'] = 'true';
+$_ENV['smtp_ssl'] = true;
 
 # sendgrid
 $_ENV['sendgrid_key'] = '';
@@ -52,105 +52,105 @@ $_ENV['sendgrid_sender'] = '';
 
 
 //备份设置--------------------------------------------------------------------------------------------
-$_ENV['auto_backup_email']='';		//接收备份的邮箱
-$_ENV['auto_backup_passwd']='';	//备份的压缩密码
-$_ENV['backup_notify']='true';		//备份通知到TG群中
+$_ENV['auto_backup_email'] = '';		//接收备份的邮箱
+$_ENV['auto_backup_passwd'] = '';	//备份的压缩密码
+$_ENV['backup_notify'] = true;		//备份通知到TG群中
 
 
 //用户注册设置-----------------------------------------------------------------------------------------
 $_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 代表上面这个后缀。
+$_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 代表上面这个后缀。
 
 #邀请链接
-$_ENV['inviteNum'] = '10';			//注册后的邀请链接可用次数
-$_ENV['invite_get_money']='1';		//新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
-$_ENV['invite_price']='-1';		//用户购买邀请码所需要的价格,价格小于0时视为不开放购买
-$_ENV['custom_invite_price']='-1';		//用户定制邀请码所需要的价格,价格小于0时视为不开放购买
+$_ENV['inviteNum'] = 10;			//注册后的邀请链接可用次数
+$_ENV['invite_get_money'] = 1;		//新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
+$_ENV['invite_price'] = -1;		//用户购买邀请码所需要的价格,价格小于0时视为不开放购买
+$_ENV['custom_invite_price'] = -1;		//用户定制邀请码所需要的价格,价格小于0时视为不开放购买
 
 #邮箱验证
-$_ENV['enable_email_verify']='false';		//是否启用注册邮箱验证码
-$_ENV['email_verify_ttl']='3600';			//邮箱验证码有效期
-$_ENV['email_verify_iplimit']='10';		//验证码有效期内,单IP可请求验证码次数
+$_ENV['enable_email_verify'] = false;		//是否启用注册邮箱验证码
+$_ENV['email_verify_ttl'] = 3600;			//邮箱验证码有效期
+$_ENV['email_verify_iplimit'] = 10;		//验证码有效期内,单IP可请求验证码次数
 
 
 //已注册用户设置---------------------------------------------------------------------------------------
 #基础
-$_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时视为不开放购买
+$_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时视为不开放购买
 
 #高级
-$_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
+$_ENV['class_expire_reset_traffic'] = 0;		//等级到期时重置为的流量值,单位GB,小于0时不重置
+$_ENV['account_expire_delete_days'] = -1;		//账户到期几天之后会删除账户,小于0时不删除
+$_ENV['enable_kill'] = true;					//是否允许用户注销账户
+$_ENV['notify_limit_mode'] = true;			//false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
+$_ENV['notify_limit_value'] = 20;			//当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
+$_ENV['mergeSub'] = true;						//合并订阅设置 可选项 false / true
 
 //Bot 设置--------------------------------------------------------------------------------------------
 #通用
-$_ENV['qrcode']='zxing_local';				//二维码解码方式,online,phpzbar,zxing_online,zxing_local
-$_ENV['finance_public']='false';			//财务报告是否向群公开
-$_ENV['enable_welcome_message']='true';	//机器人发送欢迎消息
+$_ENV['qrcode'] = 'zxing_local';				//二维码解码方式,online,phpzbar,zxing_online,zxing_local
+$_ENV['finance_public'] = true;			//财务报告是否向群公开
+$_ENV['enable_welcome_message'] = true;	//机器人发送欢迎消息
 
 #Telegram
-$_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
+$_ENV['enable_telegram'] = true;			//是否开启Telegram bot
+$_ENV['telegram_token'] = '';				//Telegram bot,bot 的 token ,跟 father bot 申请
+$_ENV['telegram_chatid'] = '';				//Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。
+$_ENV['enable_tuling'] = true;			//是否开启图灵机器人
+$_ENV['tuling_apikey'] = '';					//图灵机器人API Key
+$_ENV['tuling_apisecert'] = '';				//图灵机器人密钥
+$_ENV['telegram_bot'] = '_bot';				//Telegram 机器人账号
+$_ENV['telegram_group_quiet'] = true;		//Telegram 机器人在群组中不回应
+$_ENV['telegram_request_token'] = '';		//Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram
 
 
 //沟通设置--------------------------------------------------------------------------------------------
 #客服系统设置,注册地址 https://www.mylivechat.com
-$_ENV['enable_mylivechat']='false';		//是否开启客服系统
-$_ENV['mylivechat_id']='null';			//客服系统ID
+$_ENV['enable_mylivechat'] = true;		//是否开启客服系统
+$_ENV['mylivechat_id'] = '';			//客服系统ID
 
 # PushBear  基于微信模板的向关注了二维码的用户以微信方式推送消息 https://pushbear.ftqq.com/
-$_ENV['usePushBear'] = 'false';		// true 启用	false 禁用
+$_ENV['usePushBear'] = true;		// true 启用	false 禁用
 $_ENV['PushBear_sendkey'] = '';	//请填写您在PushBear获取的sendkey  请仔细检查勿粘贴错
 
 #工单系统设置
-$_ENV['enable_ticket']='true';		//是否开启工单系统
-$_ENV['mail_ticket']='true';		//是否开启工单邮件提醒
+$_ENV['enable_ticket'] = true;		//是否开启工单系统
+$_ENV['mail_ticket'] = true;		//是否开启工单邮件提醒
 
 # Server酱  用户提交新工单或者回复工单时用微信提醒机场主 http://sc.ftqq.com/
-$_ENV['useScFtqq'] = 'false';		//是否开启工单Server酱提醒
+$_ENV['useScFtqq'] = true;		//是否开启工单Server酱提醒
 $_ENV['ScFtqq_SCKEY'] = '';	//请填写您在Server酱获取的SCKEY  请仔细检查勿粘贴错
 
 #管理员联系方式设置
-$_ENV['enable_admin_contact']='false';			//是否开启管理员联系方式
+$_ENV['enable_admin_contact'] = true;			//是否开启管理员联系方式
 $_ENV['admin_contact1'] = 'QQ:1233456';		//QQ、邮箱、微信仅用于举例
 $_ENV['admin_contact2'] = '邮箱[email protected]';	//也可以写电话、tg等其他联系方式
 $_ENV['admin_contact3'] = '微信~123456';		//没有格式要求,想怎么写就怎么写,可留空
@@ -166,54 +166,54 @@ $_ENV['recaptcha_secret'] = '';
 $_ENV['geetest_id'] = '';
 $_ENV['geetest_key'] = '';
 
-$_ENV['enable_reg_captcha'] = 'false';		//启用注册验证码
-$_ENV['enable_login_captcha'] = 'false';	//启用登录验证码
-$_ENV['enable_checkin_captcha'] = 'false';	//启用签到验证码
+$_ENV['enable_reg_captcha'] = true;		//启用注册验证码
+$_ENV['enable_login_captcha'] = true;	//启用登录验证码
+$_ENV['enable_checkin_captcha'] = true;	//启用签到验证码
 
 
 //支付系统设置----------------------------------------------------------------------------------------
 #取值 none | codepay | f2fpay | chenAlipay | paymentwall | spay |tomatopay | payjs | yftpay
-$_ENV['payment_system']='none';
+$_ENV['payment_system'] = 'none';
 
 #yft支付设置
-$_ENV['yft_secret']='';
-$_ENV['yft_accesskey']='';
+$_ENV['yft_secret'] = '';
+$_ENV['yft_accesskey'] = '';
 
 #codepay码支付
 #wiki地址:https://goo.gl/dRwRDi  http://t.cn/RnsWjtB
-$_ENV['codepay_id']='';					//码支付ID
-$_ENV['codepay_key']='';					//码支付通信密钥
+$_ENV['codepay_id'] = '';					//码支付ID
+$_ENV['codepay_key'] = '';					//码支付通信密钥
 
 #alipay,f2fpay
-$_ENV['f2fpay_app_id']='';
-$_ENV['f2fpay_p_id']='';
-$_ENV['alipay_public_key']='';
-$_ENV['merchant_private_key']='';
-$_ENV['f2fNotifyUrl']=null;                  //自定义当面付回调地址
+$_ENV['f2fpay_app_id'] = '';
+$_ENV['f2fpay_p_id'] = '';
+$_ENV['alipay_public_key'] = '';
+$_ENV['merchant_private_key'] = '';
+$_ENV['f2fNotifyUrl'] = null;                  //自定义当面付回调地址
 
 #PaymentWall
-$_ENV['pmw_publickey']='';
-$_ENV['pmw_privatekey']='';
-$_ENV['pmw_widget']='m2_1';
-$_ENV['pmw_height']='350px';
+$_ENV['pmw_publickey'] = '';
+$_ENV['pmw_privatekey'] = '';
+$_ENV['pmw_widget'] = 'm2_1';
+$_ENV['pmw_height'] = '350px';
 
 #alipay,spay
-$_ENV['alipay_id']='';
-$_ENV['alipay_key']='';
-$_ENV['amount']=[2,23,233,2333,23333];		//充值金额选项设定
+$_ENV['alipay_id'] = '';
+$_ENV['alipay_key'] = '';
+$_ENV['amount'] = [2, 23, 233, 2333, 23333];		//充值金额选项设定
 
 #alipay,zfbjk.com
-$_ENV['zfbjk_pid']='';
-$_ENV['zfbjk_key']='';
-$_ENV['zfbjk_qrcodeurl']='';
+$_ENV['zfbjk_pid'] = '';
+$_ENV['zfbjk_key'] = '';
+$_ENV['zfbjk_qrcodeurl'] = '';
 
 # BitPay 数字货币支付(比特币、以太坊、EOS等) 商户后台获取授权码 https://merchants.mugglepay.com/
 #   客服和技术 24x7 在线支持: https://t.me/joinchat/GLKSKhUnE4GvEAPgqtChAQ
-$_ENV['bitpay_secret']='';
+$_ENV['bitpay_secret'] = '';
 
 #PayJs
-$_ENV['payjs_mchid']='';
-$_ENV['payjs_key']='';
+$_ENV['payjs_mchid'] = '';
+$_ENV['payjs_key'] = '';
 
 #tomatopay番茄云支付
 #使用教程:https://swapidc.fanqieui.com/?t/329.html  tg群 https://t.me/fanqiepay
@@ -233,64 +233,64 @@ $_ENV['tomatopay'] = [
 
 //其他面板显示设置------------------------------------------------------------------------------------------
 #后台商品列表 销量统计
-$_ENV['sales_period']='30';	//统计指定周期内的销量,值为【expire/任意大于0的整数】
+$_ENV['sales_period'] = 30;	//统计指定周期内的销量,值为【expire/任意大于0的整数】
 
 #国旗
-$_ENV['enable_flag']='false';			//启用该项之前务必先仔细阅读教程
-$_ENV['flag_regex']='/.*?(?=\s)/';		//从站点全名中匹配【国家/地区】的正则表达式(php版)
+$_ENV['enable_flag'] = true;			//启用该项之前务必先仔细阅读教程
+$_ENV['flag_regex'] = '/.*?(?=\s)/';		//从站点全名中匹配【国家/地区】的正则表达式(php版)
 
 #捐赠
-$_ENV['enable_donate']='false';	//是否显示用户捐赠(所有收入将被公开)
+$_ENV['enable_donate'] = true;	//是否显示用户捐赠(所有收入将被公开)
 
 #iOS账户显示
-$_ENV['display_ios_class']='-1';	//至少等级为多少的用户可以看见,小于0时关闭此功能
-$_ENV['display_ios_topup']='0';	//满足等级要求后,累计充值高于多少的用户可以看见
-$_ENV['ios_account']='';			//iOS账户
-$_ENV['ios_password']='';			//iOS密码
+$_ENV['display_ios_class'] = -1;	//至少等级为多少的用户可以看见,小于0时关闭此功能
+$_ENV['display_ios_topup'] = 0;	//满足等级要求后,累计充值高于多少的用户可以看见
+$_ENV['ios_account'] = '';			//iOS账户
+$_ENV['ios_password'] = '';			//iOS密码
 
 
 //节点检测-----------------------------------------------------------------------------------------------
 #GFW检测,请通过crontab进行【开启/关闭】
-$_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';												//尝试次数
+$_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';												//尝试次数
 
 #离线检测
-$_ENV['enable_detect_offline']='true';
+$_ENV['enable_detect_offline'] = true;
 #离线检测是否推送到Server酱 请配置好上文的Server配置
-$_ENV['enable_detect_offline_useScFtqq']='true';
+$_ENV['enable_detect_offline_useScFtqq'] = true;
 
 
 //V2Ray相关设置------------------------------------------------------------------------------------------
-$_ENV['v2ray_port']='443';					//V2Ray端口
-$_ENV['v2ray_protocol']='HTTP/2 + TLS';	//V2Ray协议
-$_ENV['v2ray_alter_id']='32';
-$_ENV['v2ray_level']='0';
+$_ENV['v2ray_port'] = 443;					//V2Ray端口
+$_ENV['v2ray_protocol'] = 'HTTP/2 + TLS';	//V2Ray协议
+$_ENV['v2ray_alter_id'] = 32;
+$_ENV['v2ray_level'] = '0';
 
 //以下所有均为高级设置(一般用不上,不用改---------------------------------------------------------------------
 #杂项
-$_ENV['enable_login_bind_ip']='false';		//是否将登陆线程和IP绑定
-$_ENV['rememberMeDuration']='7';           //登录时记住账号时长天数
+$_ENV['enable_login_bind_ip'] = true;		//是否将登陆线程和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['jump_delay'] = 1200;				//跳转延时,单位ms,不建议太长
+$_ENV['theme'] = 'material';			//主题
+$_ENV['pacp_offset'] = -20000;				//VPN 端口偏移
+$_ENV['pacpp_offset'] = -20000;
+$_ENV['Speedtest_duration'] = 6;			//显示多长时间的测速记录
+$_ENV['login_warn'] = true;				//异地登陆提示
 $_ENV['timeZone'] = 'PRC';					//PRC 天朝时间  UTC 格林时间
 $_ENV['db_charset'] = 'utf8';
 $_ENV['db_collation'] = 'utf8_general_ci';
 $_ENV['db_prefix'] = '';
-$_ENV['muKeyList'] = [' '];                //多 key 列表
-$_ENV['subscribe_client'] = 'false';        //下载协议客户端时附带节点和订阅信息
+$_ENV['muKeyList'] = [];                //多 key 列表
+$_ENV['subscribe_client'] = true;        //下载协议客户端时附带节点和订阅信息
 
 #aws
 $_ENV['aws_access_key_id'] = '';
@@ -299,36 +299,36 @@ $_ENV['aws_secret_access_key'] = '';
 #redis
 $_ENV['redis_scheme'] = 'tcp';
 $_ENV['redis_host'] = '127.0.0.1';
-$_ENV['redis_port'] = '6379';
-$_ENV['redis_database'] = '0';
+$_ENV['redis_port'] = 6379;
+$_ENV['redis_database'] = '';
 $_ENV['redis_password']= '';
 
 #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连接密钥
+$_ENV['enable_radius'] = true;			//是否开启Radius
+$_ENV['radius_db_host'] = '';				//以下4项为Radius数据库设置
+$_ENV['radius_db_database'] = '';
+$_ENV['radius_db_user'] = '';
+$_ENV['radius_db_password'] = '';
+$_ENV['radius_secret'] = '';					//Radius连接密钥
 
 #Cloudxns
-$_ENV['enable_cloudxns']='false';			//是否开启Cloudxns
-$_ENV['cloudxns_apikey']='';				//自己去 cloudxns.net 申请
-$_ENV['cloudxns_apisecret']='';
-$_ENV['cloudxns_domain']='';		//你的域名
+$_ENV['enable_cloudxns'] = true;			//是否开启Cloudxns
+$_ENV['cloudxns_apikey'] = '';				//自己去 cloudxns.net 申请
+$_ENV['cloudxns_apisecret'] = '';
+$_ENV['cloudxns_domain'] = '';		//你的域名
 
 #Cloudflare
-$_ENV['cloudflare_enable']='false';										//是否开启 Cloudflare 解析
-$_ENV['cloudflare_email']='[email protected]';								//Cloudflare 邮箱地址
-$_ENV['cloudflare_key']='c2547eb745079dac9320b638f5e225cf483cc5cfdda41';	//Cloudflare API Key
-$_ENV['cloudflare_name']='example.com';									//域名
+$_ENV['cloudflare_enable'] = true;										//是否开启 Cloudflare 解析
+$_ENV['cloudflare_email'] = '[email protected]';								//Cloudflare 邮箱地址
+$_ENV['cloudflare_key'] = 'c2547eb745079dac9320b638f5e225cf483cc5cfdda41';	//Cloudflare API Key
+$_ENV['cloudflare_name'] = 'example.com';									//域名
 
 #不安全中转模式,这个开启之后使用除了 auth_aes128_md5 或者 auth_aes128_sha1 以外的协议地用户也可以设置和使用中转
-$_ENV['relay_insecure_mode']='false';		//强烈推荐不开启
+$_ENV['relay_insecure_mode'] = true;		//强烈推荐不开启
 
 #是否夹带统计代码,自己在 resources/views/{主题名} 下创建一个 analytics.tpl ,如果有必要就用 literal 界定符
-$_ENV['enable_analytics_code']='false';
-$_ENV['sspanelAnalysis'] = 'true';
+$_ENV['enable_analytics_code'] = true;
+$_ENV['sspanelAnalysis'] = true;
 
 #在套了CDN之后获取用户真实ip,如果您不知道这是什么,请不要乱动
 if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) {

+ 3 - 3
resources/views/material/auth/register.tpl

@@ -87,7 +87,7 @@
                             </div>
                         </div>
                     {/if}
-                    {if $enable_email_verify == 'true'}
+                    {if $enable_email_verify == true}
                         <div class="rowtocol">
                             <div class="rowtocol">
                                 <div class="form-group form-group-label">
@@ -276,7 +276,7 @@ document.getElementById('passwd').addEventListener('input', checkStrong);
                         {/if}
 
                         imtype: $$getValue('imtype'),
-                        code{if $enable_email_verify == 'true'},
+                        code{if $enable_email_verify == true},
                         emailcode: $$getValue('email_code'){/if}{if $geetest_html != null},
                         geetest_challenge: validate.geetest_challenge,
                         geetest_validate: validate.geetest_validate,
@@ -351,7 +351,7 @@ document.getElementById('passwd').addEventListener('input', checkStrong);
     </script>
 {/if}
 
-{if $enable_email_verify == 'true'}
+{if $enable_email_verify == true}
     <script>
         var wait = 60;