From 431fbfff56e54aa44dca5c45a69b2354a03b4ad8 Mon Sep 17 00:00:00 2001 From: xiaomlove <1939737565@qq.com> Date: Thu, 9 Apr 2026 11:48:21 +0700 Subject: [PATCH] fix self enable switch --- include/functions.php | 2 +- include/globalfunctions.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/functions.php b/include/functions.php index 292bf454..eaf2683f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3181,7 +3181,7 @@ function loggedinorreturn($mainpage = false) { } exit(); } - if ($CURUSER['enabled'] != 'yes' && $script != 'self-enable' && \App\Models\Setting::getSelfEnableBonus() > 0) { + if ($CURUSER['enabled'] != 'yes' && $script != 'self-enable') { nexus_redirect('self-enable.php'); } } diff --git a/include/globalfunctions.php b/include/globalfunctions.php index d417edaf..7bde7f10 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -1506,8 +1506,9 @@ function get_user_from_cookie(array $cookie, $isArray = true): array|\App\Models $signature = $result['signature']; $log .= ", uid = $id"; $isAjax = nexus()->isAjax(); - //only in nexus web can self-enable - $shouldIgnoreEnabled = IN_NEXUS && !$isAjax; + $selfEnableBonus = \App\Models\Setting::getSelfEnableBonus(); + //only in nexus web can self-enable, and require bonus > 0 + $shouldIgnoreEnabled = IN_NEXUS && !$isAjax && $selfEnableBonus > 0; if ($isArray) { $whereStr = sprintf("id = %d and status = 'confirmed'", $id); if (!$shouldIgnoreEnabled) {