X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fcreateidentitypage.cpp;h=8a65914212e1d5537f825dd5aec10afca3b629d4;hb=cd75427de26fc2ebc9baad558b1c0a081faa3b43;hp=2c55c02c8b34320ece8fb5a064d133187018b6e6;hpb=f208e33c29132aacaec448e74341edea1b925a2a;p=fms.git diff --git a/src/http/pages/createidentitypage.cpp b/src/http/pages/createidentitypage.cpp index 2c55c02..8a65914 100644 --- a/src/http/pages/createidentitypage.cpp +++ b/src/http/pages/createidentitypage.cpp @@ -1,6 +1,9 @@ #include "../../../include/http/pages/createidentitypage.h" #include "../../../include/stringfunctions.h" +#include +#include + #ifdef XMEM #include #endif @@ -11,8 +14,9 @@ const std::string CreateIdentityPage::GeneratePage(const std::string &method, co if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="create") { - SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tblLocalIdentity(Name,PublishTrustList) VALUES(?,'true');"); + SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tblLocalIdentity(Name,PublishTrustList,DateCreated) VALUES(?,'false',?);"); std::string name=""; + Poco::DateTime date; if(queryvars.find("name")!=queryvars.end()) { @@ -20,8 +24,12 @@ const std::string CreateIdentityPage::GeneratePage(const std::string &method, co } st.Bind(0,name); + st.Bind(1,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S")); st.Step(); + // insert all identities not in trust list already + m_db->Execute("INSERT INTO tblIdentityTrust(LocalIdentityID,IdentityID) SELECT LocalIdentityID,IdentityID FROM tblLocalIdentity,tblIdentity WHERE LocalIdentityID || '_' || IdentityID NOT IN (SELECT LocalIdentityID || '_' || IdentityID FROM tblIdentityTrust);"); + content+="

Created Identity

"; } else @@ -29,12 +37,12 @@ const std::string CreateIdentityPage::GeneratePage(const std::string &method, co content+="

Create Identity

"; content+="
"; content+=""; - content+="Name : "; + content+="Name : "; content+=" "; content+="
"; } - return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content); + return StringFunctions::Replace(m_template,"[CONTENT]",content); } const bool CreateIdentityPage::WillHandleURI(const std::string &uri)