Browse Source

Create the remaining tokens
also, delete a few ones but shhhh!

Signed-off-by: Suki <[email protected]>

Suki 11 years ago
parent
commit
1d479ee785

+ 11 - 8
Sources/ReportedPosts.php

@@ -73,11 +73,9 @@ function ReportedPosts()
 		$context['sub_action'] = 'show';
 
 	// Lets see, just how many tokens do we need?
-	createToken('mod-report-close');
+	createToken('mod-report-closed');
 	createToken('mod-report-close-all');
-	createToken('mod-report-open');
 	createToken('mod-report-ignore');
-	createToken('mod-report-unignore');
 	createToken('mod-reportC-edit');
 	createToken('mod-reportC-delete');
 	createToken('mod-reportC-add');
@@ -432,7 +430,7 @@ function EditComment()
 
 	if (isset($_REQUEST['save']) && isset($_POST['edit_comment']) && !empty($_POST['mod_comment']))
 	{
-		checkSession('get');
+		checkSession();
 		validateToken('mod-reportC-edit');
 
 		$edited_comment = trim($smcFunc['htmlspecialchars']($_POST['mod_comment']));
@@ -455,20 +453,25 @@ function HandleReport()
 	if (empty($_GET['rid']) && (!isset($_GET['ignore']) || !isset($_GET['closed'])))
 		fatal_lang_error('mc_reportedp_none_found');
 
-	// Integers only please.
-	$report_id = (int) $_REQUEST['rid'];
-
 	// What are we gonna do?
 	$action = isset($_GET['ignore']) ? 'ignore' : 'closed';
 
 	// Are we disregarding or "un-disregarding"? "un-disregarding" thats a funny word!
 	$value = (int) $_GET[$action];
 
+	// Figuring out.
+	$message = $action == 'ignore' ? ($value ? 'ignore' : 'unignore') : ($value ? 'close' : 'open');
+
+	validateToken('mod-report-'. $action);
+
+	// Integers only please.
+	$report_id = (int) $_REQUEST['rid'];
+
 	// Update the DB entry
 	updateReport($action, $value, $report_id);
 
 	// So, time to show a confirmation message, lets do some trickery!
-	$_SESSION['rc_confirmation'] = $action == 'ignore' ? ($value ? 'ignore' : 'unignore') : ($value ? 'close' : 'open');
+	$_SESSION['rc_confirmation'] = $message;
 
 	// Done!
 	redirectexit($scripturl . '?action=moderate;area=reports');

+ 1 - 1
Themes/default/ModerationCenter.template.php

@@ -206,7 +206,7 @@ function template_notes()
 			// Cycle through the notes.
 			foreach ($context['notes'] as $note)
 				echo '
-							<li class="smalltext"><a href="', $note['delete_href'], ';', $context['mod-modnote-adel_token_var'], '=', $context['mod-modnote-del_token'], '" class="delete_modnote"><span class="generic_icons del_small"></span></a>', $note['time'] ,' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
+							<li class="smalltext"><a href="', $note['delete_href'], ';', $context['mod-modnote-del_token_var'], '=', $context['mod-modnote-del_token'], '" class="delete_modnote"><span class="generic_icons del_small"></span></a>', $note['time'] ,' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
 
 			echo '
 						</ul>

+ 2 - 2
Themes/default/ReportedPosts.template.php

@@ -63,8 +63,8 @@ function template_reported_posts()
 				<br>
 				<ul class="quickbuttons">
 					<li><a href="', $report['report_href'], '">', $details_button, '</a></li>
-					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" class="report_ignore" data-ignore="', (int) !$report['ignore'], '">', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li>
-					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '">', $close_button, '</a></li>';
+					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="report_ignore" data-ignore="', (int) !$report['ignore'], '">', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li>
+					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '">', $close_button, '</a></li>';
 
 		// Delete message button.
 		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])))