From a83d584255012ee072486c187720ec5849efe1a3 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Wed, 23 Nov 2011 21:24:06 +1100 Subject: [PATCH] Ability to disable certain superfluous fields. ("Forced anonymous") --- inc/config.php | 10 ++++++++++ post.php | 10 ++++++++++ templates/post_form.html | 12 ++++++------ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/inc/config.php b/inc/config.php index bfb7a6ac4..151d49722 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 3993ef5a7..5dcc94240 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 7ef133ed9..e13b049b5 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -4,22 +4,22 @@ {% if mod %}{% endif %} - + {% if not config.field_disable_name %} - - + {% endif %} + {% if not config.field_disable_email %} - + {% endif %} {% endif %} - + {% if not config.field_disable_password %} @@ -94,7 +94,7 @@ {% trans %}(For file deletion.){% endtrans %} - + {% endif %}
{% trans %}Name{% endtrans %}
{% trans %}Email{% endtrans %}
{% trans %}Subject{% endtrans %} @@ -86,7 +86,7 @@
{% trans %}Password{% endtrans %}