version 0.3.29
[fms.git] / src / http / pages / homepage.cpp
index ec4ea32..15cf76e 100644 (file)
 const std::string HomePage::GeneratePage(const std::string &method, const std::map<std::string,std::string> &queryvars)\r
 {\r
 \r
+       Option option(m_db);\r
+\r
        std::string messagecountstr="";\r
        std::string filecountstr="";\r
        std::string fcphost="127.0.0.1";\r
        std::string fproxyport="8888";\r
 \r
-       Option::Instance()->Get("FCPHost",fcphost);\r
-       Option::Instance()->Get("FProxyPort",fproxyport);\r
+       option.Get("FCPHost",fcphost);\r
+       option.Get("FProxyPort",fproxyport);\r
 \r
        if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="shutdown" && ValidateFormPassword(queryvars))\r
        {\r
@@ -87,7 +89,12 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::m
        {\r
                st.ResultText(0,messagecountstr);\r
        }\r
-       content+="Messages waiting to be inserted:"+messagecountstr+"<br>";\r
+       content+="Messages waiting to be inserted:"+messagecountstr;\r
+       if (messagecountstr!="0") //show link to message page\r
+       {\r
+               content+=" (<a href=\"showpendingmessage.htm\">show messages</a>)";\r
+       }\r
+       content+="<br>";\r
        st=m_db->Prepare("SELECT COUNT(*) FROM tblFileInserts WHERE Key IS NULL;");\r
        st.Step();\r
        if(st.RowReturned())\r
@@ -95,7 +102,6 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::m
                st.ResultText(0,filecountstr);\r
        }\r
        content+="Files waiting to be inserted:"+filecountstr+"<br>";\r
-\r
        content+="<p class=\"paragraph\">";\r
        content+="<form name=\"frmshutdown\" method=\"POST\">";\r
        content+=CreateFormPassword();\r