瀏覽代碼

Don't allow guests to report posts anymore

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 10 年之前
父節點
當前提交
0c9e67bbcd

+ 2 - 1
Sources/ManagePermissions.php

@@ -2260,7 +2260,8 @@ function loadIllegalGuestPermissions()
 		'post_autosave_draft',
 		'pm_draft',
 		'pm_autosave_draft',
-		'disable_censor'
+		'disable_censor',
+		'report_any'
 	);
 
 	call_integration_hook('integrate_load_illegal_guest_permissions');

+ 0 - 1
Sources/ManageSettings.php

@@ -821,7 +821,6 @@ function ModifySpamSettings($return_config = false)
 				// This, my friend, is a cheat :p
 				'guest_verify' => array('check', 'guests_require_captcha', 'subtext' => $txt['setting_guests_require_captcha_desc']),
 				array('int', 'posts_require_captcha', 'subtext' => $txt['posts_require_captcha_desc'], 'onchange' => 'if (this.value > 0){ document.getElementById(\'guests_require_captcha\').checked = true; document.getElementById(\'guests_require_captcha\').disabled = true;} else {document.getElementById(\'guests_require_captcha\').disabled = false;}'),
-				array('check', 'guests_report_require_captcha'),
 			'',
 			// PM Settings
 				'pm1' => array('int', 'max_pm_recipients', 'subtext' => $txt['max_pm_recipients_note']),

+ 6 - 13
Sources/SendTopic.php

@@ -287,6 +287,9 @@ function ReportToModerator()
 
 	$context['robot_no_index'] = true;
 
+	// No guests!
+	is_not_guest();
+
 	// You can't use this if it's off or you are not allowed to do it.
 	isAllowedTo('report_any');
 
@@ -319,18 +322,6 @@ function ReportToModerator()
 	list ($_REQUEST['msg'], $member, $starter) = $smcFunc['db_fetch_row']($result);
 	$smcFunc['db_free_result']($result);
 
-	// Do we need to show the visual verification image?
-	$context['require_verification'] = $user_info['is_guest'] && !empty($modSettings['guests_report_require_captcha']);
-	if ($context['require_verification'])
-	{
-		require_once($sourcedir . '/Subs-Editor.php');
-		$verificationOptions = array(
-			'id' => 'report',
-		);
-		$context['require_verification'] = create_control_verification($verificationOptions);
-		$context['visual_verification_id'] = $verificationOptions['id'];
-	}
-
 	// Show the inputs for the comment, etc.
 	loadLanguage('Post');
 	loadTemplate('SendTopic');
@@ -359,7 +350,6 @@ function ReportToModerator()
 	});', true);
 
 	$context['comment_body'] = !isset($_POST['comment']) ? '' : trim($_POST['comment']);
-	$context['email_address'] = !isset($_POST['email']) ? '' : trim($_POST['email']);
 
 	// This is here so that the user could, in theory, be redirected back to the topic.
 	$context['start'] = $_REQUEST['start'];
@@ -380,6 +370,9 @@ function ReportToModerator2()
 {
 	global $txt, $scripturl, $topic, $board, $user_info, $modSettings, $sourcedir, $language, $context, $smcFunc;
 
+	// Sorry, no guests allowed... Probably just trying to spam us anyway
+	is_not_guest();
+
 	// You must have the proper permissions!
 	isAllowedTo('report_any');
 

+ 0 - 22
Themes/default/SendTopic.template.php

@@ -232,17 +232,6 @@ function template_report()
 						<br />
 						<dl class="settings" id="report_post">';
 
-	if ($context['user']['is_guest'])
-	{
-		echo '
-							<dt>
-								<label for="email_address">', $txt['email'], '</label>:
-							</dt>
-							<dd>
-								<input type="text" id="email_address" name="email" value="', $context['email_address'], '" size="25" maxlength="255" />
-							</dd>';
-	}
-
 	echo '
 							<dt>
 								<label for="report_comment">', $txt['enter_comment'], '</label>:
@@ -251,17 +240,6 @@ function template_report()
 								<textarea type="text" id="report_comment" name="comment" rows="5">', $context['comment_body'], '</textarea>
 							</dd>';
 
-	if ($context['require_verification'])
-	{
-		echo '
-							<dt>
-								', $txt['verification'], ':
-							</dt>
-							<dd>
-								', template_control_verification($context['visual_verification_id'], 'all'), '
-							</dd>';
-	}
-
 	echo '
 						</dl>
 						<div class="flow_auto">

+ 1 - 1
Themes/default/languages/ManageSettings.english.php

@@ -166,7 +166,7 @@ $txt['posts_require_captcha_desc'] = '(0 for no limit, moderators are exempt)';
 $txt['search_enable_captcha'] = 'Require verification on all guest searches';
 $txt['setting_guests_require_captcha'] = 'Guests must pass verification when making a post';
 $txt['setting_guests_require_captcha_desc'] = '(Automatically set if you specify a minimum post count below)';
-$txt['guests_report_require_captcha'] = 'Guests must pass verification when reporting a post';
+$txt['guests_report_require_captcha'] = 'Guests must pass verification when reporting a post'; // Deprecated
 
 $txt['configure_verification_means'] = 'Configure Verification Methods';
 $txt['setting_qa_verification_number'] = 'Number of verification questions user must answer';