X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fcreateidentitypage.cpp;fp=src%2Fhttp%2Fpages%2Fcreateidentitypage.cpp;h=2c55c02c8b34320ece8fb5a064d133187018b6e6;hb=f208e33c29132aacaec448e74341edea1b925a2a;hp=0000000000000000000000000000000000000000;hpb=d8ccfe2b3944adf07d35534459cdda19d15217c8;p=fms.git diff --git a/src/http/pages/createidentitypage.cpp b/src/http/pages/createidentitypage.cpp new file mode 100644 index 0000000..2c55c02 --- /dev/null +++ b/src/http/pages/createidentitypage.cpp @@ -0,0 +1,50 @@ +#include "../../../include/http/pages/createidentitypage.h" +#include "../../../include/stringfunctions.h" + +#ifdef XMEM + #include +#endif + +const std::string CreateIdentityPage::GeneratePage(const std::string &method, const std::map &queryvars) +{ + std::string content=""; + + if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="create") + { + SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tblLocalIdentity(Name,PublishTrustList) VALUES(?,'true');"); + std::string name=""; + + if(queryvars.find("name")!=queryvars.end()) + { + name=(*queryvars.find("name")).second; + } + + st.Bind(0,name); + st.Step(); + + content+="

Created Identity

"; + } + else + { + content+="

Create Identity

"; + content+="
"; + content+=""; + 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); +} + +const bool CreateIdentityPage::WillHandleURI(const std::string &uri) +{ + if(uri.find("createidentity.")!=std::string::npos) + { + return true; + } + else + { + return false; + } +}