version 0.2.15
authorSomeDude <SomeDude@NuBL7aaJ6Cn4fB7GXFb9Zfi8w1FhPyW3oKgU9TweZMw>
Sat, 10 May 2008 16:35:00 +0000 (18:35 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sat, 10 May 2008 16:35:00 +0000 (18:35 +0200)
23 files changed:
include/freenet/boardlistinserter.h
include/freenet/boardlistrequester.h
include/freenet/fileinserter.h
include/freenet/iindexinserter.h
include/freenet/messageinserter.h
include/freenet/messagelistinserter.h
include/freenet/messagelistrequester.h
include/freenet/messagerequester.h
include/freenet/siteinserter.h
include/global.h
src/charsetconverter.cpp
src/freenet/boardlistinserter.cpp
src/freenet/boardlistrequester.cpp
src/freenet/captcha/simplecaptcha.cpp
src/freenet/fileinserter.cpp
src/freenet/messageinserter.cpp
src/freenet/messagelistinserter.cpp
src/freenet/messagelistrequester.cpp
src/freenet/messagerequester.cpp
src/freenet/siteinserter.cpp
src/global.cpp
src/http/pages/localidentitiespage.cpp
src/http/pages/peerdetailspage.cpp

index 54b5e80..d041cdb 100644 (file)
@@ -13,7 +13,7 @@ private:
        void Initialize();\r
        const bool HandlePutSuccessful(FCPMessage &message);\r
        const bool HandlePutFailed(FCPMessage &message);\r
-       void StartInsert(const long &localidentityid);\r
+       const bool StartInsert(const long &localidentityid);\r
        void CheckForNeededInsert();\r
 };\r
 \r
index a917e0a..b2cacb2 100644 (file)
@@ -19,6 +19,7 @@ private:
        std::string GetIdentityName(const long identityid);\r
 \r
        bool m_savemessagesfromnewboards;\r
+       bool m_localtrustoverrides;\r
 \r
 };\r
 \r
index efc105a..c02b0ea 100644 (file)
@@ -13,7 +13,7 @@ private:
        void Initialize();\r
        const bool HandlePutSuccessful(FCPMessage &message);\r
        const bool HandlePutFailed(FCPMessage &message);\r
-       void StartInsert(const long &fileinsertid);\r
+       const bool StartInsert(const long &fileinsertid);\r
        void CheckForNeededInsert();\r
 \r
 };\r
index 035c5f3..0539b29 100644 (file)
@@ -36,7 +36,7 @@ protected:
        virtual void Initialize()=0;            // initialize m_fcpuniquename\r
        virtual const bool HandlePutSuccessful(FCPMessage &message)=0;\r
        virtual const bool HandlePutFailed(FCPMessage &message)=0;\r
-       virtual void StartInsert(const IDTYPE &id)=0;\r
+       virtual const bool StartInsert(const IDTYPE &id)=0;\r
        virtual void CheckForNeededInsert()=0;\r
        virtual void RemoveFromInsertList(const IDTYPE id);\r
 \r
index b762157..a73813e 100644 (file)
@@ -14,7 +14,7 @@ private:
        void Initialize();\r
        const bool HandlePutSuccessful(FCPMessage &message);\r
        const bool HandlePutFailed(FCPMessage &message);\r
-       void StartInsert(const std::string &messageuuid);\r
+       const bool StartInsert(const std::string &messageuuid);\r
        void CheckForNeededInsert();\r
 \r
 };\r
index a0564d3..8658960 100644 (file)
@@ -13,10 +13,11 @@ private:
        void Initialize();\r
        const bool HandlePutSuccessful(FCPMessage &message);\r
        const bool HandlePutFailed(FCPMessage &message);\r
-       void StartInsert(const long &localidentityid);\r
+       const bool StartInsert(const long &localidentityid);\r
        void CheckForNeededInsert();\r
 \r
        long m_daysbackward;\r
+       std::map<long,std::string> m_lastinsertedxml;   // last xml document inserted for each local identity\r
 \r
 };\r
 \r
index 56895e2..e8463ff 100644 (file)
@@ -16,6 +16,8 @@ private:
        const bool HandleAllData(FCPMessage &message);\r
        const bool HandleGetFailed(FCPMessage &message);\r
 \r
+       bool m_localtrustoverrides;\r
+\r
 };\r
 \r
 #endif // _messagelistrequester_\r
index 31eb580..17b577f 100644 (file)
@@ -24,6 +24,7 @@ private:
        long m_maxpeermessages;\r
        long m_maxboardspermessage;\r
        bool m_savemessagesfromnewboards;\r
+       bool m_localtrustoverrides;\r
        \r
 };\r
 \r
index fe501f3..a24f3a5 100644 (file)
@@ -13,7 +13,7 @@ private:
        void Initialize();\r
        const bool HandlePutSuccessful(FCPMessage &message);\r
        const bool HandlePutFailed(FCPMessage &message);\r
-       void StartInsert(const long &localidentityid);\r
+       const bool StartInsert(const long &localidentityid);\r
        void CheckForNeededInsert();\r
        const std::string SanitizeOutput(const std::string &input);\r
        void GeneratePages(const long localidentityid, std::string &uskkey, std::map<std::string,std::string> &pages);\r
index 7dcc373..69952d1 100644 (file)
@@ -5,7 +5,7 @@
 #include <vector>\r
 #include "pthreadwrapper/thread.h"\r
 \r
-#define FMS_VERSION    "0.2.14"\r
+#define FMS_VERSION    "0.2.15"\r
 \r
 // opens database and creates tables and initial inserts if necessary\r
 void SetupDB();\r
index 97ba594..4685add 100644 (file)
@@ -39,6 +39,7 @@ const bool CharsetConverter::SetConversion(const std::string &fromcharset, const
        {\r
                m_fromcharset="";\r
                m_tocharset="";\r
+               return false;\r
        }\r
 }\r
 \r
index 92ed0b7..6099ff6 100644 (file)
@@ -103,7 +103,7 @@ void BoardListInserter::Initialize()
        m_fcpuniquename="BoardListInserter";\r
 }\r
 \r
-void BoardListInserter::StartInsert(const long &localidentityid)\r
+const bool BoardListInserter::StartInsert(const long &localidentityid)\r
 {\r
        DateTime daysback;\r
        DateTime now;\r
@@ -178,4 +178,6 @@ void BoardListInserter::StartInsert(const long &localidentityid)
 \r
        m_inserting.push_back(localidentityid);\r
 \r
+       return true;\r
+\r
 }\r
index 9fbc6b2..69c2e35 100644 (file)
@@ -219,6 +219,16 @@ void BoardListRequester::Initialize()
                m_savemessagesfromnewboards=false;\r
        }\r
 \r
+       Option::Instance()->Get("LocalTrustOverridesPeerTrust",tempval);\r
+       if(tempval=="true")\r
+       {\r
+               m_localtrustoverrides=true;\r
+       }\r
+       else\r
+       {\r
+               m_localtrustoverrides=false;\r
+       }\r
+\r
 }\r
 \r
 void BoardListRequester::PopulateIDList()\r
@@ -227,7 +237,16 @@ void BoardListRequester::PopulateIDList()
        DateTime today;\r
        today.SetToGMTime();\r
 \r
-       SQLite3DB::Statement st=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+today.Format("%Y-%m-%d")+"' AND (LocalMessageTrust IS NULL OR LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust')) AND (PeerMessageTrust IS NULL OR PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')) AND PublishBoardList='true' ORDER BY LocalMessageTrust+LocalTrustListTrust DESC, LastSeen;");\r
+       SQLite3DB::Statement st;\r
+\r
+       if(m_localtrustoverrides==false)\r
+       {\r
+               st=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+today.Format("%Y-%m-%d")+"' AND (LocalMessageTrust IS NULL OR LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust')) AND (PeerMessageTrust IS NULL OR PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')) AND PublishBoardList='true' ORDER BY LocalMessageTrust+LocalTrustListTrust DESC, LastSeen;");\r
+       }\r
+       else\r
+       {\r
+               st=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+today.Format("%Y-%m-%d")+"' AND (LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust') OR (LocalMessageTrust IS NULL AND (PeerMessageTrust IS NULL OR PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')))) AND PublishBoardList='true' ORDER BY LocalMessageTrust+LocalTrustListTrust DESC, LastSeen;");\r
+       }\r
        st.Step();\r
 \r
        m_ids.clear();\r
index 7539f80..3753a12 100644 (file)
@@ -53,16 +53,17 @@ void SimpleCaptcha::Generate()
                double endangle=(double)(rand()%360)*(3.14159/180);\r
                pixel.Red=100+(rand()%150);\r
                pixel.Green=100+(rand()%150);\r
+               pixel.Blue=100+(rand()%150);\r
                DrawArc(bmp,x1,y1,radius,startangle,endangle,pixel);\r
        }\r
 \r
        for(int i=0; i<5; i++)\r
        {\r
                // keep the colors dark\r
-               lettercols[i].Red=(rand()%200);\r
-               lettercols[i].Green=(rand()%200);\r
-               lettercols[i].Blue=(rand()%200);\r
-               // draw a line with the letter col\r
+               lettercols[i].Red=(rand()%150);\r
+               lettercols[i].Green=(rand()%150);\r
+               lettercols[i].Blue=(rand()%150);\r
+               // draw a line with the letter color\r
                DrawAALine(bmp,rand()%bmpwidth,rand()%bmpheight,rand()%bmpwidth,rand()%bmpheight,lettercols[i]);\r
        }\r
 \r
index 4a82bda..42d2777 100644 (file)
@@ -69,7 +69,7 @@ void FileInserter::Initialize()
        m_fcpuniquename="FileInserter";\r
 }\r
 \r
-void FileInserter::StartInsert(const long &fileinsertid)\r
+const bool FileInserter::StartInsert(const long &fileinsertid)\r
 {\r
        FCPMessage message;\r
        std::string fileinsertidstr="";\r
@@ -109,4 +109,6 @@ void FileInserter::StartInsert(const long &fileinsertid)
        m_fcp->SendRaw(&data[0],data.size());\r
 \r
        m_inserting.push_back(fileinsertid);\r
+\r
+       return true;\r
 }\r
index b4e1ce4..3dc1203 100644 (file)
@@ -125,7 +125,7 @@ void MessageInserter::Initialize()
        m_fcpuniquename="MessageInserter";\r
 }\r
 \r
-void MessageInserter::StartInsert(const std::string &messageuuid)\r
+const bool MessageInserter::StartInsert(const std::string &messageuuid)\r
 {\r
        MessageXML xmlfile;\r
        DateTime now;\r
@@ -207,6 +207,12 @@ void MessageInserter::StartInsert(const std::string &messageuuid)
                m_inserting.push_back(messageuuid);\r
 \r
                m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"MessageInserter::StartInsert started message insert "+message["URI"]);\r
+       \r
+               return true;\r
+       }\r
+       else\r
+       {\r
+               return false;\r
        }\r
 \r
 }\r
index 6fda244..e0d8957 100644 (file)
@@ -24,6 +24,7 @@ void MessageListInserter::CheckForNeededInsert()
                std::string sql;\r
                DateTime now;\r
                DateTime previous;\r
+               bool startedinsert=false;\r
 \r
                now.SetToGMTime();\r
                previous.SetToGMTime();\r
@@ -41,11 +42,12 @@ void MessageListInserter::CheckForNeededInsert()
                st.Bind(1,(now-(1.0/48.0)).Format("%Y-%m-%d %H:%M:%S"));\r
                st.Step();\r
 \r
-               if(st.RowReturned())\r
+               while(st.RowReturned() && startedinsert==false)\r
                {\r
                        int localidentityid;\r
                        st.ResultInt(0,localidentityid);\r
-                       StartInsert(localidentityid);\r
+                       startedinsert=StartInsert(localidentityid);\r
+                       st.Step();\r
                }\r
        }\r
 \r
@@ -121,7 +123,7 @@ void MessageListInserter::Initialize()
        StringFunctions::Convert(tempval,m_daysbackward);\r
 }\r
 \r
-void MessageListInserter::StartInsert(const long &localidentityid)\r
+const bool MessageListInserter::StartInsert(const long &localidentityid)\r
 {\r
        FCPMessage message;\r
        DateTime date;\r
@@ -214,16 +216,28 @@ void MessageListInserter::StartInsert(const long &localidentityid)
 \r
        // actually insert message\r
        xmlstr=mlxml.GetXML();\r
-       StringFunctions::Convert(xmlstr.size(),xmlsizestr);\r
 \r
-       message.SetName("ClientPut");\r
-       message["URI"]=privatekey+m_messagebase+"|"+now.Format("%Y-%m-%d")+"|MessageList|"+indexstr+".xml";\r
-       message["Identifier"]=m_fcpuniquename+"|"+localidentityidstr+"|"+indexstr+"|"+message["URI"];\r
-       message["UploadFrom"]="direct";\r
-       message["DataLength"]=xmlsizestr;\r
-       m_fcp->SendMessage(message);\r
-       m_fcp->SendRaw(xmlstr.c_str(),xmlstr.size());\r
+       // only insert if the last message this identity inserted is different than this message\r
+       if(m_lastinsertedxml[localidentityid]!=xmlstr)\r
+       {\r
+               StringFunctions::Convert(xmlstr.size(),xmlsizestr);\r
+\r
+               message.SetName("ClientPut");\r
+               message["URI"]=privatekey+m_messagebase+"|"+now.Format("%Y-%m-%d")+"|MessageList|"+indexstr+".xml";\r
+               message["Identifier"]=m_fcpuniquename+"|"+localidentityidstr+"|"+indexstr+"|"+message["URI"];\r
+               message["UploadFrom"]="direct";\r
+               message["DataLength"]=xmlsizestr;\r
+               m_fcp->SendMessage(message);\r
+               m_fcp->SendRaw(xmlstr.c_str(),xmlstr.size());\r
+\r
+               m_inserting.push_back(localidentityid);\r
 \r
-       m_inserting.push_back(localidentityid);\r
+               m_lastinsertedxml[localidentityid]=xmlstr;\r
+               return true;\r
+       }\r
+       else\r
+       {\r
+               return false;\r
+       }\r
 \r
 }\r
index bbf8650..ba2d4ff 100644 (file)
@@ -167,6 +167,17 @@ void MessageListRequester::Initialize()
        {\r
                m_log->WriteLog(LogFile::LOGLEVEL_WARNING,"Option MaxMessageListRequests is currently set at "+tempval+".  This value might be incorrectly configured.");\r
        }\r
+\r
+       Option::Instance()->Get("LocalTrustOverridesPeerTrust",tempval);\r
+       if(tempval=="true")\r
+       {\r
+               m_localtrustoverrides=true;\r
+       }\r
+       else\r
+       {\r
+               m_localtrustoverrides=false;\r
+       }\r
+\r
 }\r
 \r
 void MessageListRequester::PopulateIDList()\r
@@ -176,8 +187,17 @@ void MessageListRequester::PopulateIDList()
 \r
        date.SetToGMTime();\r
 \r
+       SQLite3DB::Statement st;\r
+\r
        // select identities we want to query (we've seen them today) - sort by their trust level (descending) with secondary sort on how long ago we saw them (ascending)\r
-       SQLite3DB::Statement st=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+date.Format("%Y-%m-%d")+"' AND (LocalMessageTrust IS NULL OR LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust')) AND (PeerMessageTrust IS NULL OR PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')) ORDER BY LocalMessageTrust+LocalTrustListTrust DESC, LastSeen;");\r
+       if(m_localtrustoverrides==false)\r
+       {\r
+               st=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+date.Format("%Y-%m-%d")+"' AND (LocalMessageTrust IS NULL OR LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust')) AND (PeerMessageTrust IS NULL OR PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')) ORDER BY LocalMessageTrust+LocalTrustListTrust DESC, LastSeen;");\r
+       }\r
+       else\r
+       {\r
+               st=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+date.Format("%Y-%m-%d")+"' AND (LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust') OR (LocalMessageTrust IS NULL AND (PeerMessageTrust IS NULL OR PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')))) ORDER BY LocalMessageTrust+LocalTrustListTrust DESC, LastSeen;");\r
+       }\r
        st.Step();\r
 \r
        m_ids.clear();\r
index 836d402..70a5dba 100644 (file)
@@ -367,6 +367,7 @@ void MessageRequester::Initialize()
        {\r
                m_log->WriteLog(LogFile::LOGLEVEL_WARNING,"Option MaxBoardsPerMessage is currently set at "+tempval+".  This value might be incorrectly configured.");\r
        }\r
+\r
        Option::Instance()->Get("SaveMessagesFromNewBoards",tempval);\r
        if(tempval=="true")\r
        {\r
@@ -376,6 +377,17 @@ void MessageRequester::Initialize()
        {\r
                m_savemessagesfromnewboards=false;\r
        }\r
+\r
+       Option::Instance()->Get("LocalTrustOverridesPeerTrust",tempval);\r
+       if(tempval=="true")\r
+       {\r
+               m_localtrustoverrides=true;\r
+       }\r
+       else\r
+       {\r
+               m_localtrustoverrides=false;\r
+       }\r
+\r
 }\r
 \r
 void MessageRequester::PopulateIDList()\r
@@ -392,9 +404,16 @@ void MessageRequester::PopulateIDList()
 \r
        sql="SELECT tblIdentity.IdentityID,Day,RequestIndex ";\r
        sql+="FROM tblMessageRequests INNER JOIN tblIdentity ON tblMessageRequests.IdentityID=tblIdentity.IdentityID ";\r
-       sql+="WHERE (tblIdentity.LocalMessageTrust IS NULL OR tblIdentity.LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust')) ";\r
-       sql+="AND FromMessageList='true' AND Found='false' AND Day>='"+date.Format("%Y-%m-%d")+"' ";\r
-       sql+="AND (tblIdentity.PeerMessageTrust IS NULL OR tblIdentity.PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')) ";\r
+       sql+="WHERE FromMessageList='true' AND Found='false' AND Day>='"+date.Format("%Y-%m-%d")+"' ";\r
+       if(m_localtrustoverrides==false)\r
+       {\r
+               sql+="AND (tblIdentity.LocalMessageTrust IS NULL OR tblIdentity.LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust')) ";\r
+               sql+="AND (tblIdentity.PeerMessageTrust IS NULL OR tblIdentity.PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')) ";\r
+       }\r
+       else\r
+       {\r
+               sql+="AND (tblIdentity.LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust') OR (tblIdentity.LocalMessageTrust IS NULL AND (tblIdentity.PeerMessageTrust IS NULL OR tblIdentity.PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')))) ";\r
+       }\r
        sql+="AND tblIdentity.Name <> '' ";\r
        sql+=";";\r
 \r
index df4831c..c717d0d 100644 (file)
@@ -84,6 +84,9 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l
                content+="</div>";\r
                content+="<div class=\"postbody\">";\r
                content+=SanitizeOutput(post);\r
+               //post=SanitizeOutput(post);\r
+               //StringFunctions::Replace(post,"\r\n","<br>");\r
+               //content+=post;\r
                content+="</div>";\r
                content+="</div>";\r
 \r
@@ -414,7 +417,7 @@ const std::string SiteInserter::SanitizeOutput(const std::string &input)
        return output;\r
 }\r
 \r
-void SiteInserter::StartInsert(const long &localidentityid)\r
+const bool SiteInserter::StartInsert(const long &localidentityid)\r
 {\r
        FCPMessage message;\r
        std::string localidentityidstr="";\r
@@ -458,4 +461,6 @@ void SiteInserter::StartInsert(const long &localidentityid)
 \r
        m_inserting.push_back(localidentityid);\r
 \r
+       return true;\r
+\r
 }\r
index ec296c1..b81ed6f 100644 (file)
@@ -286,7 +286,7 @@ void SetupDB()
                                );");\r
 \r
        db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded,AddedMethod) VALUES('fms','Freenet Message System','2007-12-01 12:00:00','Initial Board');");\r
-       db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded,AddedMethod) VALUES('freenet','Discussion about Freenet','2007-12-01 12:00:00','Initialt Board');");\r
+       db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded,AddedMethod) VALUES('freenet','Discussion about Freenet','2007-12-01 12:00:00','Initial Board');");\r
        db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded,AddedMethod) VALUES('public','Public discussion','2007-12-01 12:00:00','Initial Board');");\r
        db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded,AddedMethod) VALUES('test','Test board','2007-12-01 12:00:00','Initial Board');");\r
 \r
@@ -817,6 +817,12 @@ void SetupDefaultOptions()
        st.Step();\r
        st.Reset();\r
 \r
+       st.Bind(0,"LocalTrustOverridesPeerTrust");\r
+       st.Bind(1,"false");\r
+       st.Bind(2,"Set to true if you want your local trust levels to override the peer levels when determining which identities you will poll.");\r
+       st.Step();\r
+       st.Reset();\r
+\r
        st.Bind(0,"MessageDownloadMaxDaysBackward");\r
        st.Bind(1,"5");\r
        st.Bind(2,"The maximum number of days backward that messages will be downloaded from each identity");\r
index 3fd3c48..c06ee5b 100644 (file)
@@ -247,6 +247,7 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c
                content+="<td><input type=\"submit\" value=\"Update\"></form></td>";\r
                content+="<td><form name=\"frmdel\""+countstr+"\" method=\"POST\"><input type=\"hidden\" name=\"formaction\" value=\"delete\"><input type=\"hidden\" name=\"chkidentityid["+countstr+"]\" value=\""+id+"\"><input type=\"submit\" value=\"Delete\"></form></td>";\r
                content+="</tr>";\r
+               content+="<tr><td></td><td colspan=\"7\" class=\"smaller\">"+publickey+"</td></tr>";\r
                st.Step();\r
                count++;\r
        }\r
index afb1c42..ea38925 100644 (file)
@@ -23,9 +23,12 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const
        std::string fcphost="";\r
        std::string hidden="";\r
        int freesiteedition=-1;\r
+       std::string publishtrustlist="";\r
+       std::string messagebase="";\r
 \r
        std::string fproxyport="8888";\r
        Option::Instance()->Get("FProxyPort",fproxyport);\r
+       Option::Instance()->Get("MessageBase",messagebase);\r
 \r
        if(queryvars.find("identityid")!=queryvars.end() && (*queryvars.find("identityid")).second!="")\r
        {\r
@@ -56,7 +59,7 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const
 \r
        Option::Instance()->Get("FCPHost",fcphost);\r
 \r
-       SQLite3DB::Statement st=m_db->Prepare("SELECT Name,PublicKey,DateAdded,LastSeen,AddedMethod,Hidden,FreesiteEdition FROM tblIdentity WHERE IdentityID=?;");\r
+       SQLite3DB::Statement st=m_db->Prepare("SELECT Name,PublicKey,DateAdded,LastSeen,AddedMethod,Hidden,FreesiteEdition,PublishTrustList FROM tblIdentity WHERE IdentityID=?;");\r
        st.Bind(0,identityid);\r
        st.Step();\r
 \r
@@ -73,13 +76,12 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const
                {\r
                        st.ResultInt(6,freesiteedition);\r
                }\r
+               st.ResultText(7,publishtrustlist);\r
 \r
                usk=publickey;\r
                if(freesiteedition>=0 && usk.find("SSK@")==0)\r
                {\r
-                       std::string messagebase="";\r
                        std::string editionstr="";\r
-                       Option::Instance()->Get("MessageBase",messagebase);\r
                        usk.erase(0,3);\r
                        StringFunctions::Convert(freesiteedition,editionstr);\r
                        usk="USK"+usk+messagebase+"/"+editionstr+"/";\r
@@ -95,6 +97,15 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const
                {\r
                        content+="<tr><td>Freesite</td><td class=\"smaller\"><a href=\"http://"+fcphost+":"+fproxyport+"/"+SanitizeOutput(usk)+"\">"+SanitizeOutput(usk)+"</a></td></tr>";\r
                }\r
+               if(publishtrustlist=="true")\r
+               {\r
+                       std::string lastseendate=lastseen;\r
+                       if(lastseendate.size()>=10)\r
+                       {\r
+                               lastseendate=lastseendate.substr(0,10);\r
+                       }\r
+                       content+="<tr><td>Trust List XML</td><td class=\"smaller\"><a href=\"http://"+fcphost+":"+fproxyport+"/"+SanitizeOutput(publickey)+messagebase+"|"+lastseendate+"|TrustList|0.xml\">Trust List</a></td></tr>";\r
+               }\r
                content+="<tr><td>Date Added</td><td>"+dateadded+"</td></tr>";\r
                content+="<tr><td>Last Seen</td><td>"+lastseen+"</td></tr>";\r
                content+="<tr><td>Added Method</td><td class=\"smaller\">"+SanitizeOutput(addedmethod)+"</td></tr>";\r