version 0.2.17
[fms.git] / src / http / pages / peertrustpage.cpp
index dc689bf..ac6b053 100644 (file)
@@ -239,8 +239,9 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
        }\r
 \r
        content+="<h2>Peer Trust</h2>";\r
-       content+="Message Trust is how much you trust the identity to post good messages. Trust List Trust is how much weight you want the trust list of that identity to have when calculating the total. The local trust levels are set by you, and the peer trust levels are calculated by a weighted average using other identities' trust lists.  Trust is recalculated once an hour from received trust lists.  You must have at least 1 identity created and have received the SSK keypair for it from Freenet before setting trust.";\r
-       \r
+       content+="Message Trust is how much you trust the identity to post good messages. Trust List Trust is how much weight you want the trust list of that identity to have when calculating the total. The local trust levels are set by you, and the peer trust levels are calculated by a weighted average using other identities' trust lists.  Trust is recalculated once an hour from received trust lists.  You must have at least 1 identity created and have received the SSK keypair for it from Freenet before setting trust.<br>";\r
+       content+="* - This identity is not publishing a trust list<br>";\r
+\r
        // search drop down\r
        content+="<div style=\"text-align:center;margin-bottom:5px;\">";\r
        content+="<form name=\"frmsearch\" method=\"POST\" action=\"peertrust.htm?"+BuildQueryString(0,"","","",localidentityid)+"\">";\r
@@ -276,7 +277,6 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
        content+="<th><a href=\"peertrust.htm?"+BuildQueryString(startrow,namesearch,"MessageCount",ReverseSort("MessageCount",sortby,sortorder),localidentityid)+"\">Message Count</a></th>";\r
        content+="</tr>\r\n";\r
        \r
-//TODO - modify this query\r
        // get count of identities we are showing\r
        sql="SELECT COUNT(*) FROM tblIdentity LEFT JOIN (SELECT IdentityID FROM tblIdentityTrust WHERE LocalIdentityID=?) AS 'tblIdentityTrust' ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID ";\r
        sql+="WHERE tblIdentity.Hidden='false'";\r
@@ -296,7 +296,7 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
        st.ResultInt(0,identitycount);\r
        st.Finalize();\r
 \r
-       sql="SELECT tblIdentity.IdentityID,Name,tblIdentityTrust.LocalMessageTrust,PeerMessageTrust,tblIdentityTrust.LocalTrustListTrust,PeerTrustListTrust,PublicKey,tblIdentityTrust.MessageTrustComment,tblIdentityTrust.TrustListTrustComment,COUNT(MessageID) AS 'MessageCount' ";\r
+       sql="SELECT tblIdentity.IdentityID,Name,tblIdentityTrust.LocalMessageTrust,PeerMessageTrust,tblIdentityTrust.LocalTrustListTrust,PeerTrustListTrust,PublicKey,tblIdentityTrust.MessageTrustComment,tblIdentityTrust.TrustListTrustComment,COUNT(MessageID) AS 'MessageCount',tblIdentity.PublishTrustList ";\r
        sql+="FROM tblIdentity LEFT JOIN (SELECT LocalIdentityID,IdentityID,LocalMessageTrust,LocalTrustListTrust,MessageTrustComment,TrustListTrustComment FROM tblIdentityTrust WHERE LocalIdentityID=?) AS tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID LEFT JOIN tblMessage ON tblIdentity.IdentityID=tblMessage.IdentityID ";\r
        sql+="WHERE tblIdentity.Hidden='false'";\r
        if(namesearch!="")\r
@@ -339,6 +339,7 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
                std::string messagetrustcomment="";\r
                std::string trustlisttrustcomment="";\r
                std::string messagecountstr="";\r
+               std::string publishtrustlist="";\r
 \r
                StringFunctions::Convert(count,countstr);\r
 \r
@@ -352,6 +353,7 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
                st.ResultText(7,messagetrustcomment);\r
                st.ResultText(8,trustlisttrustcomment);\r
                st.ResultText(9,messagecountstr);\r
+               st.ResultText(10,publishtrustlist);\r
 \r
                content+="<tr>";\r
                content+="<td title=\""+publickey+"\">";\r
@@ -378,7 +380,12 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
                content+=peermessagetrust+"</td>";\r
                content+="<td "+GetClassString(localtrustlisttrust)+">";\r
                content+="<input type=\"hidden\" name=\"oldlocaltrustlisttrust["+countstr+"]\" value=\""+localtrustlisttrust+"\">";\r
-               content+="<input type=\"text\" name=\"localtrustlisttrust["+countstr+"]\" value=\""+localtrustlisttrust+"\" size=\"2\" maxlength=\"3\" class=\"small90\"></td>";\r
+               content+="<input type=\"text\" name=\"localtrustlisttrust["+countstr+"]\" value=\""+localtrustlisttrust+"\" size=\"2\" maxlength=\"3\" class=\"small90\">";\r
+               if(publishtrustlist=="false")\r
+               {\r
+                       content+="*";\r
+               }\r
+               content+="</td>";\r
                content+="<td "+GetClassString(localtrustlisttrust)+">";\r
                content+="<input type=\"hidden\" name=\"oldtrustlisttrustcomment["+countstr+"]\" value=\""+SanitizeOutput(trustlisttrustcomment)+"\">";\r
                content+="<input type=\"text\" name=\"trustlisttrustcomment["+countstr+"]\" value=\""+SanitizeOutput(trustlisttrustcomment)+"\" maxlength=\"50\" class=\"small90\">";\r