summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/config.php2
-rw-r--r--js/imgcaptcha.js16
-rw-r--r--templates/post_form.html15
-rw-r--r--templates/post_form.html~136
4 files changed, 169 insertions, 0 deletions
diff --git a/inc/config.php b/inc/config.php
index f4951a40..c657cd82 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -227,6 +227,8 @@
'embed',
'recaptcha_challenge_field',
'recaptcha_response_field',
+ 'imgcaptcha_hash',
+ 'imgcaptcha_verify',
'spoiler',
'quick-reply'
);
diff --git a/js/imgcaptcha.js b/js/imgcaptcha.js
new file mode 100644
index 00000000..dd313fad
--- /dev/null
+++ b/js/imgcaptcha.js
@@ -0,0 +1,16 @@
+//function obecnyCzas() {
+// return Math.round(new Date().getTime() / 1000);
+//}
+
+function imgcaptcha_odswiezKapcze() {
+ $.get("/inc/imgcaptcha_p.php", function(data) {
+ $("#imgcaptcha_hash").val(data);
+ $("#imgcaptcha_img").prop("src","/inc/imgcaptcha_im.php?cr=" + data);
+ });
+}
+//function resetujKapcze() {
+// $("#imgcaptcha_img").prop("src","/zakrytek.png");
+//}
+//$(document).ready(function(){
+// //resetujKapcze(); - to nie powinno byc na razie potrzebne
+//});
diff --git a/templates/post_form.html b/templates/post_form.html
index 8b7350c7..af8b22a7 100644
--- a/templates/post_form.html
+++ b/templates/post_form.html
@@ -58,6 +58,21 @@
</td>
</tr>
{% endif %}
+ {% if config.imgcaptcha %}
+ <tr>
+ <th>
+ {% trans %}Verification{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <input type="hidden" name="imgcaptcha_hash" id="imgcaptcha_hash" value="kucaj stad, kucu hakierze">
+ <img src="" width="128px" height="96px" id="imgcaptcha_img"></img><br>
+ {% config.imgcaptcha_question %} <input type="text" name="imgcaptcha_verify" id="imgcaptcha_verify" value=""></input><br>
+ <a href="javascript:ic_odswiezKapcze()">Odswiez</a>
+ {{ antibot.html() }}
+ </td>
+ </tr>
+ {% endif %}
<tr>
<th>
{% trans %}File{% endtrans %}
diff --git a/templates/post_form.html~ b/templates/post_form.html~
new file mode 100644
index 00000000..a77b9872
--- /dev/null
+++ b/templates/post_form.html~
@@ -0,0 +1,136 @@
+<form name="post" onsubmit="return dopost(this);" enctype="multipart/form-data" action="{{ config.post_url }}" method="post">
+{{ antibot.html() }}
+{% if id %}<input type="hidden" name="thread" value="{{ id }}">{% endif %}
+{{ antibot.html() }}
+<input type="hidden" name="board" value="{{ board.uri }}">
+{{ antibot.html() }}
+{% if mod %}<input type="hidden" name="mod" value="1">{% endif %}
+ <table>
+ {% if not config.field_disable_name or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
+ <th>
+ {% trans %}Name{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <input type="text" name="name" size="25" maxlength="35" autocomplete="off">
+ {{ antibot.html() }}
+ </td>
+ </tr>{% endif %}
+ {% if not config.field_disable_email or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
+ <th>
+ {% trans %}Email{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <input type="text" name="email" size="25" maxlength="40" autocomplete="off">
+ {{ antibot.html() }}
+ </td>
+ </tr>{% endif %}
+ <tr>
+ <th>
+ {% trans %}Subject{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <input style="float:left;" type="text" name="subject" size="25" maxlength="100" autocomplete="off">
+ <input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />{% if config.spoiler_images %} <input id="spoiler" name="spoiler" type="checkbox"> <label for="spoiler">{% trans %}Spoiler Image{% endtrans %}</label>{% endif %}
+ </td>
+ </tr>
+ <tr>
+ <th>
+ {% trans %}Comment{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <textarea name="body" id="body" rows="5" cols="35"></textarea>
+ {{ antibot.html() }}
+ </td>
+ </tr>
+ {% if config.recaptcha %}
+ <tr>
+ <th>
+ {% trans %}Verification{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k={{ config.recaptcha_public }}"></script>
+ {{ antibot.html() }}
+ </td>
+ </tr>
+ {% endif %}
+ {% if config.imgcaptcha %}
+ <tr>
+ <th>
+ {% trans %}Verification{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <input type="hidden" name="ac_hash" id="ac_hash" value="kucaj stad, kucu hakierze">
+ <img src="" width="128px" height="96px" id="ac_img"></img><br>
+ {% config.imgcaptcha_question %} <input type="text" name="ac_verify" id="ac_verify" value=""></input><br>
+ <a href="javascript:ic_odswiezKapcze()">Odswiez</a>
+ {{ antibot.html() }}
+ </td>
+ </tr>
+ {% endif %}
+ <tr>
+ <th>
+ {% trans %}File{% endtrans %}
+ </th>
+ <td>
+ <input type="file" name="file">
+ {{ antibot.html() }}
+ </td>
+ </tr>
+ {% if config.enable_embedding %}
+ <tr>
+ <th>
+ {% trans %}Embed{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <input type="text" name="embed" size="30" maxlength="120" autocomplete="off">
+ {{ antibot.html() }}
+ </td>
+ </tr>
+ {% endif %}
+ {% if mod %}
+ <tr>
+ <th>
+ {% trans %}Flags{% endtrans %}
+ </th>
+ <td>
+ {% if not id and post.mod|hasPermission(config.mod.sticky, board.uri) %}<div>
+ <label for="sticky">{% trans %}Sticky{% endtrans %}</label>
+ <input title="{% trans %}Sticky{% endtrans %}" type="checkbox" name="sticky" id="sticky"><br>
+ </div>{% endif %}
+ {% if not id and post.mod|hasPermission(config.mod.lock, board.uri) %}<div>
+ <label for="lock">{% trans %}Lock{% endtrans %}</label><br>
+ <input title="{% trans %}Lock{% endtrans %}" type="checkbox" name="lock" id="lock">
+ </div>{% endif %}
+ {% if post.mod|hasPermission(config.mod.rawhtml, board.uri) %}<div>
+ <label for="raw">{% trans %}Raw HTML{% endtrans %}</label><br>
+ <input title="{% trans %}Raw HTML{% endtrans %}" type="checkbox" name="raw" id="raw">
+ </div>{% endif %}
+ </td>
+ </tr>
+ {% endif %}
+ {% if not config.field_disable_password or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
+ <th>
+ {% trans %}Password{% endtrans %}
+ {{ antibot.html() }}
+ </th>
+ <td>
+ <input type="password" name="password" size="12" maxlength="18" autocomplete="off">
+ <span class="unimportant">{% trans %}(For file deletion.){% endtrans %}</span>
+ {{ antibot.html() }}
+ </td>
+ </tr>{% endif %}
+ </table>
+{{ antibot.html(true) }}
+<input type="hidden" name="hash" value="{{ antibot.hash() }}">
+</form>
+
+<script type="text/javascript">{% raw %}
+ rememberStuff();
+{% endraw %}</script>