Compare commits

..

2 Commits

Author SHA1 Message Date
xiaomlove 431fbfff56 fix self enable switch 2026-04-09 11:48:21 +07:00
xiaomlove 9e632811ef self enable add switch 2026-04-09 10:52:58 +07:00
9 changed files with 13 additions and 12 deletions
-3
View File
@@ -2092,9 +2092,6 @@ function userlogin() {
// error_reporting(E_ALL & ~E_NOTICE);
// error_reporting(-1);
// }
if ($row['enabled'] !== 'yes') {
}
return $loginResult = true;
}
+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) {
+1 -1
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 禁用此功能。',
);
?>
+1 -1
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 禁用此功能。',
);
?>
+1 -1
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.',
);
?>
+4 -4
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;
+1
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',
];
+1
View File
@@ -10,4 +10,5 @@ return [
'deduct_bonus_total' => '当前已封禁 :days 天,共需扣除魔力 :total',
'enable_desc' => '若需要解封,点击下面按钮,扣除相应魔力后账号即恢复正常。',
'enable_button' => '点我解封',
'feature_disabled' => '功能未启用',
];
+1
View File
@@ -10,4 +10,5 @@ return [
'deduct_bonus_total' => '當前已封禁 :days 天,共需扣除魔力 :total',
'enable_desc' => '若需要解封,點擊下面按鈕,扣除相應魔力後賬號即恢復正常。',
'enable_button' => '點我解封',
'feature_disabled' => '功能未啟用',
];