X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fipagehandler.cpp;h=560c9123758a7a725c39ef06c9ed1f0e4a6aa09e;hb=f2545574af789b63fc655decfe31a3d9f1b30504;hp=fc778158b7d4aebd9f2530587a793c626dc3e889;hpb=f208e33c29132aacaec448e74341edea1b925a2a;p=fms.git diff --git a/src/http/ipagehandler.cpp b/src/http/ipagehandler.cpp index fc77815..560c912 100644 --- a/src/http/ipagehandler.cpp +++ b/src/http/ipagehandler.cpp @@ -1,6 +1,16 @@ #include "../../include/http/ipagehandler.h" -#include "../../include/http/httpdefs.h" #include "../../include/stringfunctions.h" +#include "../../include/http/multipartparser.h" +#include "../../include/db/sqlite3db.h" + +#include +#include +#include +#include +#include +#include + +#include #ifdef XMEM #include @@ -12,7 +22,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 +41,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=SQLite3DB::DB::Instance()->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+="