mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 01:10:51 +01:00
Ability to disable certain superfluous fields. ("Forced anonymous")
This commit is contained in:
parent
cc8d465297
commit
a83d584255
@ -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
|
||||
|
10
post.php
10
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']) ||
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user