fix self enable switch

This commit is contained in:
xiaomlove
2026-04-09 11:48:21 +07:00
parent 9e632811ef
commit 431fbfff56
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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');
}
}
+3 -2
View File
@@ -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) {