X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fipagehandler.cpp;h=1ec7947dbba72488785cdd4085377b8082dd56a1;hb=59a5414ec47a2932a7802fcd1d98c4d80166564f;hp=fc778158b7d4aebd9f2530587a793c626dc3e889;hpb=f208e33c29132aacaec448e74341edea1b925a2a;p=fms.git diff --git a/src/http/ipagehandler.cpp b/src/http/ipagehandler.cpp index fc77815..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,117 +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+="