version 0.3.15
[fms.git] / src / http / pages / announceidentitypage.cpp
index 7858d88..f14b275 100644 (file)
@@ -43,6 +43,8 @@ const std::string AnnounceIdentityPage::GeneratePage(const std::string &method,
        std::string lastid="";\r
        std::string thisid="";\r
        std::string day="";\r
+       std::string name="";\r
+       std::string pubkey="";\r
        int requestindex=0;\r
        bool willshow=false;\r
 \r
@@ -87,11 +89,11 @@ const std::string AnnounceIdentityPage::GeneratePage(const std::string &method,
        content+="<tr><td colspan=\"4\"><center>Select Identity : ";\r
        content+=CreateLocalIdentityDropDown("localidentityid","");\r
        content+="</td></tr>";\r
-       content+="<tr><td colspan=\"4\"><center>Type the answers of a few puzzles.  The puzzles are case sensitive.  Getting announced will take some time.  DO NOT continuously solve captchas.  Solve 30 at most, wait a day, and if your identity has not been announced, repeat until it is.</td></tr>";\r
+       content+="<tr><td colspan=\"4\"><center>Type the answers of a few of the following puzzles.  You don't need to get them all correct, but remember that they are case sensitive.  Getting announced will take some time.  DO NOT continuously solve captchas.  Solve 30 at most, wait a day, and if your identity has not been announced, repeat until it is.</td></tr>";\r
        content+="<tr>";\r
 \r
        date-=Poco::Timespan(1,0,0,0,0);\r
-       SQLite3DB::Statement st=m_db->Prepare("SELECT UUID,Day,IdentityID,RequestIndex FROM tblIntroductionPuzzleRequests WHERE UUID NOT IN (SELECT UUID FROM tblIdentityIntroductionInserts) AND UUID NOT IN (SELECT UUID FROM tblIntroductionPuzzleInserts) AND Day>='"+Poco::DateTimeFormatter::format(date,"%Y-%m-%d")+"' AND Found='true' ORDER BY IdentityID, Day DESC, RequestIndex DESC;");\r
+       SQLite3DB::Statement st=m_db->Prepare("SELECT UUID,Day,tblIdentity.IdentityID,RequestIndex,tblIdentity.Name,tblIdentity.PublicKey FROM tblIntroductionPuzzleRequests INNER JOIN tblIdentity ON tblIntroductionPuzzleRequests.IdentityID=tblIdentity.IdentityID WHERE UUID NOT IN (SELECT UUID FROM tblIdentityIntroductionInserts) AND UUID NOT IN (SELECT UUID FROM tblIntroductionPuzzleInserts) AND Day>='"+Poco::DateTimeFormatter::format(date,"%Y-%m-%d")+"' AND Found='true' ORDER BY tblIdentity.IdentityID, Day DESC, RequestIndex DESC;");\r
        st.Step();\r
 \r
        if(st.RowReturned()==false)\r
@@ -105,6 +107,8 @@ const std::string AnnounceIdentityPage::GeneratePage(const std::string &method,
                st.ResultText(1,day);\r
                st.ResultText(2,thisid);\r
                st.ResultInt(3,requestindex);\r
+               st.ResultText(4,name);\r
+               st.ResultText(5,pubkey);\r
 \r
                // if we are already inserting a solution for an identity - we shouldn't show any puzzles that are older than the one we are inserting\r
                // get the last index # we are inserting this day from this identity\r
@@ -129,7 +133,7 @@ const std::string AnnounceIdentityPage::GeneratePage(const std::string &method,
                        {\r
                                content+="</tr>\r\n<tr>";\r
                        }\r
-                       content+="<td>";\r
+                       content+="<td title=\"From "+SanitizeOutput(CreateShortIdentityName(name,pubkey))+"\">";\r
                        content+="<img src=\"showcaptcha.htm?UUID="+uuid+"\"><br>";\r
                        content+="<input type=\"hidden\" name=\"uuid["+countstr+"]\" value=\""+uuid+"\">";\r
                        content+="<input type=\"hidden\" name=\"day["+countstr+"]\" value=\""+day+"\">";\r