mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-22 02:47:27 +08:00
fix self enable switch
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user