Fossil SCM
Simplified interaction on the honeypot. Humans can prove themselves with just two simple clicks when the auto-captcha setting is enabled.
Commit
0e675ad32cb71c6b5dfeae97f41c08b61d16c1674bff5b9478a26b7a266302c0
Parent
cee1af5a3731d2c…
2 files changed
+1
-1
+34
-9
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1916,11 +1916,11 @@ | ||
| 1916 | 1916 | blob_appendf(&url, "%c%t", cSep, p->zName); |
| 1917 | 1917 | } |
| 1918 | 1918 | cSep = '&'; |
| 1919 | 1919 | } |
| 1920 | 1920 | } |
| 1921 | - return blob_str(&url); | |
| 1921 | + return blob_str(&url); | |
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | 1924 | /* |
| 1925 | 1925 | ** Tag query parameter zName so that it is not exported by |
| 1926 | 1926 | ** cgi_query_parameters_to_hidden(). Or if zName==0, then |
| 1927 | 1927 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1916,11 +1916,11 @@ | |
| 1916 | blob_appendf(&url, "%c%t", cSep, p->zName); |
| 1917 | } |
| 1918 | cSep = '&'; |
| 1919 | } |
| 1920 | } |
| 1921 | return blob_str(&url); |
| 1922 | } |
| 1923 | |
| 1924 | /* |
| 1925 | ** Tag query parameter zName so that it is not exported by |
| 1926 | ** cgi_query_parameters_to_hidden(). Or if zName==0, then |
| 1927 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1916,11 +1916,11 @@ | |
| 1916 | blob_appendf(&url, "%c%t", cSep, p->zName); |
| 1917 | } |
| 1918 | cSep = '&'; |
| 1919 | } |
| 1920 | } |
| 1921 | return blob_str(&url); |
| 1922 | } |
| 1923 | |
| 1924 | /* |
| 1925 | ** Tag query parameter zName so that it is not exported by |
| 1926 | ** cgi_query_parameters_to_hidden(). Or if zName==0, then |
| 1927 |
+34
-9
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1372,22 +1372,47 @@ | ||
| 1372 | 1372 | /* |
| 1373 | 1373 | ** WEBPAGE: honeypot |
| 1374 | 1374 | ** This page is a honeypot for spiders and bots. |
| 1375 | 1375 | */ |
| 1376 | 1376 | void honeypot_page(void){ |
| 1377 | + unsigned int uSeed = captcha_seed(); | |
| 1378 | + const char *zDecoded = captcha_decode(uSeed); | |
| 1379 | + int bAutoCaptcha = db_get_boolean("auto-captcha", 0); | |
| 1380 | + char *zCaptcha = captcha_render(zDecoded); | |
| 1377 | 1381 | style_header("I think you are a robot"); |
| 1378 | 1382 | @ <p>You seem like a robot.</p> |
| 1379 | 1383 | @ |
| 1380 | - @ <p>Is this wrong? Are you really a human? If so, please prove it | |
| 1381 | - @ by <a href="%R/login">logging in</a>. | |
| 1382 | - if( g.anon.Hyperlink ){ | |
| 1383 | - @ You can <a href="%R/login?anon=1">log in anonymously</a> if you | |
| 1384 | - @ prefer. | |
| 1385 | - } | |
| 1386 | - @ <p>Sorry for the inconvenience. The point of this is to prevent | |
| 1387 | - @ robots from following the countless of hyperlinks in this site and | |
| 1388 | - @ soaking up all the available CPU time and network bandwidth. | |
| 1384 | + @ <p>Is that incorrect? Are you really human? | |
| 1385 | + @ If so, please prove it by transcribing the captcha text | |
| 1386 | + @ into the entry box below and pressing "Submit". | |
| 1387 | + @ <form action="%R/login" method="post"> | |
| 1388 | + @ <input type="hidden" id="u" name="u" value="anonymous"> | |
| 1389 | + @ <p> | |
| 1390 | + @ Captcha: <input type="text" id="p" name="p" value=""> | |
| 1391 | + @ <input type="submit" name="in" value="Submit"> | |
| 1392 | + @ | |
| 1393 | + @ <p>Alternatively, you can <a href="%R/login">log in</a> using an | |
| 1394 | + @ existing userid. | |
| 1395 | + @ | |
| 1396 | + @ <p><input type="hidden" name="cs" value="%u(uSeed)"> | |
| 1397 | + @ <div class="captcha"><table class="captcha"><tr><td>\ | |
| 1398 | + @ <pre class="captcha"> | |
| 1399 | + @ %h(zCaptcha) | |
| 1400 | + @ </pre></td></tr></table> | |
| 1401 | + if( bAutoCaptcha ) { | |
| 1402 | + @ <input type="button" value="Fill out captcha" id='autofillButton' \ | |
| 1403 | + @ data-af='%s(zDecoded)'> | |
| 1404 | + builtin_request_js("login.js"); | |
| 1405 | + } | |
| 1406 | + @ </div> | |
| 1407 | + free(zCaptcha); | |
| 1408 | + @ | |
| 1409 | + @ <p>We regret this inconvenience. However, robots have become so | |
| 1410 | + @ prolific and so aggressive that they will soak up too much CPU time | |
| 1411 | + @ and network bandwidth on our servers if allowed to run unchecked. | |
| 1412 | + @ Your cooperation in demonstrating that you are human is | |
| 1413 | + @ appreciated. | |
| 1389 | 1414 | style_finish_page(); |
| 1390 | 1415 | } |
| 1391 | 1416 | |
| 1392 | 1417 | /* |
| 1393 | 1418 | ** Webpages that encounter an error due to missing or incorrect |
| 1394 | 1419 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1372,22 +1372,47 @@ | |
| 1372 | /* |
| 1373 | ** WEBPAGE: honeypot |
| 1374 | ** This page is a honeypot for spiders and bots. |
| 1375 | */ |
| 1376 | void honeypot_page(void){ |
| 1377 | style_header("I think you are a robot"); |
| 1378 | @ <p>You seem like a robot.</p> |
| 1379 | @ |
| 1380 | @ <p>Is this wrong? Are you really a human? If so, please prove it |
| 1381 | @ by <a href="%R/login">logging in</a>. |
| 1382 | if( g.anon.Hyperlink ){ |
| 1383 | @ You can <a href="%R/login?anon=1">log in anonymously</a> if you |
| 1384 | @ prefer. |
| 1385 | } |
| 1386 | @ <p>Sorry for the inconvenience. The point of this is to prevent |
| 1387 | @ robots from following the countless of hyperlinks in this site and |
| 1388 | @ soaking up all the available CPU time and network bandwidth. |
| 1389 | style_finish_page(); |
| 1390 | } |
| 1391 | |
| 1392 | /* |
| 1393 | ** Webpages that encounter an error due to missing or incorrect |
| 1394 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1372,22 +1372,47 @@ | |
| 1372 | /* |
| 1373 | ** WEBPAGE: honeypot |
| 1374 | ** This page is a honeypot for spiders and bots. |
| 1375 | */ |
| 1376 | void honeypot_page(void){ |
| 1377 | unsigned int uSeed = captcha_seed(); |
| 1378 | const char *zDecoded = captcha_decode(uSeed); |
| 1379 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 1380 | char *zCaptcha = captcha_render(zDecoded); |
| 1381 | style_header("I think you are a robot"); |
| 1382 | @ <p>You seem like a robot.</p> |
| 1383 | @ |
| 1384 | @ <p>Is that incorrect? Are you really human? |
| 1385 | @ If so, please prove it by transcribing the captcha text |
| 1386 | @ into the entry box below and pressing "Submit". |
| 1387 | @ <form action="%R/login" method="post"> |
| 1388 | @ <input type="hidden" id="u" name="u" value="anonymous"> |
| 1389 | @ <p> |
| 1390 | @ Captcha: <input type="text" id="p" name="p" value=""> |
| 1391 | @ <input type="submit" name="in" value="Submit"> |
| 1392 | @ |
| 1393 | @ <p>Alternatively, you can <a href="%R/login">log in</a> using an |
| 1394 | @ existing userid. |
| 1395 | @ |
| 1396 | @ <p><input type="hidden" name="cs" value="%u(uSeed)"> |
| 1397 | @ <div class="captcha"><table class="captcha"><tr><td>\ |
| 1398 | @ <pre class="captcha"> |
| 1399 | @ %h(zCaptcha) |
| 1400 | @ </pre></td></tr></table> |
| 1401 | if( bAutoCaptcha ) { |
| 1402 | @ <input type="button" value="Fill out captcha" id='autofillButton' \ |
| 1403 | @ data-af='%s(zDecoded)'> |
| 1404 | builtin_request_js("login.js"); |
| 1405 | } |
| 1406 | @ </div> |
| 1407 | free(zCaptcha); |
| 1408 | @ |
| 1409 | @ <p>We regret this inconvenience. However, robots have become so |
| 1410 | @ prolific and so aggressive that they will soak up too much CPU time |
| 1411 | @ and network bandwidth on our servers if allowed to run unchecked. |
| 1412 | @ Your cooperation in demonstrating that you are human is |
| 1413 | @ appreciated. |
| 1414 | style_finish_page(); |
| 1415 | } |
| 1416 | |
| 1417 | /* |
| 1418 | ** Webpages that encounter an error due to missing or incorrect |
| 1419 |