X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fhomepage.cpp;h=3ebe2f1f36c68689566e33836b60a14e4058d5a8;hb=dabd19d7f764b8275c9c8370c7b89675b6a78243;hp=1a65cf46a0d59b716def95bacc3046e7639fc046;hpb=14fff12d9df0ee30e2df4bf9d22c2e83065816df;p=fms.git
diff --git a/src/http/pages/homepage.cpp b/src/http/pages/homepage.cpp
index 1a65cf4..3ebe2f1 100644
--- a/src/http/pages/homepage.cpp
+++ b/src/http/pages/homepage.cpp
@@ -1,6 +1,8 @@
#include "../../../include/http/pages/homepage.h"
#include "../../../include/stringfunctions.h"
#include "../../../include/global.h"
+#include "../../../include/fmsapp.h"
+#include "../../../include/option.h"
#ifdef XMEM
#include Home
";
@@ -22,10 +30,54 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::m
content+="FMS version ";
content+=FMS_VERSION;
content+="
";
+
+ bool showgenericupdate=true;
+ SQLite3DB::Statement st=m_db->Prepare("SELECT Major, Minor, Release, PageKey FROM tblFMSVersion ORDER BY Major DESC, Minor DESC, Release DESC LIMIT 1;");
+ st.Step();
+ if(st.RowReturned())
+ {
+ int major=0;
+ int minor=0;
+ int release=0;
+ int currentmajor=0;
+ int currentminor=0;
+ int currentrelease=0;
+ std::string freesite="";
+ std::string majorstr="";
+ std::string minorstr="";
+ std::string releasestr="";
+
+ StringFunctions::Convert(VERSION_MAJOR,currentmajor);
+ StringFunctions::Convert(VERSION_MINOR,currentminor);
+ StringFunctions::Convert(VERSION_RELEASE,currentrelease);
+
+ st.ResultInt(0,major);
+ st.ResultInt(1,minor);
+ st.ResultInt(2,release);
+ st.ResultText(3,freesite);
+
+ StringFunctions::Convert(major,majorstr);
+ StringFunctions::Convert(minor,minorstr);
+ StringFunctions::Convert(release,releasestr);
+
+ if(currentmajor
";
+ content+="You can see the release info here
";
+ showgenericupdate=false;
+ }
+
+ }
+
+ if(showgenericupdate)
+ {
+ content+="Check for new versions at the FMS Freesite
";
+ }
+
content+="Use these pages to administer your FMS installation.";
content+="
"; content+="
"; content+=""; - return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content); + return StringFunctions::Replace(m_template,"[CONTENT]",content); } const bool HomePage::WillHandleURI(const std::string &uri)