version 0.3.0
[fms.git] / src / http / pages / createidentitypage.cpp
index 8d67e07..165b22d 100644 (file)
@@ -1,6 +1,8 @@
 #include "../../../include/http/pages/createidentitypage.h"\r
 #include "../../../include/stringfunctions.h"\r
-#include "../../../include/datetime.h"\r
+\r
+#include <Poco/DateTime.h>\r
+#include <Poco/DateTimeFormatter.h>\r
 \r
 #ifdef XMEM\r
        #include <xmem.h>\r
@@ -12,10 +14,9 @@ const std::string CreateIdentityPage::GeneratePage(const std::string &method, co
 \r
        if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="create")\r
        {\r
-               SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tblLocalIdentity(Name,PublishTrustList,DateCreated) VALUES(?,'true',?);");\r
+               SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tblLocalIdentity(Name,PublishTrustList,DateCreated) VALUES(?,'false',?);");\r
                std::string name="";\r
-               DateTime date;\r
-               date.SetToGMTime();\r
+               Poco::DateTime date;\r
 \r
                if(queryvars.find("name")!=queryvars.end())\r
                {\r
@@ -23,7 +24,7 @@ const std::string CreateIdentityPage::GeneratePage(const std::string &method, co
                }\r
 \r
                st.Bind(0,name);\r
-               st.Bind(1,date.Format("%Y-%m-%d %H:%M:%S"));\r
+               st.Bind(1,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S"));\r
                st.Step();\r
 \r
                content+="<h2>Created Identity</h2>";\r
@@ -38,7 +39,7 @@ const std::string CreateIdentityPage::GeneratePage(const std::string &method, co
                content+="</form>";\r
        }\r
 \r
-       return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content);\r
+       return StringFunctions::Replace(m_template,"[CONTENT]",content);\r
 }\r
 \r
 const bool CreateIdentityPage::WillHandleURI(const std::string &uri)\r