Fossil SCM
Put the "speak the text" buttons for captcha audio closer to the boxes in which the person must enter the text.
Commit
a584491ab87691cb1774e3ab9dc1cb760a85bdd3130d64565998e3e3f9e23e5e
Parent
2e32552331937fb…
3 files changed
+3
-3
+4
-3
+13
-8
+3
-3
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -1392,10 +1392,11 @@ | ||
| 1392 | 1392 | zDecoded = captcha_decode(uSeed); |
| 1393 | 1393 | zCaptcha = captcha_render(zDecoded); |
| 1394 | 1394 | @ <tr> |
| 1395 | 1395 | @ <td class="form_label">Security Code:</td> |
| 1396 | 1396 | @ <td><input type="text" name="captcha" value="" size="30"> |
| 1397 | + captcha_speakit_button(uSeed, "Speak the code"); | |
| 1397 | 1398 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 1398 | 1399 | @ </tr> |
| 1399 | 1400 | if( eErr==2 ){ |
| 1400 | 1401 | @ <tr><td><td><span class='loginError'>↑ %h(zErr)</span></td></tr> |
| 1401 | 1402 | } |
| @@ -1462,11 +1463,10 @@ | ||
| 1462 | 1463 | if( needCaptcha ){ |
| 1463 | 1464 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 1464 | 1465 | @ %h(zCaptcha) |
| 1465 | 1466 | @ </pre> |
| 1466 | 1467 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 1467 | - captcha_speakit_button(uSeed); | |
| 1468 | 1468 | @ </td></tr></table></div> |
| 1469 | 1469 | } |
| 1470 | 1470 | @ </form> |
| 1471 | 1471 | fossil_free(zErr); |
| 1472 | 1472 | style_footer(); |
| @@ -1856,10 +1856,11 @@ | ||
| 1856 | 1856 | zDecoded = captcha_decode(uSeed); |
| 1857 | 1857 | zCaptcha = captcha_render(zDecoded); |
| 1858 | 1858 | @ <tr> |
| 1859 | 1859 | @ <td class="form_label">Security Code:</td> |
| 1860 | 1860 | @ <td><input type="text" name="captcha" value="" size="30"> |
| 1861 | + captcha_speakit_button(uSeed, "Speak the code"); | |
| 1861 | 1862 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 1862 | 1863 | if( eErr==2 ){ |
| 1863 | 1864 | @ <td><span class="loginError">← %h(zErr)</span></td> |
| 1864 | 1865 | } |
| 1865 | 1866 | @ </tr> |
| @@ -1876,11 +1877,10 @@ | ||
| 1876 | 1877 | @ </table> |
| 1877 | 1878 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 1878 | 1879 | @ %h(zCaptcha) |
| 1879 | 1880 | @ </pre> |
| 1880 | 1881 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 1881 | - captcha_speakit_button(uSeed); | |
| 1882 | 1882 | @ </td></tr></table></div> |
| 1883 | 1883 | @ </form> |
| 1884 | 1884 | fossil_free(zErr); |
| 1885 | 1885 | style_footer(); |
| 1886 | 1886 | } |
| @@ -2596,10 +2596,11 @@ | ||
| 2596 | 2596 | @ <table class="subscribe"> |
| 2597 | 2597 | if( zCaptcha ){ |
| 2598 | 2598 | @ <tr> |
| 2599 | 2599 | @ <td class="form_label">Security Code:</td> |
| 2600 | 2600 | @ <td><input type="text" name="captcha" value="" size="10"> |
| 2601 | + captcha_speakit_button(uSeed, "Speak the code"); | |
| 2601 | 2602 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 2602 | 2603 | @ </tr> |
| 2603 | 2604 | } |
| 2604 | 2605 | @ <tr> |
| 2605 | 2606 | @ <td class="form_label">Your Email Address:</td> |
| @@ -2623,11 +2624,10 @@ | ||
| 2623 | 2624 | if( zCaptcha ){ |
| 2624 | 2625 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 2625 | 2626 | @ %h(zCaptcha) |
| 2626 | 2627 | @ </pre> |
| 2627 | 2628 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 2628 | - captcha_speakit_button(uSeed); | |
| 2629 | 2629 | @ </td></tr></table></div> |
| 2630 | 2630 | } |
| 2631 | 2631 | @ </form> |
| 2632 | 2632 | style_footer(); |
| 2633 | 2633 | } |
| 2634 | 2634 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1392,10 +1392,11 @@ | |
| 1392 | zDecoded = captcha_decode(uSeed); |
| 1393 | zCaptcha = captcha_render(zDecoded); |
| 1394 | @ <tr> |
| 1395 | @ <td class="form_label">Security Code:</td> |
| 1396 | @ <td><input type="text" name="captcha" value="" size="30"> |
| 1397 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 1398 | @ </tr> |
| 1399 | if( eErr==2 ){ |
| 1400 | @ <tr><td><td><span class='loginError'>↑ %h(zErr)</span></td></tr> |
| 1401 | } |
| @@ -1462,11 +1463,10 @@ | |
| 1462 | if( needCaptcha ){ |
| 1463 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 1464 | @ %h(zCaptcha) |
| 1465 | @ </pre> |
| 1466 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 1467 | captcha_speakit_button(uSeed); |
| 1468 | @ </td></tr></table></div> |
| 1469 | } |
| 1470 | @ </form> |
| 1471 | fossil_free(zErr); |
| 1472 | style_footer(); |
| @@ -1856,10 +1856,11 @@ | |
| 1856 | zDecoded = captcha_decode(uSeed); |
| 1857 | zCaptcha = captcha_render(zDecoded); |
| 1858 | @ <tr> |
| 1859 | @ <td class="form_label">Security Code:</td> |
| 1860 | @ <td><input type="text" name="captcha" value="" size="30"> |
| 1861 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 1862 | if( eErr==2 ){ |
| 1863 | @ <td><span class="loginError">← %h(zErr)</span></td> |
| 1864 | } |
| 1865 | @ </tr> |
| @@ -1876,11 +1877,10 @@ | |
| 1876 | @ </table> |
| 1877 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 1878 | @ %h(zCaptcha) |
| 1879 | @ </pre> |
| 1880 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 1881 | captcha_speakit_button(uSeed); |
| 1882 | @ </td></tr></table></div> |
| 1883 | @ </form> |
| 1884 | fossil_free(zErr); |
| 1885 | style_footer(); |
| 1886 | } |
| @@ -2596,10 +2596,11 @@ | |
| 2596 | @ <table class="subscribe"> |
| 2597 | if( zCaptcha ){ |
| 2598 | @ <tr> |
| 2599 | @ <td class="form_label">Security Code:</td> |
| 2600 | @ <td><input type="text" name="captcha" value="" size="10"> |
| 2601 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 2602 | @ </tr> |
| 2603 | } |
| 2604 | @ <tr> |
| 2605 | @ <td class="form_label">Your Email Address:</td> |
| @@ -2623,11 +2624,10 @@ | |
| 2623 | if( zCaptcha ){ |
| 2624 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 2625 | @ %h(zCaptcha) |
| 2626 | @ </pre> |
| 2627 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 2628 | captcha_speakit_button(uSeed); |
| 2629 | @ </td></tr></table></div> |
| 2630 | } |
| 2631 | @ </form> |
| 2632 | style_footer(); |
| 2633 | } |
| 2634 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1392,10 +1392,11 @@ | |
| 1392 | zDecoded = captcha_decode(uSeed); |
| 1393 | zCaptcha = captcha_render(zDecoded); |
| 1394 | @ <tr> |
| 1395 | @ <td class="form_label">Security Code:</td> |
| 1396 | @ <td><input type="text" name="captcha" value="" size="30"> |
| 1397 | captcha_speakit_button(uSeed, "Speak the code"); |
| 1398 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 1399 | @ </tr> |
| 1400 | if( eErr==2 ){ |
| 1401 | @ <tr><td><td><span class='loginError'>↑ %h(zErr)</span></td></tr> |
| 1402 | } |
| @@ -1462,11 +1463,10 @@ | |
| 1463 | if( needCaptcha ){ |
| 1464 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 1465 | @ %h(zCaptcha) |
| 1466 | @ </pre> |
| 1467 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 1468 | @ </td></tr></table></div> |
| 1469 | } |
| 1470 | @ </form> |
| 1471 | fossil_free(zErr); |
| 1472 | style_footer(); |
| @@ -1856,10 +1856,11 @@ | |
| 1856 | zDecoded = captcha_decode(uSeed); |
| 1857 | zCaptcha = captcha_render(zDecoded); |
| 1858 | @ <tr> |
| 1859 | @ <td class="form_label">Security Code:</td> |
| 1860 | @ <td><input type="text" name="captcha" value="" size="30"> |
| 1861 | captcha_speakit_button(uSeed, "Speak the code"); |
| 1862 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 1863 | if( eErr==2 ){ |
| 1864 | @ <td><span class="loginError">← %h(zErr)</span></td> |
| 1865 | } |
| 1866 | @ </tr> |
| @@ -1876,11 +1877,10 @@ | |
| 1877 | @ </table> |
| 1878 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 1879 | @ %h(zCaptcha) |
| 1880 | @ </pre> |
| 1881 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 1882 | @ </td></tr></table></div> |
| 1883 | @ </form> |
| 1884 | fossil_free(zErr); |
| 1885 | style_footer(); |
| 1886 | } |
| @@ -2596,10 +2596,11 @@ | |
| 2596 | @ <table class="subscribe"> |
| 2597 | if( zCaptcha ){ |
| 2598 | @ <tr> |
| 2599 | @ <td class="form_label">Security Code:</td> |
| 2600 | @ <td><input type="text" name="captcha" value="" size="10"> |
| 2601 | captcha_speakit_button(uSeed, "Speak the code"); |
| 2602 | @ <input type="hidden" name="captchaseed" value="%u(uSeed)"></td> |
| 2603 | @ </tr> |
| 2604 | } |
| 2605 | @ <tr> |
| 2606 | @ <td class="form_label">Your Email Address:</td> |
| @@ -2623,11 +2624,10 @@ | |
| 2624 | if( zCaptcha ){ |
| 2625 | @ <div class="captcha"><table class="captcha"><tr><td><pre class="captcha"> |
| 2626 | @ %h(zCaptcha) |
| 2627 | @ </pre> |
| 2628 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 2629 | @ </td></tr></table></div> |
| 2630 | } |
| 2631 | @ </form> |
| 2632 | style_footer(); |
| 2633 | } |
| 2634 |
+4
-3
| --- src/captcha.c | ||
| +++ src/captcha.c | ||
| @@ -549,19 +549,20 @@ | ||
| 549 | 549 | @ <input type="text" name="captcha" size=8 /> |
| 550 | 550 | if( showButton ){ |
| 551 | 551 | @ <input type="submit" value="Submit"> |
| 552 | 552 | } |
| 553 | 553 | @ <br/>\ |
| 554 | - captcha_speakit_button(uSeed); | |
| 554 | + captcha_speakit_button(uSeed, 0); | |
| 555 | 555 | @ </td></tr></table></div> |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | /* |
| 559 | 559 | ** Add a "Speak the captcha" button. |
| 560 | 560 | */ |
| 561 | -void captcha_speakit_button(unsigned int uSeed){ | |
| 562 | - @ <input type="button" value="Speak the text" id="speakthetext"> | |
| 561 | +void captcha_speakit_button(unsigned int uSeed, const char *zMsg){ | |
| 562 | + if( zMsg==0 ) zMsg = "Speak the text"; | |
| 563 | + @ <input type="button" value="%h(zMsg)" id="speakthetext"> | |
| 563 | 564 | @ <audio id="spokencaptcha" src="%R/captcha-audio/%u(uSeed)" /> |
| 564 | 565 | @ <script nonce="%h(style_nonce())"> |
| 565 | 566 | @ var x = document.getElementById("speakthetext") |
| 566 | 567 | @ x.onclick = function(){ |
| 567 | 568 | @ var audio = document.getElementById("spokencaptcha"); |
| 568 | 569 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -549,19 +549,20 @@ | |
| 549 | @ <input type="text" name="captcha" size=8 /> |
| 550 | if( showButton ){ |
| 551 | @ <input type="submit" value="Submit"> |
| 552 | } |
| 553 | @ <br/>\ |
| 554 | captcha_speakit_button(uSeed); |
| 555 | @ </td></tr></table></div> |
| 556 | } |
| 557 | |
| 558 | /* |
| 559 | ** Add a "Speak the captcha" button. |
| 560 | */ |
| 561 | void captcha_speakit_button(unsigned int uSeed){ |
| 562 | @ <input type="button" value="Speak the text" id="speakthetext"> |
| 563 | @ <audio id="spokencaptcha" src="%R/captcha-audio/%u(uSeed)" /> |
| 564 | @ <script nonce="%h(style_nonce())"> |
| 565 | @ var x = document.getElementById("speakthetext") |
| 566 | @ x.onclick = function(){ |
| 567 | @ var audio = document.getElementById("spokencaptcha"); |
| 568 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -549,19 +549,20 @@ | |
| 549 | @ <input type="text" name="captcha" size=8 /> |
| 550 | if( showButton ){ |
| 551 | @ <input type="submit" value="Submit"> |
| 552 | } |
| 553 | @ <br/>\ |
| 554 | captcha_speakit_button(uSeed, 0); |
| 555 | @ </td></tr></table></div> |
| 556 | } |
| 557 | |
| 558 | /* |
| 559 | ** Add a "Speak the captcha" button. |
| 560 | */ |
| 561 | void captcha_speakit_button(unsigned int uSeed, const char *zMsg){ |
| 562 | if( zMsg==0 ) zMsg = "Speak the text"; |
| 563 | @ <input type="button" value="%h(zMsg)" id="speakthetext"> |
| 564 | @ <audio id="spokencaptcha" src="%R/captcha-audio/%u(uSeed)" /> |
| 565 | @ <script nonce="%h(style_nonce())"> |
| 566 | @ var x = document.getElementById("speakthetext") |
| 567 | @ x.onclick = function(){ |
| 568 | @ var audio = document.getElementById("spokencaptcha"); |
| 569 |
+13
-8
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -702,10 +702,18 @@ | ||
| 702 | 702 | if( g.zLogin ){ |
| 703 | 703 | @ <p>Currently logged in as <b>%h(g.zLogin)</b>. |
| 704 | 704 | @ <input type="submit" name="out" value="Logout"></p> |
| 705 | 705 | @ </form> |
| 706 | 706 | }else{ |
| 707 | + unsigned int uSeed = captcha_seed(); | |
| 708 | + if( g.zLogin==0 && (anonFlag || zGoto==0) ){ | |
| 709 | + zAnonPw = db_text(0, "SELECT pw FROM user" | |
| 710 | + " WHERE login='anonymous'" | |
| 711 | + " AND cap!=''"); | |
| 712 | + }else{ | |
| 713 | + zAnonPw = 0; | |
| 714 | + } | |
| 707 | 715 | @ <table class="login_out"> |
| 708 | 716 | @ <tr> |
| 709 | 717 | @ <td class="form_label">User ID:</td> |
| 710 | 718 | if( anonFlag ){ |
| 711 | 719 | @ <td><input type="text" id="u" name="u" value="anonymous" size="30"></td> |
| @@ -713,11 +721,15 @@ | ||
| 713 | 721 | @ <td><input type="text" id="u" name="u" value="" size="30" /></td> |
| 714 | 722 | } |
| 715 | 723 | @ </tr> |
| 716 | 724 | @ <tr> |
| 717 | 725 | @ <td class="form_label">Password:</td> |
| 718 | - @ <td><input type="password" id="p" name="p" value="" size="30" /></td> | |
| 726 | + @ <td><input type="password" id="p" name="p" value="" size="30" />\ | |
| 727 | + if( zAnonPw && !noAnon ){ | |
| 728 | + captcha_speakit_button(uSeed, "Speak password for \"anonymous\""); | |
| 729 | + } | |
| 730 | + @ </td> | |
| 719 | 731 | @ </tr> |
| 720 | 732 | if( P("HTTPS")==0 ){ |
| 721 | 733 | @ <tr><td class="form_label">Warning:</td> |
| 722 | 734 | @ <td><span class='securityWarning'> |
| 723 | 735 | @ Your password will be sent in the clear over an |
| @@ -728,15 +740,10 @@ | ||
| 728 | 740 | @ Consider logging in at |
| 729 | 741 | @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead. |
| 730 | 742 | } |
| 731 | 743 | @ </span></td></tr> |
| 732 | 744 | } |
| 733 | - if( g.zLogin==0 && (anonFlag || zGoto==0) ){ | |
| 734 | - zAnonPw = db_text(0, "SELECT pw FROM user" | |
| 735 | - " WHERE login='anonymous'" | |
| 736 | - " AND cap!=''"); | |
| 737 | - } | |
| 738 | 745 | @ <tr> |
| 739 | 746 | @ <td></td> |
| 740 | 747 | @ <td><input type="submit" name="in" value="Login"></td> |
| 741 | 748 | @ </tr> |
| 742 | 749 | if( !noAnon && login_self_register_available(0) ){ |
| @@ -745,11 +752,10 @@ | ||
| 745 | 752 | @ <td><input type="submit" name="self" value="Create A New Account"> |
| 746 | 753 | @ </tr> |
| 747 | 754 | } |
| 748 | 755 | @ </table> |
| 749 | 756 | if( zAnonPw && !noAnon ){ |
| 750 | - unsigned int uSeed = captcha_seed(); | |
| 751 | 757 | const char *zDecoded = captcha_decode(uSeed); |
| 752 | 758 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 753 | 759 | char *zCaptcha = captcha_render(zDecoded); |
| 754 | 760 | |
| 755 | 761 | @ <p><input type="hidden" name="cs" value="%u(uSeed)" /> |
| @@ -757,11 +763,10 @@ | ||
| 757 | 763 | @ the 8-character hexadecimal password shown below:</p> |
| 758 | 764 | @ <div class="captcha"><table class="captcha"><tr><td>\ |
| 759 | 765 | @ <pre class="captcha"> |
| 760 | 766 | @ %h(zCaptcha) |
| 761 | 767 | @ </pre></td></tr></table> |
| 762 | - captcha_speakit_button(uSeed); | |
| 763 | 768 | if( bAutoCaptcha ) { |
| 764 | 769 | @ <input type="button" value="Fill out captcha" id='autofillButton' \ |
| 765 | 770 | @ data-af='%s(zDecoded)' /> |
| 766 | 771 | style_load_one_js_file("login.js"); |
| 767 | 772 | } |
| 768 | 773 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -702,10 +702,18 @@ | |
| 702 | if( g.zLogin ){ |
| 703 | @ <p>Currently logged in as <b>%h(g.zLogin)</b>. |
| 704 | @ <input type="submit" name="out" value="Logout"></p> |
| 705 | @ </form> |
| 706 | }else{ |
| 707 | @ <table class="login_out"> |
| 708 | @ <tr> |
| 709 | @ <td class="form_label">User ID:</td> |
| 710 | if( anonFlag ){ |
| 711 | @ <td><input type="text" id="u" name="u" value="anonymous" size="30"></td> |
| @@ -713,11 +721,15 @@ | |
| 713 | @ <td><input type="text" id="u" name="u" value="" size="30" /></td> |
| 714 | } |
| 715 | @ </tr> |
| 716 | @ <tr> |
| 717 | @ <td class="form_label">Password:</td> |
| 718 | @ <td><input type="password" id="p" name="p" value="" size="30" /></td> |
| 719 | @ </tr> |
| 720 | if( P("HTTPS")==0 ){ |
| 721 | @ <tr><td class="form_label">Warning:</td> |
| 722 | @ <td><span class='securityWarning'> |
| 723 | @ Your password will be sent in the clear over an |
| @@ -728,15 +740,10 @@ | |
| 728 | @ Consider logging in at |
| 729 | @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead. |
| 730 | } |
| 731 | @ </span></td></tr> |
| 732 | } |
| 733 | if( g.zLogin==0 && (anonFlag || zGoto==0) ){ |
| 734 | zAnonPw = db_text(0, "SELECT pw FROM user" |
| 735 | " WHERE login='anonymous'" |
| 736 | " AND cap!=''"); |
| 737 | } |
| 738 | @ <tr> |
| 739 | @ <td></td> |
| 740 | @ <td><input type="submit" name="in" value="Login"></td> |
| 741 | @ </tr> |
| 742 | if( !noAnon && login_self_register_available(0) ){ |
| @@ -745,11 +752,10 @@ | |
| 745 | @ <td><input type="submit" name="self" value="Create A New Account"> |
| 746 | @ </tr> |
| 747 | } |
| 748 | @ </table> |
| 749 | if( zAnonPw && !noAnon ){ |
| 750 | unsigned int uSeed = captcha_seed(); |
| 751 | const char *zDecoded = captcha_decode(uSeed); |
| 752 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 753 | char *zCaptcha = captcha_render(zDecoded); |
| 754 | |
| 755 | @ <p><input type="hidden" name="cs" value="%u(uSeed)" /> |
| @@ -757,11 +763,10 @@ | |
| 757 | @ the 8-character hexadecimal password shown below:</p> |
| 758 | @ <div class="captcha"><table class="captcha"><tr><td>\ |
| 759 | @ <pre class="captcha"> |
| 760 | @ %h(zCaptcha) |
| 761 | @ </pre></td></tr></table> |
| 762 | captcha_speakit_button(uSeed); |
| 763 | if( bAutoCaptcha ) { |
| 764 | @ <input type="button" value="Fill out captcha" id='autofillButton' \ |
| 765 | @ data-af='%s(zDecoded)' /> |
| 766 | style_load_one_js_file("login.js"); |
| 767 | } |
| 768 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -702,10 +702,18 @@ | |
| 702 | if( g.zLogin ){ |
| 703 | @ <p>Currently logged in as <b>%h(g.zLogin)</b>. |
| 704 | @ <input type="submit" name="out" value="Logout"></p> |
| 705 | @ </form> |
| 706 | }else{ |
| 707 | unsigned int uSeed = captcha_seed(); |
| 708 | if( g.zLogin==0 && (anonFlag || zGoto==0) ){ |
| 709 | zAnonPw = db_text(0, "SELECT pw FROM user" |
| 710 | " WHERE login='anonymous'" |
| 711 | " AND cap!=''"); |
| 712 | }else{ |
| 713 | zAnonPw = 0; |
| 714 | } |
| 715 | @ <table class="login_out"> |
| 716 | @ <tr> |
| 717 | @ <td class="form_label">User ID:</td> |
| 718 | if( anonFlag ){ |
| 719 | @ <td><input type="text" id="u" name="u" value="anonymous" size="30"></td> |
| @@ -713,11 +721,15 @@ | |
| 721 | @ <td><input type="text" id="u" name="u" value="" size="30" /></td> |
| 722 | } |
| 723 | @ </tr> |
| 724 | @ <tr> |
| 725 | @ <td class="form_label">Password:</td> |
| 726 | @ <td><input type="password" id="p" name="p" value="" size="30" />\ |
| 727 | if( zAnonPw && !noAnon ){ |
| 728 | captcha_speakit_button(uSeed, "Speak password for \"anonymous\""); |
| 729 | } |
| 730 | @ </td> |
| 731 | @ </tr> |
| 732 | if( P("HTTPS")==0 ){ |
| 733 | @ <tr><td class="form_label">Warning:</td> |
| 734 | @ <td><span class='securityWarning'> |
| 735 | @ Your password will be sent in the clear over an |
| @@ -728,15 +740,10 @@ | |
| 740 | @ Consider logging in at |
| 741 | @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead. |
| 742 | } |
| 743 | @ </span></td></tr> |
| 744 | } |
| 745 | @ <tr> |
| 746 | @ <td></td> |
| 747 | @ <td><input type="submit" name="in" value="Login"></td> |
| 748 | @ </tr> |
| 749 | if( !noAnon && login_self_register_available(0) ){ |
| @@ -745,11 +752,10 @@ | |
| 752 | @ <td><input type="submit" name="self" value="Create A New Account"> |
| 753 | @ </tr> |
| 754 | } |
| 755 | @ </table> |
| 756 | if( zAnonPw && !noAnon ){ |
| 757 | const char *zDecoded = captcha_decode(uSeed); |
| 758 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 759 | char *zCaptcha = captcha_render(zDecoded); |
| 760 | |
| 761 | @ <p><input type="hidden" name="cs" value="%u(uSeed)" /> |
| @@ -757,11 +763,10 @@ | |
| 763 | @ the 8-character hexadecimal password shown below:</p> |
| 764 | @ <div class="captcha"><table class="captcha"><tr><td>\ |
| 765 | @ <pre class="captcha"> |
| 766 | @ %h(zCaptcha) |
| 767 | @ </pre></td></tr></table> |
| 768 | if( bAutoCaptcha ) { |
| 769 | @ <input type="button" value="Fill out captcha" id='autofillButton' \ |
| 770 | @ data-af='%s(zDecoded)' /> |
| 771 | style_load_one_js_file("login.js"); |
| 772 | } |
| 773 |