X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fhomepage.cpp;h=d251fd5dbe59968bf8878dc204bc6a53d59b1a63;hb=822f84f5dac64183c556bd86fea8cd7b0527f528;hp=37d8dc624817d7bdf4c962eb81de06ca1a25b92e;hpb=dec33c63afafabf83c3039e916725cac6faef9b3;p=fms.git
diff --git a/src/http/pages/homepage.cpp b/src/http/pages/homepage.cpp
index 37d8dc6..d251fd5 100644
--- a/src/http/pages/homepage.cpp
+++ b/src/http/pages/homepage.cpp
@@ -19,7 +19,7 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::m
Option::Instance()->Get("FCPHost",fcphost);
Option::Instance()->Get("FProxyPort",fproxyport);
- if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="shutdown")
+ if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="shutdown" && ValidateFormPassword(queryvars))
{
m_log->trace("HomePage::GeneratePage requested shutdown");
((FMSApp *)&FMSApp::instance())->Terminate();
@@ -30,11 +30,54 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::m
content+="FMS version ";
content+=FMS_VERSION;
content+="
";
- content+="Check for new versions at the FMS Freesite
";
+
+ 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+="
";