mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-25 04:27:22 +08:00
fix self enable switch
This commit is contained in:
@@ -3181,7 +3181,7 @@ function loggedinorreturn($mainpage = false) {
|
|||||||
}
|
}
|
||||||
exit();
|
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');
|
nexus_redirect('self-enable.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1506,8 +1506,9 @@ function get_user_from_cookie(array $cookie, $isArray = true): array|\App\Models
|
|||||||
$signature = $result['signature'];
|
$signature = $result['signature'];
|
||||||
$log .= ", uid = $id";
|
$log .= ", uid = $id";
|
||||||
$isAjax = nexus()->isAjax();
|
$isAjax = nexus()->isAjax();
|
||||||
//only in nexus web can self-enable
|
$selfEnableBonus = \App\Models\Setting::getSelfEnableBonus();
|
||||||
$shouldIgnoreEnabled = IN_NEXUS && !$isAjax;
|
//only in nexus web can self-enable, and require bonus > 0
|
||||||
|
$shouldIgnoreEnabled = IN_NEXUS && !$isAjax && $selfEnableBonus > 0;
|
||||||
if ($isArray) {
|
if ($isArray) {
|
||||||
$whereStr = sprintf("id = %d and status = 'confirmed'", $id);
|
$whereStr = sprintf("id = %d and status = 'confirmed'", $id);
|
||||||
if (!$shouldIgnoreEnabled) {
|
if (!$shouldIgnoreEnabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user