diff --git a/include/functions.php b/include/functions.php index db018608..292bf454 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2092,9 +2092,6 @@ function userlogin() { // error_reporting(E_ALL & ~E_NOTICE); // error_reporting(-1); // } - if ($row['enabled'] !== 'yes') { - - } return $loginResult = true; } @@ -3184,7 +3181,7 @@ function loggedinorreturn($mainpage = false) { } exit(); } - if ($CURUSER['enabled'] != 'yes' && $script != 'self-enable') { + if ($CURUSER['enabled'] != 'yes' && $script != 'self-enable' && \App\Models\Setting::getSelfEnableBonus() > 0) { nexus_redirect('self-enable.php'); } } diff --git a/lang/chs/lang_settings.php b/lang/chs/lang_settings.php index 186bcf2e..8ef0dac8 100644 --- a/lang/chs/lang_settings.php +++ b/lang/chs/lang_settings.php @@ -827,7 +827,7 @@ $lang_settings = array 'row_reward_times_limit' => '魔力奖励次数限制', 'text_reward_times_limit_note' => '种子详情页的魔力奖励每人每天次数限制,设置为 0 不限制。默认:0', 'row_self_enable' => '自助解封', - 'text_self_enable_note' => '个魔力值,如果他选择在被封禁 1 天内解封。封禁时长为 N 天,失去的魔力值将会是此值的 N 倍。', + 'text_self_enable_note' => '个魔力值,如果他选择在被封禁 1 天内解封。封禁时长为 N 天,失去的魔力值将会是此值的 N 倍。设置为 0 禁用此功能。', ); ?> diff --git a/lang/cht/lang_settings.php b/lang/cht/lang_settings.php index ddb111fb..f9d27a3c 100644 --- a/lang/cht/lang_settings.php +++ b/lang/cht/lang_settings.php @@ -827,7 +827,7 @@ $lang_settings = array 'row_reward_times_limit' => '魔力獎勵次數限制', 'text_reward_times_limit_note' => '種子詳情頁的魔力獎勵每人每天次數限制,設置爲 0 不限制。默認:0', 'row_self_enable' => '自助解封', - 'text_self_enable_note' => '個魔力值,如果他選擇在被封禁 1 天內解封。封禁時長為 N 天,失去的魔力值將會是此值的 N 倍。', + 'text_self_enable_note' => '個魔力值,如果他選擇在被封禁 1 天內解封。封禁時長為 N 天,失去的魔力值將會是此值的 N 倍。設置為 0 禁用此功能。', ); ?> diff --git a/lang/en/lang_settings.php b/lang/en/lang_settings.php index e1c2b10c..34e669cb 100644 --- a/lang/en/lang_settings.php +++ b/lang/en/lang_settings.php @@ -827,7 +827,7 @@ $lang_settings = array 'row_reward_times_limit' => 'Reward Frequency Limit', 'text_reward_times_limit_note' => 'Daily limit per user for bonus rewards on seed detail pages. Set to 0 for no limit. Default: 0', 'row_self_enable' => 'Self-service unblocking', - 'text_self_enable_note' => 'points. If he chooses to unblock within 1 day of being banned. If the ban duration is N days, the lost mana points will be N times this value.', + 'text_self_enable_note' => 'points. If he chooses to unblock within 1 day of being banned. If the ban duration is N days, the lost mana points will be N times this value. Setting it to 0 disables this feature.', ); ?> diff --git a/public/self-enable.php b/public/self-enable.php index e632318a..851d47bc 100644 --- a/public/self-enable.php +++ b/public/self-enable.php @@ -9,9 +9,10 @@ $title = nexus_trans('self-enable.title'); stdhead($title); begin_main_frame(); begin_frame($title, true,10,"100%","center"); - - -if ($CURUSER['enabled'] == 'yes') { +$unit = \App\Models\Setting::getSelfEnableBonus(); +if ($unit <= 0) { + printf('