Fossil SCM
If the user is not logged in, prompt them to do so before continuing to the forum entry pages.
Commit
009ca1f74e48b232cd7ac5762ab4b45494d8916a416f7d6bc3193ce72595be6d
Parent
14335899ef335f7…
2 files changed
+81
-8
+4
-3
+81
-8
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -631,10 +631,79 @@ | ||
| 631 | 631 | @ rows="25" wrap="virtual">%h(zContent)</textarea><br> |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | /* |
| 635 | 635 | ** WEBPAGE: forumnew |
| 636 | +** WEBPAGE: forumedit | |
| 637 | +** | |
| 638 | +** Start a new thread on the forum or reply to an existing thread. | |
| 639 | +** But first prompt to see if the user would like to log in. | |
| 640 | +*/ | |
| 641 | +void forum_page_init(void){ | |
| 642 | + int isEdit; | |
| 643 | + char *zGoto; | |
| 644 | + login_check_credentials(); | |
| 645 | + if( !g.perm.WrForum ){ | |
| 646 | + login_needed(g.anon.WrForum); | |
| 647 | + return; | |
| 648 | + } | |
| 649 | + if( sqlite3_strglob("*edit*", g.zPath)==0 ){ | |
| 650 | + zGoto = mprintf("%R/forume2?fpid=%S",PD("fpid","")); | |
| 651 | + isEdit = 1; | |
| 652 | + }else{ | |
| 653 | + zGoto = mprintf("%R/forume1"); | |
| 654 | + isEdit = 0; | |
| 655 | + } | |
| 656 | + if( login_is_individual() ){ | |
| 657 | + if( isEdit ){ | |
| 658 | + forumedit_page(); | |
| 659 | + }else{ | |
| 660 | + forumnew_page(); | |
| 661 | + } | |
| 662 | + return; | |
| 663 | + } | |
| 664 | + style_header("%h As Anonymous?", isEdit ? "Reply" : "Post"); | |
| 665 | + @ <p>You are not logged in. | |
| 666 | + @ <p><table border="0" cellpadding="10"> | |
| 667 | + @ <tr><td> | |
| 668 | + @ <form action="%s(zGoto)" method="POST"> | |
| 669 | + @ <input type="submit" value="Remain Anonymous"> | |
| 670 | + @ </form> | |
| 671 | + @ <td>Post to the forum anonymously | |
| 672 | + if( login_self_register_available(0) ){ | |
| 673 | + @ <tr><td> | |
| 674 | + @ <form action="%R/register" method="POST"> | |
| 675 | + @ <input type="hidden" name="g" value="%s(zGoto)"> | |
| 676 | + @ <input type="submit" value="Create An Account"> | |
| 677 | + @ </form> | |
| 678 | + @ <td>Create a new account and post using that new account | |
| 679 | + } | |
| 680 | + @ <tr><td> | |
| 681 | + @ <form action="%R/login" method="POST"> | |
| 682 | + @ <input type="hidden" name="g" value="%s(zGoto)"> | |
| 683 | + @ <input type="hidden" name="noanon" value="1"> | |
| 684 | + @ <input type="submit" value="Login"> | |
| 685 | + @ </form> | |
| 686 | + @ <td>Log into an existing account | |
| 687 | + @ </table> | |
| 688 | + style_footer(); | |
| 689 | + fossil_free(zGoto); | |
| 690 | +} | |
| 691 | + | |
| 692 | +/* | |
| 693 | +** Write the "From: USER" line on the webpage. | |
| 694 | +*/ | |
| 695 | +static void forum_from_line(void){ | |
| 696 | + if( login_is_nobody() ){ | |
| 697 | + @ From: anonymous<br> | |
| 698 | + }else{ | |
| 699 | + @ From: %h(login_name())<br> | |
| 700 | + } | |
| 701 | +} | |
| 702 | + | |
| 703 | +/* | |
| 704 | +** WEBPAGE: forume1 | |
| 636 | 705 | ** |
| 637 | 706 | ** Start a new forum thread. |
| 638 | 707 | */ |
| 639 | 708 | void forumnew_page(void){ |
| 640 | 709 | const char *zTitle = PDT("title",""); |
| @@ -651,11 +720,13 @@ | ||
| 651 | 720 | if( P("preview") ){ |
| 652 | 721 | @ <h1>Preview:</h1> |
| 653 | 722 | forum_render(zTitle, zMimetype, zContent, "forumEdit"); |
| 654 | 723 | } |
| 655 | 724 | style_header("New Forum Thread"); |
| 656 | - @ <form action="%R/%s(g.zPath)" method="POST"> | |
| 725 | + @ <form action="%R/forume1" method="POST"> | |
| 726 | + @ <h1>New Message:</h1> | |
| 727 | + forum_from_line(); | |
| 657 | 728 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 658 | 729 | @ <input type="submit" name="preview" value="Preview"> |
| 659 | 730 | if( P("preview") ){ |
| 660 | 731 | @ <input type="submit" name="submit" value="Submit"> |
| 661 | 732 | }else{ |
| @@ -675,16 +746,16 @@ | ||
| 675 | 746 | @ </form> |
| 676 | 747 | style_footer(); |
| 677 | 748 | } |
| 678 | 749 | |
| 679 | 750 | /* |
| 680 | -** WEBPAGE: forumedit | |
| 751 | +** WEBPAGE: forume2 | |
| 681 | 752 | ** |
| 682 | 753 | ** Edit an existing forum message. |
| 683 | 754 | ** Query parameters: |
| 684 | 755 | ** |
| 685 | -** name=X Hash of the post to be editted. REQUIRED | |
| 756 | +** fpid=X Hash of the post to be editted. REQUIRED | |
| 686 | 757 | */ |
| 687 | 758 | void forumedit_page(void){ |
| 688 | 759 | int fpid; |
| 689 | 760 | Manifest *pPost; |
| 690 | 761 | const char *zMimetype = 0; |
| @@ -741,11 +812,11 @@ | ||
| 741 | 812 | @ <h1>Original Post:</h1> |
| 742 | 813 | forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki, |
| 743 | 814 | "forumEdit"); |
| 744 | 815 | @ <h1>Change Into:</h1> |
| 745 | 816 | forum_render(zTitle, zMimetype, zContent,"forumEdit"); |
| 746 | - @ <form action="%R/forumedit" method="POST"> | |
| 817 | + @ <form action="%R/forume2" method="POST"> | |
| 747 | 818 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 748 | 819 | @ <input type="hidden" name="nullout" value="1"> |
| 749 | 820 | @ <input type="hidden" name="mimetype" value="%h(zMimetype)"> |
| 750 | 821 | @ <input type="hidden" name="content" value="%h(zContent)"> |
| 751 | 822 | if( zTitle ){ |
| @@ -767,14 +838,15 @@ | ||
| 767 | 838 | "forumEdit"); |
| 768 | 839 | if( P("preview") ){ |
| 769 | 840 | @ <h1>Preview Of Editted Post:</h1> |
| 770 | 841 | forum_render(zTitle, zMimetype, zContent,"forumEdit"); |
| 771 | 842 | } |
| 772 | - @ <h1>Enter A Reply:</h1> | |
| 773 | - @ <form action="%R/forumedit" method="POST"> | |
| 843 | + @ <h1>Revised Message:</h1> | |
| 844 | + @ <form action="%R/forume2" method="POST"> | |
| 774 | 845 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 775 | 846 | @ <input type="hidden" name="edit" value="1"> |
| 847 | + forum_from_line(); | |
| 776 | 848 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 777 | 849 | }else{ |
| 778 | 850 | /* Reply */ |
| 779 | 851 | zMimetype = PD("mimetype","text/x-fossil-wiki"); |
| 780 | 852 | zContent = PDT("content",""); |
| @@ -783,14 +855,15 @@ | ||
| 783 | 855 | forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit"); |
| 784 | 856 | if( P("preview") ){ |
| 785 | 857 | @ <h1>Preview:</h1> |
| 786 | 858 | forum_render(0, zMimetype,zContent, "forumEdit"); |
| 787 | 859 | } |
| 788 | - @ <h1>Enter A Reply:</h1> | |
| 789 | - @ <form action="%R/forumedit" method="POST"> | |
| 860 | + @ <h1>Enter Reply:</h1> | |
| 861 | + @ <form action="%R/forume2" method="POST"> | |
| 790 | 862 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 791 | 863 | @ <input type="hidden" name="reply" value="1"> |
| 864 | + forum_from_line(); | |
| 792 | 865 | forum_entry_widget(0, zMimetype, zContent); |
| 793 | 866 | } |
| 794 | 867 | if( !isDelete ){ |
| 795 | 868 | @ <input type="submit" name="preview" value="Preview"> |
| 796 | 869 | } |
| 797 | 870 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -631,10 +631,79 @@ | |
| 631 | @ rows="25" wrap="virtual">%h(zContent)</textarea><br> |
| 632 | } |
| 633 | |
| 634 | /* |
| 635 | ** WEBPAGE: forumnew |
| 636 | ** |
| 637 | ** Start a new forum thread. |
| 638 | */ |
| 639 | void forumnew_page(void){ |
| 640 | const char *zTitle = PDT("title",""); |
| @@ -651,11 +720,13 @@ | |
| 651 | if( P("preview") ){ |
| 652 | @ <h1>Preview:</h1> |
| 653 | forum_render(zTitle, zMimetype, zContent, "forumEdit"); |
| 654 | } |
| 655 | style_header("New Forum Thread"); |
| 656 | @ <form action="%R/%s(g.zPath)" method="POST"> |
| 657 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 658 | @ <input type="submit" name="preview" value="Preview"> |
| 659 | if( P("preview") ){ |
| 660 | @ <input type="submit" name="submit" value="Submit"> |
| 661 | }else{ |
| @@ -675,16 +746,16 @@ | |
| 675 | @ </form> |
| 676 | style_footer(); |
| 677 | } |
| 678 | |
| 679 | /* |
| 680 | ** WEBPAGE: forumedit |
| 681 | ** |
| 682 | ** Edit an existing forum message. |
| 683 | ** Query parameters: |
| 684 | ** |
| 685 | ** name=X Hash of the post to be editted. REQUIRED |
| 686 | */ |
| 687 | void forumedit_page(void){ |
| 688 | int fpid; |
| 689 | Manifest *pPost; |
| 690 | const char *zMimetype = 0; |
| @@ -741,11 +812,11 @@ | |
| 741 | @ <h1>Original Post:</h1> |
| 742 | forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki, |
| 743 | "forumEdit"); |
| 744 | @ <h1>Change Into:</h1> |
| 745 | forum_render(zTitle, zMimetype, zContent,"forumEdit"); |
| 746 | @ <form action="%R/forumedit" method="POST"> |
| 747 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 748 | @ <input type="hidden" name="nullout" value="1"> |
| 749 | @ <input type="hidden" name="mimetype" value="%h(zMimetype)"> |
| 750 | @ <input type="hidden" name="content" value="%h(zContent)"> |
| 751 | if( zTitle ){ |
| @@ -767,14 +838,15 @@ | |
| 767 | "forumEdit"); |
| 768 | if( P("preview") ){ |
| 769 | @ <h1>Preview Of Editted Post:</h1> |
| 770 | forum_render(zTitle, zMimetype, zContent,"forumEdit"); |
| 771 | } |
| 772 | @ <h1>Enter A Reply:</h1> |
| 773 | @ <form action="%R/forumedit" method="POST"> |
| 774 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 775 | @ <input type="hidden" name="edit" value="1"> |
| 776 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 777 | }else{ |
| 778 | /* Reply */ |
| 779 | zMimetype = PD("mimetype","text/x-fossil-wiki"); |
| 780 | zContent = PDT("content",""); |
| @@ -783,14 +855,15 @@ | |
| 783 | forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit"); |
| 784 | if( P("preview") ){ |
| 785 | @ <h1>Preview:</h1> |
| 786 | forum_render(0, zMimetype,zContent, "forumEdit"); |
| 787 | } |
| 788 | @ <h1>Enter A Reply:</h1> |
| 789 | @ <form action="%R/forumedit" method="POST"> |
| 790 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 791 | @ <input type="hidden" name="reply" value="1"> |
| 792 | forum_entry_widget(0, zMimetype, zContent); |
| 793 | } |
| 794 | if( !isDelete ){ |
| 795 | @ <input type="submit" name="preview" value="Preview"> |
| 796 | } |
| 797 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -631,10 +631,79 @@ | |
| 631 | @ rows="25" wrap="virtual">%h(zContent)</textarea><br> |
| 632 | } |
| 633 | |
| 634 | /* |
| 635 | ** WEBPAGE: forumnew |
| 636 | ** WEBPAGE: forumedit |
| 637 | ** |
| 638 | ** Start a new thread on the forum or reply to an existing thread. |
| 639 | ** But first prompt to see if the user would like to log in. |
| 640 | */ |
| 641 | void forum_page_init(void){ |
| 642 | int isEdit; |
| 643 | char *zGoto; |
| 644 | login_check_credentials(); |
| 645 | if( !g.perm.WrForum ){ |
| 646 | login_needed(g.anon.WrForum); |
| 647 | return; |
| 648 | } |
| 649 | if( sqlite3_strglob("*edit*", g.zPath)==0 ){ |
| 650 | zGoto = mprintf("%R/forume2?fpid=%S",PD("fpid","")); |
| 651 | isEdit = 1; |
| 652 | }else{ |
| 653 | zGoto = mprintf("%R/forume1"); |
| 654 | isEdit = 0; |
| 655 | } |
| 656 | if( login_is_individual() ){ |
| 657 | if( isEdit ){ |
| 658 | forumedit_page(); |
| 659 | }else{ |
| 660 | forumnew_page(); |
| 661 | } |
| 662 | return; |
| 663 | } |
| 664 | style_header("%h As Anonymous?", isEdit ? "Reply" : "Post"); |
| 665 | @ <p>You are not logged in. |
| 666 | @ <p><table border="0" cellpadding="10"> |
| 667 | @ <tr><td> |
| 668 | @ <form action="%s(zGoto)" method="POST"> |
| 669 | @ <input type="submit" value="Remain Anonymous"> |
| 670 | @ </form> |
| 671 | @ <td>Post to the forum anonymously |
| 672 | if( login_self_register_available(0) ){ |
| 673 | @ <tr><td> |
| 674 | @ <form action="%R/register" method="POST"> |
| 675 | @ <input type="hidden" name="g" value="%s(zGoto)"> |
| 676 | @ <input type="submit" value="Create An Account"> |
| 677 | @ </form> |
| 678 | @ <td>Create a new account and post using that new account |
| 679 | } |
| 680 | @ <tr><td> |
| 681 | @ <form action="%R/login" method="POST"> |
| 682 | @ <input type="hidden" name="g" value="%s(zGoto)"> |
| 683 | @ <input type="hidden" name="noanon" value="1"> |
| 684 | @ <input type="submit" value="Login"> |
| 685 | @ </form> |
| 686 | @ <td>Log into an existing account |
| 687 | @ </table> |
| 688 | style_footer(); |
| 689 | fossil_free(zGoto); |
| 690 | } |
| 691 | |
| 692 | /* |
| 693 | ** Write the "From: USER" line on the webpage. |
| 694 | */ |
| 695 | static void forum_from_line(void){ |
| 696 | if( login_is_nobody() ){ |
| 697 | @ From: anonymous<br> |
| 698 | }else{ |
| 699 | @ From: %h(login_name())<br> |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | /* |
| 704 | ** WEBPAGE: forume1 |
| 705 | ** |
| 706 | ** Start a new forum thread. |
| 707 | */ |
| 708 | void forumnew_page(void){ |
| 709 | const char *zTitle = PDT("title",""); |
| @@ -651,11 +720,13 @@ | |
| 720 | if( P("preview") ){ |
| 721 | @ <h1>Preview:</h1> |
| 722 | forum_render(zTitle, zMimetype, zContent, "forumEdit"); |
| 723 | } |
| 724 | style_header("New Forum Thread"); |
| 725 | @ <form action="%R/forume1" method="POST"> |
| 726 | @ <h1>New Message:</h1> |
| 727 | forum_from_line(); |
| 728 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 729 | @ <input type="submit" name="preview" value="Preview"> |
| 730 | if( P("preview") ){ |
| 731 | @ <input type="submit" name="submit" value="Submit"> |
| 732 | }else{ |
| @@ -675,16 +746,16 @@ | |
| 746 | @ </form> |
| 747 | style_footer(); |
| 748 | } |
| 749 | |
| 750 | /* |
| 751 | ** WEBPAGE: forume2 |
| 752 | ** |
| 753 | ** Edit an existing forum message. |
| 754 | ** Query parameters: |
| 755 | ** |
| 756 | ** fpid=X Hash of the post to be editted. REQUIRED |
| 757 | */ |
| 758 | void forumedit_page(void){ |
| 759 | int fpid; |
| 760 | Manifest *pPost; |
| 761 | const char *zMimetype = 0; |
| @@ -741,11 +812,11 @@ | |
| 812 | @ <h1>Original Post:</h1> |
| 813 | forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki, |
| 814 | "forumEdit"); |
| 815 | @ <h1>Change Into:</h1> |
| 816 | forum_render(zTitle, zMimetype, zContent,"forumEdit"); |
| 817 | @ <form action="%R/forume2" method="POST"> |
| 818 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 819 | @ <input type="hidden" name="nullout" value="1"> |
| 820 | @ <input type="hidden" name="mimetype" value="%h(zMimetype)"> |
| 821 | @ <input type="hidden" name="content" value="%h(zContent)"> |
| 822 | if( zTitle ){ |
| @@ -767,14 +838,15 @@ | |
| 838 | "forumEdit"); |
| 839 | if( P("preview") ){ |
| 840 | @ <h1>Preview Of Editted Post:</h1> |
| 841 | forum_render(zTitle, zMimetype, zContent,"forumEdit"); |
| 842 | } |
| 843 | @ <h1>Revised Message:</h1> |
| 844 | @ <form action="%R/forume2" method="POST"> |
| 845 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 846 | @ <input type="hidden" name="edit" value="1"> |
| 847 | forum_from_line(); |
| 848 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 849 | }else{ |
| 850 | /* Reply */ |
| 851 | zMimetype = PD("mimetype","text/x-fossil-wiki"); |
| 852 | zContent = PDT("content",""); |
| @@ -783,14 +855,15 @@ | |
| 855 | forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit"); |
| 856 | if( P("preview") ){ |
| 857 | @ <h1>Preview:</h1> |
| 858 | forum_render(0, zMimetype,zContent, "forumEdit"); |
| 859 | } |
| 860 | @ <h1>Enter Reply:</h1> |
| 861 | @ <form action="%R/forume2" method="POST"> |
| 862 | @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> |
| 863 | @ <input type="hidden" name="reply" value="1"> |
| 864 | forum_from_line(); |
| 865 | forum_entry_widget(0, zMimetype, zContent); |
| 866 | } |
| 867 | if( !isDelete ){ |
| 868 | @ <input type="submit" name="preview" value="Preview"> |
| 869 | } |
| 870 |
+4
-3
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -516,10 +516,11 @@ | ||
| 516 | 516 | char *zErrMsg = ""; |
| 517 | 517 | int uid; /* User id logged in user */ |
| 518 | 518 | char *zSha1Pw; |
| 519 | 519 | const char *zIpAddr; /* IP address of requestor */ |
| 520 | 520 | const char *zReferer; |
| 521 | + int noAnon = P("noanon")!=0; | |
| 521 | 522 | |
| 522 | 523 | login_check_credentials(); |
| 523 | 524 | if( login_wants_https_redirect() ){ |
| 524 | 525 | const char *zQS = P("QUERY_STRING"); |
| 525 | 526 | if( P("redir")!=0 ){ |
| @@ -655,11 +656,11 @@ | ||
| 655 | 656 | } |
| 656 | 657 | } |
| 657 | 658 | style_header("Login/Logout"); |
| 658 | 659 | style_adunit_config(ADUNIT_OFF); |
| 659 | 660 | @ %s(zErrMsg) |
| 660 | - if( zGoto ){ | |
| 661 | + if( zGoto && !noAnon ){ | |
| 661 | 662 | char *zAbbrev = fossil_strdup(zGoto); |
| 662 | 663 | int i; |
| 663 | 664 | for(i=0; zAbbrev[i] && zAbbrev[i]!='?'; i++){} |
| 664 | 665 | zAbbrev[i] = 0; |
| 665 | 666 | if( g.zLogin ){ |
| @@ -727,20 +728,20 @@ | ||
| 727 | 728 | @ <td></td> |
| 728 | 729 | @ <td><input type="submit" name="in" value="Login"></td> |
| 729 | 730 | @ <td colspan="2">← Pressing this button grants\ |
| 730 | 731 | @ permission to store a cookie |
| 731 | 732 | @ </tr> |
| 732 | - if( login_self_register_available(0) ){ | |
| 733 | + if( !noAnon && login_self_register_available(0) ){ | |
| 733 | 734 | @ <tr> |
| 734 | 735 | @ <td></td> |
| 735 | 736 | @ <td><input type="submit" name="self" value="Create A New Account"> |
| 736 | 737 | @ <td colspan="2"> \ |
| 737 | 738 | @ ← Don't have a login? Click this button to create one. |
| 738 | 739 | @ </tr> |
| 739 | 740 | } |
| 740 | 741 | @ </table> |
| 741 | - if( zAnonPw ){ | |
| 742 | + if( zAnonPw && !noAnon ){ | |
| 742 | 743 | unsigned int uSeed = captcha_seed(); |
| 743 | 744 | const char *zDecoded = captcha_decode(uSeed); |
| 744 | 745 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 745 | 746 | char *zCaptcha = captcha_render(zDecoded); |
| 746 | 747 | |
| 747 | 748 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -516,10 +516,11 @@ | |
| 516 | char *zErrMsg = ""; |
| 517 | int uid; /* User id logged in user */ |
| 518 | char *zSha1Pw; |
| 519 | const char *zIpAddr; /* IP address of requestor */ |
| 520 | const char *zReferer; |
| 521 | |
| 522 | login_check_credentials(); |
| 523 | if( login_wants_https_redirect() ){ |
| 524 | const char *zQS = P("QUERY_STRING"); |
| 525 | if( P("redir")!=0 ){ |
| @@ -655,11 +656,11 @@ | |
| 655 | } |
| 656 | } |
| 657 | style_header("Login/Logout"); |
| 658 | style_adunit_config(ADUNIT_OFF); |
| 659 | @ %s(zErrMsg) |
| 660 | if( zGoto ){ |
| 661 | char *zAbbrev = fossil_strdup(zGoto); |
| 662 | int i; |
| 663 | for(i=0; zAbbrev[i] && zAbbrev[i]!='?'; i++){} |
| 664 | zAbbrev[i] = 0; |
| 665 | if( g.zLogin ){ |
| @@ -727,20 +728,20 @@ | |
| 727 | @ <td></td> |
| 728 | @ <td><input type="submit" name="in" value="Login"></td> |
| 729 | @ <td colspan="2">← Pressing this button grants\ |
| 730 | @ permission to store a cookie |
| 731 | @ </tr> |
| 732 | if( login_self_register_available(0) ){ |
| 733 | @ <tr> |
| 734 | @ <td></td> |
| 735 | @ <td><input type="submit" name="self" value="Create A New Account"> |
| 736 | @ <td colspan="2"> \ |
| 737 | @ ← Don't have a login? Click this button to create one. |
| 738 | @ </tr> |
| 739 | } |
| 740 | @ </table> |
| 741 | if( zAnonPw ){ |
| 742 | unsigned int uSeed = captcha_seed(); |
| 743 | const char *zDecoded = captcha_decode(uSeed); |
| 744 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 745 | char *zCaptcha = captcha_render(zDecoded); |
| 746 | |
| 747 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -516,10 +516,11 @@ | |
| 516 | char *zErrMsg = ""; |
| 517 | int uid; /* User id logged in user */ |
| 518 | char *zSha1Pw; |
| 519 | const char *zIpAddr; /* IP address of requestor */ |
| 520 | const char *zReferer; |
| 521 | int noAnon = P("noanon")!=0; |
| 522 | |
| 523 | login_check_credentials(); |
| 524 | if( login_wants_https_redirect() ){ |
| 525 | const char *zQS = P("QUERY_STRING"); |
| 526 | if( P("redir")!=0 ){ |
| @@ -655,11 +656,11 @@ | |
| 656 | } |
| 657 | } |
| 658 | style_header("Login/Logout"); |
| 659 | style_adunit_config(ADUNIT_OFF); |
| 660 | @ %s(zErrMsg) |
| 661 | if( zGoto && !noAnon ){ |
| 662 | char *zAbbrev = fossil_strdup(zGoto); |
| 663 | int i; |
| 664 | for(i=0; zAbbrev[i] && zAbbrev[i]!='?'; i++){} |
| 665 | zAbbrev[i] = 0; |
| 666 | if( g.zLogin ){ |
| @@ -727,20 +728,20 @@ | |
| 728 | @ <td></td> |
| 729 | @ <td><input type="submit" name="in" value="Login"></td> |
| 730 | @ <td colspan="2">← Pressing this button grants\ |
| 731 | @ permission to store a cookie |
| 732 | @ </tr> |
| 733 | if( !noAnon && login_self_register_available(0) ){ |
| 734 | @ <tr> |
| 735 | @ <td></td> |
| 736 | @ <td><input type="submit" name="self" value="Create A New Account"> |
| 737 | @ <td colspan="2"> \ |
| 738 | @ ← Don't have a login? Click this button to create one. |
| 739 | @ </tr> |
| 740 | } |
| 741 | @ </table> |
| 742 | if( zAnonPw && !noAnon ){ |
| 743 | unsigned int uSeed = captcha_seed(); |
| 744 | const char *zDecoded = captcha_decode(uSeed); |
| 745 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 746 | char *zCaptcha = captcha_render(zDecoded); |
| 747 | |
| 748 |