X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fipagehandler.cpp;h=1ec7947dbba72488785cdd4085377b8082dd56a1;hb=59a5414ec47a2932a7802fcd1d98c4d80166564f;hp=c4ebbb9c2aceb469754fcc0b745d82e7d3af81b8;hpb=b9c3763a932cebaa015a27fe111017f6f34dfbaa;p=fms.git diff --git a/src/http/ipagehandler.cpp b/src/http/ipagehandler.cpp index c4ebbb9..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,127 +40,104 @@ 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 + { + uuid=uuidgen.createRandom(); + } + catch(...) { - methodstr=method; } - if(uri && WillHandleURI(std::string(uri))) + 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=""; + + rval+="