增强判断

dev
GeekQu 7 years ago
parent b57f817475
commit 96db900a6b
No known key found for this signature in database
GPG Key ID: F0EEABFCD04A5891

@ -52,7 +52,7 @@ class DailyMail
$sts = new Analytics();
if (Config::get('sendDiary_Telegram')) {
if (Config::get('sendDiary_Telegram') === true) {
Telegram::Send(
str_replace(
array(

@ -160,7 +160,7 @@ class Job
EmailVerify::where('expire_in', '<', time() - 86400 * 3)->delete();
system('rm ' . BASE_PATH . '/storage/*.png', $ret);
if (Config::get('sendDailyJob_Telegram')) {
if (Config::get('sendDailyJob_Telegram') === true) {
Telegram::Send(Config::get('sendDailyJob_Msg'));
}
@ -491,7 +491,7 @@ class Job
);
}
if (Config::get('sendNodeOffline_Telegram')) {
if (Config::get('sendNodeOffline_Telegram') === true) {
Telegram::Send($notice_text);
}
@ -544,7 +544,7 @@ class Job
);
}
if (Config::get('sendNodeOnline_Telegram')) {
if (Config::get('sendNodeOnline_Telegram') === true) {
Telegram::Send($notice_text);
}
@ -873,7 +873,7 @@ class Job
Config::get('sendNodeGFW_Msg')
);
}
if (Config::get('sendNodeGFW_Telegram')) {
if (Config::get('sendNodeGFW_Telegram') === true) {
Telegram::Send($notice_text);
}
$file_node = fopen(BASE_PATH . '/storage/' . $node->id . '.gfw', 'wb+');
@ -904,7 +904,7 @@ class Job
Config::get('sendNodeGFW_recover_Msg')
);
}
if (Config::get('sendNodeGFW_recover_Telegram')) {
if (Config::get('sendNodeGFW_recover_Telegram') === true) {
Telegram::Send($notice_text);
}
unlink(BASE_PATH . '/storage/' . $node->id . '.gfw');

@ -97,7 +97,7 @@ class NodeController extends AdminController
CloudflareDriver::updateRecord($domain_name[0], $node->node_ip);
}
if (Config::get('sendAddNode_Telegram')) {
if (Config::get('sendAddNode_Telegram') === true) {
Telegram::Send(
str_replace(
'%node_name%',
@ -194,7 +194,7 @@ class NodeController extends AdminController
$node->save();
if (Config::get('sendUpdateNode_Telegram')) {
if (Config::get('sendUpdateNode_Telegram') === true) {
Telegram::Send(
str_replace(
'%node_name%',
@ -224,7 +224,7 @@ class NodeController extends AdminController
return $response->getBody()->write(json_encode($rs));
}
if (Config::get('sendDeleteNode_Telegram')) {
if (Config::get('sendDeleteNode_Telegram') === true) {
Telegram::Send(
str_replace(
'%node_name%',

@ -49,7 +49,7 @@ class HomeController extends BaseController
$login_number = '';
}
if (!Config::get('newIndex') && Config::get('theme') == 'material') {
if (Config::get('newIndex') === false && Config::get('theme') == 'material') {
return $response->write($this->view()->fetch('indexold.tpl'));
} else {
return $response->write($this->view()
@ -190,11 +190,11 @@ class HomeController extends BaseController
public function getDocCenter($request, $response, $args)
{
$user = Auth::getUser();
if (!$user->isLogin && !Config::get('enable_documents')) {
if (!$user->isLogin && Config::get('enable_documents') === false) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/');
return $newResponse;
}
$basePath = Config::get('remote_documents') ? Config::get('documents_source') : '/docs/GeekQu';
$basePath = Config::get('remote_documents') === true ? Config::get('documents_source') : '/docs/GeekQu';
return $this->view()
->assign('appName', Config::get('documents_name'))
->assign('basePath', $basePath)

@ -90,7 +90,7 @@ class LinkController extends BaseController
$find = true;
}
$emoji = ((isset($opts['emoji']) && $opts['emoji'] == '1') || Config::get('add_emoji_to_node_name')
$emoji = ((isset($opts['emoji']) && $opts['emoji'] == '1') || Config::get('add_emoji_to_node_name') === true
? 1
: 0);
@ -194,7 +194,7 @@ class LinkController extends BaseController
}
// 记录订阅日志
if (Config::get('subscribeLog')) {
if (Config::get('subscribeLog') === true) {
self::Subscribe_log($user, $subscribe_type, $request->getHeaderLine('User-Agent'));
}

@ -62,7 +62,7 @@ class FuncController extends BaseController
$server = null;
}
if (Config::get('relay_port_migration')) {
if (Config::get('relay_port_migration') === true) {
foreach ($rules as $rule) {
$dis = $this->get_dis_node_info($rule['dist_node_id']);
if ($dis != null) {

@ -61,7 +61,7 @@ class UserController extends BaseController
*/
$users_raw = User::where(
static function ($query) use ($node, $mu_port_migration) {
if ($mu_port_migration) {
if ($mu_port_migration === true) {
$query->where(
static function ($query1) use ($node) {
if ($node->node_group != 0) {
@ -92,7 +92,7 @@ class UserController extends BaseController
)->where('enable', 1)->where("detect_ban", 0)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
// 单端口承载用户
if ($mu_port_migration) {
if ($mu_port_migration === true) {
$mu_users_raw = User::where(
static function ($query) use ($node) {
$query->where(
@ -134,7 +134,7 @@ class UserController extends BaseController
$users = array();
if (Config::get('keep_connect')) {
if (Config::get('keep_connect') === true) {
foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
@ -298,7 +298,7 @@ class UserController extends BaseController
return $this->echoJson($response, $res);
}
if (Config::get('enable_auto_detect_ban')) {
if (Config::get('enable_auto_detect_ban') === true) {
$detect_Users = array();
if (count($data) > 0) {
foreach ($data as $log) {
@ -358,7 +358,7 @@ class UserController extends BaseController
if ($User == null) {
continue;
}
if ($User->detect_ban == 1 || ($User->is_admin && Config::get('auto_detect_ban_allow_admin')) || in_array($User->id, Config::get('auto_detect_ban_allow_users'))) {
if ($User->detect_ban == 1 || ($User->is_admin && Config::get('auto_detect_ban_allow_admin') === true) || in_array($User->id, Config::get('auto_detect_ban_allow_users'))) {
continue;
}
if (Config::get('auto_detect_ban_type') == 1) {

@ -326,7 +326,7 @@ class URL
if ($is_ss == 2) {
$personal_info = $item['method'] . ':' . $item['passwd'] . '@' . $item['address'] . ':' . $item['port'];
$ssurl = 'ss://' . Tools::base64_url_encode($personal_info);
$ssurl .= (Config::get('add_appName_to_ss_uri')
$ssurl .= (Config::get('add_appName_to_ss_uri') === true
? '#' . rawurlencode(Config::get('appName') . ' - ' . $item['remark'])
: '#' . rawurlencode($item['remark']));
} else {
@ -348,7 +348,7 @@ class URL
} else {
$ssurl .= '/?group=' . Tools::base64_url_encode(Config::get('appName'));
}
$ssurl .= (Config::get('add_appName_to_ss_uri')
$ssurl .= (Config::get('add_appName_to_ss_uri') === true
? '#' . rawurlencode(Config::get('appName') . ' - ' . $item['remark'])
: '#' . rawurlencode($item['remark']));
}

@ -112,7 +112,7 @@
<li><a href="/admin/user"><i class="icon icon-lg">supervisor_account</i>&nbsp;用户列表</a></li>
<li><a href="/admin/relay"><i class="icon icon-lg">compare_arrows</i>&nbsp;中转规则</a></li>
<li><a href="/admin/invite"><i class="icon icon-lg">loyalty</i>&nbsp;邀请与返利</a></li>
{if $config['subscribeLog']}
{if $config['subscribeLog']===true}
<li><a href="/admin/subscribe"><i class="icon icon-lg">dialer_sip</i>&nbsp;订阅记录</a></li>
{/if}
<li><a href="/admin/login"><i class="icon icon-lg">text_fields</i>&nbsp;登录记录</a></li>

@ -15,7 +15,7 @@
<div class="card-inner">
<p>为了爱与和平,也同时为了系统的正常运行,特制定了如下过滤规则,当您使用节点执行这些动作时,您的通信就会被截断。</p>
<p>关于隐私:注意,我们仅用以下规则进行实时匹配和记录匹配到的规则,您的通信方向和通信内容我们不会做任何记录,请您放心。也请您理解我们对于这些不当行为的管理,谢谢。</p>
{if $config['enable_auto_detect_ban']}
{if $config['enable_auto_detect_ban']===true}
{if $config['auto_detect_ban_type']==1}
<p>请注意,每当您触发审计规则 <strong>{$config['auto_detect_ban_number']}</strong> 次,将会被停止使用服务 <strong>{$config['auto_detect_ban_time']}</strong> 分钟</p>
{else}

@ -40,7 +40,7 @@
{if !$config['protocol_specify']}
{if $config['protocol_specify']===false}
<div class="card margin-bottom-no">
<div class="card-main">
<div class="card-inner">

@ -424,15 +424,15 @@ table tr td:first-child {
</div>
<div class="tab-pane fade" id="sub_center_windows">
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="{if $config["subscribe_client"]}/user/getPcClient?type=ss-win{else}https://github.com/shadowsocks/shadowsocks-windows/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SS - [ SS ]:</p>
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="{if $config["subscribe_client"]===true}/user/getPcClient?type=ss-win{else}https://github.com/shadowsocks/shadowsocks-windows/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SS - [ SS ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/Windows/Shadowsocks"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a id="win_ss" class="copy-config btn-dl" onclick=Copyconfig("/user/getUserAllURL?type=ss","#win_ss","")><i class="material-icons icon-sm">how_to_vote</i>全部 URL</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_2</span> <a class="btn-dl" href="{if $config["subscribe_client"]}/user/getPcClient?type=ssd-win{else}https://github.com/CGDF-Github/SSD-Windows/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SSD - [ SS ]:</p>
<p><span class="icon icon-lg text-white">filter_2</span> <a class="btn-dl" href="{if $config["subscribe_client"]===true}/user/getPcClient?type=ssd-win{else}https://github.com/CGDF-Github/SSD-Windows/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SSD - [ SS ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/Windows/ShadowsocksD"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["ssd"]}"><i class="material-icons icon-sm">how_to_vote</i>拷贝链接</a>.<a id="win_ssd" class="copy-config btn-dl" onclick=Copyconfig("/user/getUserAllURL?type=ssd","#win_ssd","")><i class="material-icons icon-sm">how_to_vote</i>全部 URL</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_3</span> <a class="btn-dl" href="{if $config["subscribe_client"]}/user/getPcClient?type=ssr-win{else}https://github.com/shadowsocksrr/shadowsocksr-csharp/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SSR(R) - [ SS/SSR ]:</p>
<p><span class="icon icon-lg text-white">filter_3</span> <a class="btn-dl" href="{if $config["subscribe_client"]===true}/user/getPcClient?type=ssr-win{else}https://github.com/shadowsocksrr/shadowsocksr-csharp/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SSR(R) - [ SS/SSR ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/Windows/ShadowsocksR"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["ssr"]}&extend=1"><i class="material-icons icon-sm">how_to_vote</i>订阅链接</a>.<a id="win_ssr" class="copy-config btn-dl" onclick=Copyconfig("/user/getUserAllURL?type=ssr","#win_ssr","")><i class="material-icons icon-sm">how_to_vote</i>全部 URL</a></p>
<hr/>

@ -88,7 +88,7 @@
<a href="/user/trafficlog"><i class="icon icon-lg">hourglass_empty</i>&nbsp;流量记录</a>
</li>
{if $config['subscribeLog']}
{if $config['subscribeLog']===true}
<li>
<a href="/user/subscribe_log"><i class="icon icon-lg">important_devices</i>&nbsp;订阅记录</a>
</li>

Loading…
Cancel
Save