add complain switch

This commit is contained in:
xiaomlove
2025-05-01 16:39:44 +07:00
parent af33e5cba7
commit 8c903a6799
10 changed files with 23 additions and 2 deletions

View File

@@ -192,6 +192,11 @@ class Setting extends NexusModel
return self::get('main.spsct') == 'yes';
}
public static function getIsComplainEnabled(): bool
{
return self::get('main.complain_enabled') == 'yes';
}
public static function getIsAllowUserReceiveEmailNotification(): bool
{
return self::get('smtp.emailnotify') == 'yes';

View File

@@ -29,4 +29,5 @@ $lang_complains = [
'text_view_band_log' => '查看封禁记录',
'reply_notify_subject' => '申诉回复',
'reply_notify_body' => '你在网站 %s 的申诉有了回复,点此 <a href="%s" target="_blank">查看</a>。',
'complain_not_enabled' => '申诉功能未启用',
];

View File

@@ -814,6 +814,8 @@ $lang_settings = array
'text_paid_torrent_enabled_note' => '启用后,有权限的用户可以在发种时设置向下载种子的用户收取一定的魔力,默认:否',
'row_use_challenge_response_authentication' => '挑战-响应认证',
'text_use_challenge_response_authentication_note' => '如果启用,登录时将不传输明文密码,建议启用。未来版本会删除此配置且启用此功能。',
'row_complain_enabled' => '启用申诉',
'row_complain_enabled_note' => '默认: "yes"',
);
?>

View File

@@ -29,4 +29,5 @@ $lang_complains = [
'text_view_band_log' => '查看封禁記錄',
'reply_notify_subject' => '申訴回復',
'reply_notify_body' => '你在網站 %s 的申訴有了回復,點此 <a href="%s" target="_blank">查看</a>。',
'complain_not_enabled' => '申訴功能未啟用',
];

View File

@@ -814,6 +814,8 @@ $lang_settings = array
'text_paid_torrent_enabled_note' => '啟用後,有權限的用戶可以在發種時設置向下載種子的用戶收取一定的魔力,默認:否',
'row_use_challenge_response_authentication' => '挑戰-響應認證',
'text_use_challenge_response_authentication_note' => '如果啟用,登錄時將不傳輸明文密碼,建議啟用。未來版本會刪除此配置且啟用此功能。',
'row_complain_enabled' => '啟用申訴',
'row_complain_enabled_note' => '默認: "yes"',
);
?>

View File

@@ -29,4 +29,5 @@ $lang_complains = [
'text_view_band_log' => 'View ban log',
'reply_notify_subject' => 'Complaint replied',
'reply_notify_body' => 'You have a reply to your complaint on the site %s, click here <a href="%s" target="_blank">to see it</a>.',
'complain_not_enabled' => 'Complaint not enabled',
];

View File

@@ -814,6 +814,8 @@ $lang_settings = array
'text_paid_torrent_enabled_note' => 'When enabled, users with permission can set a certain amount of bonus to be charged to users who download the torrents when they are sent, default: no',
'row_use_challenge_response_authentication' => 'Challenge-Response Authentication',
'text_use_challenge_response_authentication_note' => 'If enabled, no plaintext passwords will be transmitted at login, recommended. Future releases will remove this configuration and enable this feature.' ,
'row_complain_enabled' => 'Whether to enable complaints',
'row_complain_enabled_note' => 'default: "yes"',
);
?>

View File

@@ -9,6 +9,10 @@ $isAdmin = user_can('staffmem');
if($isLogin && !$isAdmin) {
permissiondenied();
}
if (!$isAdmin && !\App\Models\Setting::getIsComplainEnabled()) {
stderr($lang_functions['std_error'], $lang_complains['complain_not_enabled']);
}
$uid = $CURUSER['id'] ?? 0;
if($_SERVER['REQUEST_METHOD'] === 'POST'){
switch($action = filter_input(INPUT_POST, 'action', FILTER_SANITIZE_FULL_SPECIAL_CHARS)){

View File

@@ -106,8 +106,10 @@ foreach ($oauthProviders as $oauthProvider) {
if (!empty($items)) {
echo sprintf("<p>%s: %s</p>", $lang_login['other_methods'], implode("&nbsp;&nbsp;", $items));
}
if (\App\Models\Setting::getIsComplainEnabled()) {
echo sprintf('<p>[<b><a href="complains.php">%s</a></b>]</p>', $lang_login['text_complain']);
}
?>
<p>[<b><a href="complains.php"><?= $lang_login['text_complain'] ?></a></b>]</p>
<p><?php echo $lang_login['p_no_account_signup']?></p>
<?php
if ($smtptype != 'none'){

View File

@@ -42,7 +42,7 @@ if ($action == 'savesettings_main') // save main
'smalldescription','altname','extforum','extforumurl','defaultlang','defstylesheet', 'donation','spsct','browsecat','specialcat','waitsystem',
'maxdlsystem','bitbucket','torrentnameprefix', 'showforumstats','verification','invite_count','invite_timeout', 'seeding_leeching_time_calc_start',
'startsubid', 'logo', 'showlastxforumposts', 'enable_technical_info', 'site_language_enabled', 'show_top_uploader', 'imdb_language', 'offer_skip_approved_count',
'upload_deny_approval_deny_count', 'enable_global_search', 'tmp_invite_count',
'upload_deny_approval_deny_count', 'enable_global_search', 'tmp_invite_count', 'complain_enabled'
);
GetVar($validConfig);
$MAIN = [];
@@ -799,6 +799,7 @@ elseif ($action == 'mainsettings') // main settings
tr($lang_settings['row_initial_invites'],"<input type='text' name=invite_count style=\"width: 50px\" value={$MAIN['invite_count']}> ".$lang_settings['text_initial_invites_note'], 1);
tr($lang_settings['row_initial_tmp_invites'],"<input type='text' name=tmp_invite_count style=\"width: 50px\" value={$MAIN['tmp_invite_count']}> ".$lang_settings['text_initial_tmp_invites_note'], 1);
tr($lang_settings['row_invite_timeout'],"<input type='text' name=invite_timeout style=\"width: 50px\" value={$MAIN['invite_timeout']}> ".$lang_settings['text_invite_timeout_note'], 1);
yesorno($lang_settings['row_complain_enabled'], 'complain_enabled', $MAIN['complain_enabled'], $lang_settings['row_complain_enabled_note']);
yesorno($lang_settings['row_enable_registration_system'], 'registration', $MAIN['registration'], $lang_settings['row_allow_registrations']);
tr($lang_settings['row_verification_type'],"<input type='radio' name='verification'" . ($MAIN["verification"] == "email" ? " checked" : " checked") . " value='email'> ".$lang_settings['text_email'] ." <input type='radio' name='verification'" . ($MAIN["verification"] == "admin" ? " checked" : "") . " value='admin'> ".$lang_settings['text_admin']." <input type='radio' name='verification'" . ($MAIN["verification"] == "automatic" ? " checked" : "") . " value='automatic'> ".$lang_settings['text_automatically']."<br />".$lang_settings['text_verification_type_note'], 1);
yesorno($lang_settings['row_enable_wait_system'],'waitsystem', $MAIN['waitsystem'], $lang_settings['text_wait_system_note']);