diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 36beed88..2b9d8fed 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2272,6 +2272,9 @@ function mod_reports() { error($config['error']['noaccess']); } + // Limit reports to ONLY those in our scope. + $report_scope = $global ? "global" : "local"; + // Get REPORTS. $query = prepare("SELECT * FROM ``reports`` " . ($mod["type"] == "20" ? "WHERE board = :board" : "") . " WHERE ``".($global ? "global" : "local")."``=TRUE LIMIT :limit"); diff --git a/post.php b/post.php index 0781d128..29ab8552 100644 --- a/post.php +++ b/post.php @@ -145,12 +145,13 @@ if (isset($_POST['delete'])) { '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $thread ? $thread : $id) . ($thread ? '#' . $id : '') . ' for "' . $reason . '"' ); - $query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason, :global)"); + $query = prepare("INSERT INTO ``reports`` (`time`, `ip`, `board`, `post`, `reason`, `local`, `global`) VALUES (:time, :ip, :board, :post, :reason, :local, :global)"); $query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR); $query->bindValue(':board', $board['uri'], PDO::PARAM_INT); $query->bindValue(':post', $id, PDO::PARAM_INT); $query->bindValue(':reason', $reason, PDO::PARAM_STR); + $query->bindValue(':local', 1, PDO::PARAM_BOOL); $query->bindValue(':global', isset($_POST['global']), PDO::PARAM_BOOL); $query->execute() or error(db_error($query)); } diff --git a/stylesheets/mod/mod.css b/stylesheets/mod/mod.css index 1db7638f..3c3a9bd9 100644 --- a/stylesheets/mod/mod.css +++ b/stylesheets/mod/mod.css @@ -125,4 +125,4 @@ .report-content-action:last-child::after { display: none; content: ''; - } + } \ No newline at end of file