Gazelle/sections/reportsv2/ajax_change_resolve.php

43 lines
1022 B
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
/*
* This is the page that gets the values of whether to delete/disable upload/warning duration
2013-02-22 08:00:24 +00:00
* every time you change the resolve type on one of the two reports pages.
2011-03-28 14:21:28 +00:00
*/
2013-05-04 08:00:48 +00:00
if (!check_perms('admin_reports')) {
2011-03-28 14:21:28 +00:00
error(403);
}
2013-05-04 08:00:48 +00:00
if (is_number($_GET['id'])) {
2011-03-28 14:21:28 +00:00
$ReportID = $_GET['id'];
} else {
echo 'HAX on report ID';
die();
}
2013-05-04 08:00:48 +00:00
if (!isset($_GET['categoryid'])) {
2011-03-28 14:21:28 +00:00
echo 'HAX on categoryid';
die();
} else {
$CategoryID = $_GET['categoryid'];
}
2013-05-04 08:00:48 +00:00
if (!isset($_GET['type'])) {
2011-03-28 14:21:28 +00:00
error(404);
2013-09-15 08:00:53 +00:00
} elseif (array_key_exists($_GET['type'], $Types[$CategoryID])) {
2011-03-28 14:21:28 +00:00
$ReportType = $Types[$CategoryID][$_GET['type']];
2013-09-15 08:00:53 +00:00
} elseif (array_key_exists($_GET['type'], $Types['master'])) {
2011-03-28 14:21:28 +00:00
$ReportType = $Types['master'][$_GET['type']];
} else {
//There was a type but it wasn't an option!
echo 'HAX on section type';
die();
}
$Array = array();
$Array[0] = $ReportType['resolve_options']['delete'];
$Array[1] = $ReportType['resolve_options']['upload'];
$Array[2] = $ReportType['resolve_options']['warn'];
echo json_encode($Array);