diff --git a/inc/config.php b/inc/config.php index d4ce3ada..7ff0ec7d 100644 --- a/inc/config.php +++ b/inc/config.php @@ -450,6 +450,8 @@ // Maximum filename length to display (the rest can be viewed upon mouseover). $config['max_filename_display'] = 30; + // Allow users to delete their own posts? + $config['allow_delete'] = true; // How long after posting should you have to wait before being able to delete that post? (In seconds.) $config['delete_time'] = 10; // Reply limit (stops bumping thread when this is reached). diff --git a/post.php b/post.php index 8ff99e31..43d52674 100644 --- a/post.php +++ b/post.php @@ -42,6 +42,10 @@ if (isset($_POST['delete'])) { // Check if banned checkBan($board['uri']); + + // Check if deletion enabled + if (!$config['allow_delete']) + error(_('Post deletion is not allowed!')); if (empty($delete)) error($config['error']['nodelete']); @@ -88,7 +92,7 @@ if (isset($_POST['delete'])) { echo json_encode(array('success' => true)); } } elseif (isset($_POST['report'])) { - if (!isset($_POST['board'], $_POST['password'], $_POST['reason'])) + if (!isset($_POST['board'], $_POST['reason'])) error($config['error']['bot']); $report = array(); diff --git a/templates/report_delete.html b/templates/report_delete.html index 07221120..2fcb7259 100644 --- a/templates/report_delete.html +++ b/templates/report_delete.html @@ -1,9 +1,11 @@ +{% if config.allow_delete %}
{% trans %}Delete Post{% endtrans %} [ ]
+{% endif %}