summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/config.php10
-rw-r--r--post.php10
-rw-r--r--templates/post_form.html12
3 files changed, 26 insertions, 6 deletions
diff --git a/inc/config.php b/inc/config.php
index bfb7a6ac..151d4972 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -321,6 +321,16 @@
// Optional spoiler images
$config['spoiler_images'] = false;
+
+ // With the following, you can disable certain superfluous fields or enable "forced anonymous".
+
+ // When true, all names will be set to $config['anonymous'].
+ $config['field_disable_name'] = false;
+ // When true, no email will be able to be set.
+ $config['field_disable_email'] = false;
+ // When true, a blank password will be used for files (not usable for deletion).
+ $config['field_disable_password'] = false;
+
/*
* ====================
* Image settings
diff --git a/post.php b/post.php
index 3993ef5a..5dcc9424 100644
--- a/post.php
+++ b/post.php
@@ -131,6 +131,16 @@
header('Location: ' . $root . $board['dir'] . $config['file_index'], true, $config['redirect_http']);
} elseif(isset($_POST['post'])) {
+
+ if($config['field_disable_name'])
+ $_POST['name'] = $config['anonymous']; // "forced anonymous"
+
+ if($config['field_disable_email'])
+ $_POST['email'] = '';
+
+ if($config['field_disable_password'])
+ $_POST['password'] = '';
+
if( !isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['subject']) ||
diff --git a/templates/post_form.html b/templates/post_form.html
index 7ef133ed..e13b049b 100644
--- a/templates/post_form.html
+++ b/templates/post_form.html
@@ -4,22 +4,22 @@
<input type="hidden" name="board" value="{{ board.uri }}" />
{% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
<table>
- <tr>
+ {% if not config.field_disable_name %}<tr>
<th>
{% trans %}Name{% endtrans %}
</th>
<td>
<input type="text" name="name" size="25" maxlength="50" autocomplete="off" />
</td>
- </tr>
- <tr>
+ </tr>{% endif %}
+ {% if not config.field_disable_email %}<tr>
<th>
{% trans %}Email{% endtrans %}
</th>
<td>
<input type="text" name="email" size="25" maxlength="40" autocomplete="off" />
</td>
- </tr>
+ </tr>{% endif %}
<tr>
<th>
{% trans %}Subject{% endtrans %}
@@ -86,7 +86,7 @@
</td>
</tr>
{% endif %}
- <tr>
+ {% if not config.field_disable_password %}<tr>
<th>
{% trans %}Password{% endtrans %}
</th>
@@ -94,7 +94,7 @@
<input type="password" name="password" size="12" maxlength="18" autocomplete="off" />
<span class="unimportant">{% trans %}(For file deletion.){% endtrans %}</span>
</td>
- </tr>
+ </tr>{% endif %}
</table>
</form>