X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fipagehandler.cpp;h=1ec7947dbba72488785cdd4085377b8082dd56a1;hb=HEAD;hp=d90a927529fc564a8cdb02279e1d4ab1becbcc1a;hpb=37a8d59548287dcad78ef00e7b18058721eb9935;p=fms.git diff --git a/src/http/ipagehandler.cpp b/src/http/ipagehandler.cpp index d90a927..1ec7947 100644 --- a/src/http/ipagehandler.cpp +++ b/src/http/ipagehandler.cpp @@ -1,6 +1,15 @@ #include "../../include/http/ipagehandler.h" -#include "../../include/http/httpdefs.h" #include "../../include/stringfunctions.h" +#include "../../include/http/multipartparser.h" + +#include +#include +#include +#include +#include +#include + +#include #ifdef XMEM #include @@ -12,7 +21,7 @@ void IPageHandler::CreateArgArray(const std::map &vars, { if((*i).first.find(basename)==0 && (*i).first.find("[")!=std::string::npos && (*i).first.find("]")!=std::string::npos) { - int index; + int index=0; std::string indexstr; std::string::size_type startpos; std::string::size_type endpos; @@ -31,121 +40,177 @@ void IPageHandler::CreateArgArray(const std::map &vars, } } -const bool IPageHandler::Handle(shttpd_arg *arg) +const std::string IPageHandler::CreateFormPassword() { - const char *uri=shttpd_get_env(arg,"REQUEST_URI"); - const char *method=shttpd_get_env(arg,"REQUEST_METHOD"); - std::string methodstr=""; - if(method) + Poco::DateTime date; + Poco::UUIDGenerator uuidgen; + Poco::UUID uuid; + try { - methodstr=method; + uuid=uuidgen.createRandom(); } + catch(...) + { + } + + SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tmpFormPassword(Date,Password) VALUES(?,?);"); + st.Bind(0,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S")); + st.Bind(1,uuid.toString()); + st.Step(); + + return ""; + +} + +const std::string IPageHandler::CreateTrueFalseDropDown(const std::string &name, const std::string &selected) +{ + std::string rval=""; - if(uri && WillHandleURI(std::string(uri))) + rval+="