From 9dc82aa869c36388513d005a846573d332d8f96d Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 29 Nov 2010 12:56:38 +0000 Subject: Fixes #2508 Sending user to referrer in reported content admin actions git-svn-id: http://code.elgg.org/elgg/trunk@7471 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/reportedcontent/actions/archive.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'mod/reportedcontent/actions/archive.php') diff --git a/mod/reportedcontent/actions/archive.php b/mod/reportedcontent/actions/archive.php index c41645ee2..dd5c6aef1 100644 --- a/mod/reportedcontent/actions/archive.php +++ b/mod/reportedcontent/actions/archive.php @@ -5,22 +5,23 @@ * @package ElggReportedContent */ -// Get input data $guid = (int) get_input('guid'); -// Make sure we actually have permission to edit $report = get_entity($guid); + +// Make sure we actually have permission to edit if ($report->getSubtype() == "reported_content" && $report->canEdit()) { - // change the state - if (!elgg_trigger_plugin_hook('reportedcontent:archive', 'system', array('report'=>$report), TRUE)) { + + // allow another plugin to override + if (!elgg_trigger_plugin_hook('reportedcontent:archive', 'system', array('report' => $report), TRUE)) { system_message(elgg_echo("reportedcontent:notarchived")); - forward('pg/admin/reportedcontent'); + forward(REFERER); } + + // change the state $report->state = "archived"; - // Success message system_message(elgg_echo("reportedcontent:archived")); - // Forward back to the reported content page - forward('pg/admin/reportedcontent'); + forward(REFERER); } -- cgit v1.2.3