diff --git a/app/Models/Setting.php b/app/Models/Setting.php index ae0e3beb..089fbf2b 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -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'; diff --git a/lang/chs/lang_complains.php b/lang/chs/lang_complains.php index 8df7f238..a10ee3bc 100644 --- a/lang/chs/lang_complains.php +++ b/lang/chs/lang_complains.php @@ -29,4 +29,5 @@ $lang_complains = [ 'text_view_band_log' => '查看封禁记录', 'reply_notify_subject' => '申诉回复', 'reply_notify_body' => '你在网站 %s 的申诉有了回复,点此 查看。', + 'complain_not_enabled' => '申诉功能未启用', ]; diff --git a/lang/chs/lang_settings.php b/lang/chs/lang_settings.php index 95527f52..aaba2865 100644 --- a/lang/chs/lang_settings.php +++ b/lang/chs/lang_settings.php @@ -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"', ); ?> diff --git a/lang/cht/lang_complains.php b/lang/cht/lang_complains.php index bccbc8fe..04188b45 100644 --- a/lang/cht/lang_complains.php +++ b/lang/cht/lang_complains.php @@ -29,4 +29,5 @@ $lang_complains = [ 'text_view_band_log' => '查看封禁記錄', 'reply_notify_subject' => '申訴回復', 'reply_notify_body' => '你在網站 %s 的申訴有了回復,點此 查看。', + 'complain_not_enabled' => '申訴功能未啟用', ]; diff --git a/lang/cht/lang_settings.php b/lang/cht/lang_settings.php index 26d48e1a..bcb45a25 100644 --- a/lang/cht/lang_settings.php +++ b/lang/cht/lang_settings.php @@ -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"', ); ?> diff --git a/lang/en/lang_complains.php b/lang/en/lang_complains.php index 2dfd4254..df8338a6 100644 --- a/lang/en/lang_complains.php +++ b/lang/en/lang_complains.php @@ -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 to see it.', + 'complain_not_enabled' => 'Complaint not enabled', ]; diff --git a/lang/en/lang_settings.php b/lang/en/lang_settings.php index b3a2dd4f..765d0beb 100644 --- a/lang/en/lang_settings.php +++ b/lang/en/lang_settings.php @@ -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"', ); ?> diff --git a/public/complains.php b/public/complains.php index 71fd3744..db72dd26 100644 --- a/public/complains.php +++ b/public/complains.php @@ -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)){ diff --git a/public/login.php b/public/login.php index 2f59564c..d69f6375 100644 --- a/public/login.php +++ b/public/login.php @@ -106,8 +106,10 @@ foreach ($oauthProviders as $oauthProvider) { if (!empty($items)) { echo sprintf("

%s: %s

", $lang_login['other_methods'], implode("  ", $items)); } +if (\App\Models\Setting::getIsComplainEnabled()) { + echo sprintf('

[%s]

', $lang_login['text_complain']); +} ?> -

[]

".$lang_settings['text_initial_invites_note'], 1); tr($lang_settings['row_initial_tmp_invites']," ".$lang_settings['text_initial_tmp_invites_note'], 1); tr($lang_settings['row_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']," ".$lang_settings['text_email'] ." ".$lang_settings['text_admin']." ".$lang_settings['text_automatically']."
".$lang_settings['text_verification_type_note'], 1); yesorno($lang_settings['row_enable_wait_system'],'waitsystem', $MAIN['waitsystem'], $lang_settings['text_wait_system_note']);