mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
Compare commits
4 Commits
db4982f8f7
...
php8
| Author | SHA1 | Date | |
|---|---|---|---|
| 9995767bf7 | |||
| d115a3879a | |||
| 431fbfff56 | |||
| 9e632811ef |
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.10.1');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2026-02-17');
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.10.2');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2026-04-11');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -2092,9 +2092,6 @@ function userlogin() {
|
||||
// error_reporting(E_ALL & ~E_NOTICE);
|
||||
// error_reporting(-1);
|
||||
// }
|
||||
if ($row['enabled'] !== 'yes') {
|
||||
|
||||
}
|
||||
return $loginResult = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 禁用此功能。',
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -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 禁用此功能。',
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -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.',
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -36,8 +36,9 @@ if (!$row)
|
||||
failedlogins();
|
||||
if ($row['status'] == 'pending')
|
||||
failedlogins($lang_takelogin['std_user_account_unconfirmed']);
|
||||
//if ($row["enabled"] == "no")
|
||||
// bark($lang_takelogin['std_account_disabled']);
|
||||
if ($row["enabled"] == "no" && \App\Models\Setting::getSelfEnableBonus() <= 0) {
|
||||
bark($lang_takelogin['std_account_disabled']);
|
||||
}
|
||||
|
||||
if (!empty($row['two_step_secret'])) {
|
||||
if (empty($_POST['two_step_code'])) {
|
||||
|
||||
@@ -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',
|
||||
];
|
||||
|
||||
@@ -10,4 +10,5 @@ return [
|
||||
'deduct_bonus_total' => '当前已封禁 :days 天,共需扣除魔力 :total',
|
||||
'enable_desc' => '若需要解封,点击下面按钮,扣除相应魔力后账号即恢复正常。',
|
||||
'enable_button' => '点我解封',
|
||||
'feature_disabled' => '功能未启用',
|
||||
];
|
||||
|
||||
@@ -10,4 +10,5 @@ return [
|
||||
'deduct_bonus_total' => '當前已封禁 :days 天,共需扣除魔力 :total',
|
||||
'enable_desc' => '若需要解封,點擊下面按鈕,扣除相應魔力後賬號即恢復正常。',
|
||||
'enable_button' => '點我解封',
|
||||
'feature_disabled' => '功能未啟用',
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user