improve mybonus page + upload deny when approval deny too much

This commit is contained in:
xiaomlove
2022-09-26 17:42:51 +08:00
parent c3321d0afc
commit 3ea23d337b
15 changed files with 77 additions and 63 deletions
+6 -1
View File
@@ -14,10 +14,15 @@ if ($enableoffer == 'yes')
else $has_allowed_offer = 0;
$uploadfreely = user_can_upload("torrents");
$offerSkipApprovedCount = get_setting('main.offer_skip_approved_count');
do_log("uploadfreely: $uploadfreely, has_allowed_offer: $has_allowed_offer, offerSkipApprovedCount: $offerSkipApprovedCount");
$uploadDenyApprovalDenyCount = get_setting('main.upload_deny_approval_deny_count');
$approvalDenyCount = \App\Models\Torrent::query()->where('owner', $CURUSER['id'])->where('approval_status', \App\Models\Torrent::APPROVAL_STATUS_DENY)->count();
do_log("uploadfreely: $uploadfreely, has_allowed_offer: $has_allowed_offer, offerSkipApprovedCount: $offerSkipApprovedCount, uploadDenyApprovalDenyCount: $uploadDenyApprovalDenyCount, approvalDenyCount: $approvalDenyCount");
$allowtorrents = ($has_allowed_offer || $uploadfreely || ($userInfo->offer_allowed_count >= $offerSkipApprovedCount));
$allowspecial = user_can_upload("music");
if ($uploadDenyApprovalDenyCount > 0 && $approvalDenyCount >= $uploadDenyApprovalDenyCount) {
stderr($lang_upload['std_sorry'],sprintf($lang_upload['approval_deny_reach_upper_limit'], $uploadDenyApprovalDenyCount),false);
}
if (!$allowtorrents && !$allowspecial)
stderr($lang_upload['std_sorry'],$lang_upload['std_please_offer'],false);
$allowtwosec = ($allowtorrents && $allowspecial);