X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fhomepage.cpp;h=f305f30ebfd8c9a417dfece2fdb6a764bbd567c5;hb=ee580d19b7920904587e18d72a3465d52eab6204;hp=28bfa0fb9071d184cb320af1e77cfb4092b06259;hpb=d8ccfe2b3944adf07d35534459cdda19d15217c8;p=fms.git diff --git a/src/http/pages/homepage.cpp b/src/http/pages/homepage.cpp index 28bfa0f..f305f30 100644 --- a/src/http/pages/homepage.cpp +++ b/src/http/pages/homepage.cpp @@ -1,4 +1,6 @@ #include "../../../include/http/pages/homepage.h" +#include "../../../include/stringfunctions.h" +#include "../../../include/global.h" #ifdef XMEM #include @@ -6,7 +8,26 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::map &queryvars) { - return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nHome"; + + if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="shutdown") + { + wantshutdown=true; + } + + std::string content="

Home

"; + content+="

"; + content+="FMS version "; + content+=FMS_VERSION; + content+="
"; + content+="Use these pages to administer your FMS installation."; + content+="

"; + content+="

"; + content+="

"; + content+=""; + content+=""; + content+="
"; + content+="

"; + return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content); } const bool HomePage::WillHandleURI(const std::string &uri)