X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fhttpthread.cpp;h=22fc9302b848a8f3dd0a6b35567eda24761a4694;hb=1dee4e3cd008a27789bbce05b0eb47b0eb5d121a;hp=a1f51c734351f58b91c241ca87410ab4a10e679e;hpb=f60495a029c54358f82956482fe203fe2b7b5b23;p=fms.git diff --git a/src/http/httpthread.cpp b/src/http/httpthread.cpp index a1f51c7..22fc930 100644 --- a/src/http/httpthread.cpp +++ b/src/http/httpthread.cpp @@ -11,6 +11,9 @@ #include "../../include/http/pages/peertrustpage.h" #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 @@ -26,8 +29,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) { @@ -54,12 +60,16 @@ HTTPThread::HTTPThread() m_pagehandlers.push_back(new PeerTrustPage(templatestr)); 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)); // 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);