X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fpeerdetailspage.cpp;h=6d05231d75d5921ea846c51b97f1675e36355dd0;hp=fc522b09628248f96f0a8982d84d78196da64206;hb=107bd97018964d48425306026d06afd038e84db0;hpb=5c0453c8697cfaa843dd7f799e5404733ee56e13 diff --git a/src/http/pages/peerdetailspage.cpp b/src/http/pages/peerdetailspage.cpp index fc522b0..6d05231 100644 --- a/src/http/pages/peerdetailspage.cpp +++ b/src/http/pages/peerdetailspage.cpp @@ -21,6 +21,7 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const std::string addedmethod=""; std::string usk=""; std::string fcphost=""; + std::string hidden=""; if(queryvars.find("identityid")!=queryvars.end() && (*queryvars.find("identityid")).second!="") { @@ -35,9 +36,23 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const del.Step(); } + if(identityid!=0 && queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="hide") + { + SQLite3DB::Statement del=m_db->Prepare("UPDATE tblIdentity SET Hidden='true' WHERE IdentityID=?;"); + del.Bind(0,identityid); + del.Step(); + } + + if(identityid!=0 && queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="show") + { + SQLite3DB::Statement del=m_db->Prepare("UPDATE tblIdentity SET Hidden='false' WHERE IdentityID=?;"); + del.Bind(0,identityid); + del.Step(); + } + Option::Instance()->Get("FCPHost",fcphost); - SQLite3DB::Statement st=m_db->Prepare("SELECT Name,PublicKey,DateAdded,LastSeen,AddedMethod FROM tblIdentity WHERE IdentityID=?;"); + SQLite3DB::Statement st=m_db->Prepare("SELECT Name,PublicKey,DateAdded,LastSeen,AddedMethod,Hidden FROM tblIdentity WHERE IdentityID=?;"); st.Bind(0,identityid); st.Step(); @@ -49,12 +64,13 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const st.ResultText(2,dateadded); st.ResultText(3,lastseen); st.ResultText(4,addedmethod); + st.ResultText(5,hidden); usk=publickey; if(usk.find("SSK@")==0) { usk.erase(0,3); - usk="USK"+usk+"/fms/0/"; + usk="USK"+usk+"fms/0/"; } content+="Name"+SanitizeOutput(name)+""; @@ -63,6 +79,22 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const content+="Date Added"+dateadded+""; content+="Last Seen"+lastseen+""; content+="Added Method"+SanitizeOutput(addedmethod)+""; + content+="Hidden in Main Peer Trust Page"; + content+=""+hidden; + content+=" 
"; + content+=""; + if(hidden=="false") + { + content+=""; + content+=""; + } + else + { + content+=""; + content+=""; + } + content+="
"; + content+=""; } // get message count posted by this identity @@ -132,6 +164,7 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const st.Bind(0,identityid); st.Step(); + content+="
"; content+=""; content+="Trust of this identity from other identities"; content+="";