X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fhttpthread.cpp;h=4760f808f57d5aec3617465f1edfc6ea0461a11d;hb=63376b2a82c3f6cdf2df56b1f134bd7df0aaab3a;hp=5bb998846928a1915d2ad61cf92a33a282777818;hpb=df316253862dc50e8e5a790d9634ef90be37badb;p=fms.git diff --git a/src/http/httpthread.cpp b/src/http/httpthread.cpp index 5bb9988..4760f80 100644 --- a/src/http/httpthread.cpp +++ b/src/http/httpthread.cpp @@ -12,6 +12,9 @@ #include "../../include/http/pages/controlboardpage.h" #include "../../include/http/pages/peerdetailspage.h" #include "../../include/http/pages/peermaintenancepage.h" +#include "../../include/http/pages/execquerypage.h" +#include "../../include/http/pages/boardspage.h" +#include "../../include/http/pages/insertedfilespage.h" #include @@ -27,8 +30,11 @@ HTTPThread::HTTPThread() Option::Instance()->Get("HTTPListenPort",portstr); StringFunctions::Convert(portstr,port); + std::string aclstr; + Option::Instance()->Get("HTTPAccessControl",aclstr); + // set template - templatestr="Home
[CONTENT]"; + templatestr="Home

Could not find template.htm! Place in program directory and restart!


[CONTENT]"; FILE *infile=fopen("template.htm","r+b"); if(infile) { @@ -56,12 +62,16 @@ HTTPThread::HTTPThread() m_pagehandlers.push_back(new ControlBoardPage(templatestr)); m_pagehandlers.push_back(new PeerDetailsPage(templatestr)); m_pagehandlers.push_back(new PeerMaintenancePage(templatestr)); + m_pagehandlers.push_back(new ExecQueryPage(templatestr)); + m_pagehandlers.push_back(new BoardsPage(templatestr)); + m_pagehandlers.push_back(new InsertedFilesPage(templatestr)); // homepage must be last - catch all page handler m_pagehandlers.push_back(new HomePage(templatestr)); m_ctx=0; - m_ctx=shttpd_init(NULL,"listen_ports",portstr.c_str(),NULL); - shttpd_listen(m_ctx,port,false); + m_ctx=shttpd_init(); + shttpd_set_option(m_ctx,"ports",portstr.c_str()); + shttpd_set_option(m_ctx,"acl",aclstr.c_str()); shttpd_register_uri(m_ctx,"*",HTTPThread::PageCallback,this);