self enable add switch

This commit is contained in:
xiaomlove
2026-04-09 10:52:58 +07:00
parent db4982f8f7
commit 9e632811ef
8 changed files with 11 additions and 11 deletions

View File

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

View File

@@ -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 禁用此功能。',
);
?>

View File

@@ -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 禁用此功能。',
);
?>

View File

@@ -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.',
);
?>

View File

@@ -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('<h3>%s</h3>', nexus_trans('self-enable.feature_disabled'));
} elseif ($CURUSER['enabled'] == 'yes') {
printf('<h3>%s</h3>', nexus_trans('self-enable.enable_status_normal'));
} else {
$latestBanLog = \App\Models\UserBanLog::query()
@@ -21,7 +22,6 @@ if ($CURUSER['enabled'] == 'yes') {
if (!$latestBanLog) {
printf('<h3>%s</h3>', nexus_trans('self-enable.no_ban_info'));
} else {
$unit = \App\Models\Setting::getSelfEnableBonus();
$elapsedDay = ceil((time() - $latestBanLog->created_at->getTimestamp()) / 86400);
$total = $unit * $elapsedDay;
$isUserBonusEnough = $CURUSER['seedbonus'] >= $total;

View File

@@ -10,4 +10,5 @@ return [
'deduct_bonus_total' => 'Currently banned for :days days, total bonus to be deducted :total',
'enable_desc' => 'If you need to unblock, click the button below, the corresponding bonus points will be deducted and the account will return to normal.',
'enable_button' => 'Click to unblock',
'feature_disabled' => 'Feature not enabled',
];

View File

@@ -10,4 +10,5 @@ return [
'deduct_bonus_total' => '当前已封禁 :days 天,共需扣除魔力 :total',
'enable_desc' => '若需要解封,点击下面按钮,扣除相应魔力后账号即恢复正常。',
'enable_button' => '点我解封',
'feature_disabled' => '功能未启用',
];

View File

@@ -10,4 +10,5 @@ return [
'deduct_bonus_total' => '當前已封禁 :days 天,共需扣除魔力 :total',
'enable_desc' => '若需要解封,點擊下面按鈕,扣除相應魔力後賬號即恢復正常。',
'enable_button' => '點我解封',
'feature_disabled' => '功能未啟用',
];