src/http/pages/peermaintenancepage.cpp\r
src/http/pages/peertrustpage.cpp\r
src/http/pages/showcaptchapage.cpp\r
+src/http/pages/versioninfopage.cpp\r
src/nntp/extensiontrust.cpp\r
src/nntp/mime\r
src/nntp/nntpconnection.cpp\r
\r
#define VERSION_MAJOR "0"\r
#define VERSION_MINOR "3"\r
-#define VERSION_RELEASE "6"\r
+#define VERSION_RELEASE "7"\r
#define FMS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_RELEASE\r
\r
typedef Poco::ScopedLock<Poco::FastMutex> Guard;\r
--- /dev/null
+#ifndef _versioninfopage_\r
+#define _versioninfopage_\r
+\r
+#include "../ipagehandler.h"\r
+#include "../../idatabase.h"\r
+\r
+class VersionInfoPage:public IPageHandler,public IDatabase\r
+{\r
+public:\r
+ VersionInfoPage(const std::string &templatestr):IPageHandler(templatestr) {}\r
+\r
+ IPageHandler *New() { return new VersionInfoPage(m_template); }\r
+\r
+private:\r
+ const bool WillHandleURI(const std::string &uri);\r
+ const std::string GeneratePage(const std::string &method, const std::map<std::string,std::string> &queryvars);\r
+\r
+};\r
+\r
+#endif // _versioninfopage_\r
m_last1day=Poco::Timestamp();\r
m_last1day-=Poco::Timespan(0,23,51,0,0);\r
\r
+ m_deletemessagesolderthan=180;\r
std::string tempval="180";\r
Option::Instance()->Get("DeleteMessagesOlderThan",tempval);\r
StringFunctions::Convert(tempval,m_deletemessagesolderthan);\r
// delete old messages\r
date=Poco::Timestamp();\r
date-=Poco::Timespan(m_deletemessagesolderthan,0,0,0,0);\r
+ m_log->trace("PeriodicDBMaintenance::Do1DayMaintenance deleting messages prior to "+Poco::DateTimeFormatter::format(date,"%Y-%m-%d"));\r
st=m_db->Prepare("DELETE FROM tblMessage WHERE MessageDate<?;");\r
st.Bind(0,Poco::DateTimeFormatter::format(date,"%Y-%m-%d"));\r
st.Step();\r
#include <Poco/FormattingChannel.h>\r
#include <Poco/PatternFormatter.h>\r
#include <iostream>\r
+#include <string>\r
\r
#ifdef _WIN32\r
#include <direct.h>\r
ServerApplication::initialize(self);\r
\r
// set working directory - fall back on application.dir if working directory isn't set\r
- if(m_workingdirectory=="")\r
+ // if we are runing as a service, then working directory needs to be set to the application directory\r
+ if(m_workingdirectory=="" || config().getBool("application.runAsService",false)==true)\r
{\r
m_workingdirectory=config().getString("application.dir");\r
}\r
#include "../../include/http/pages/controlboardpage.h"\r
#include "../../include/http/pages/peermaintenancepage.h"\r
#include "../../include/http/pages/peertrustpage.h"\r
+#include "../../include/http/pages/versioninfopage.h"\r
\r
FMSHTTPRequestHandlerFactory::FMSHTTPRequestHandlerFactory()\r
{\r
m_pagehandlers.push_back(new ControlBoardPage(templatestr));\r
m_pagehandlers.push_back(new PeerMaintenancePage(templatestr));\r
m_pagehandlers.push_back(new PeerTrustPage(templatestr));\r
+ m_pagehandlers.push_back(new VersionInfoPage(templatestr));\r
// homepage must be last - catch all page handler\r
m_pagehandlers.push_back(new HomePage(templatestr));\r
\r
if(currentmajor<major || (currentmajor==major && currentminor<minor) || (currentmajor==major && currentminor==minor && currentrelease<release))\r
{\r
content+="<b>You are running an old version of FMS. Please update here: <a href=\"http://"+fcphost+":"+fproxyport+"/"+freesite+"\">FMS "+major+"."+minor+"."+release+"</a></b><br>";\r
+ content+="You can see the release info <a href=\"versioninfo.htm?Major="+major+"&Minor="+minor+"&Release="+release+"\">here</a><br>";\r
showgenericupdate=false;\r
}\r
\r
\r
if(showgenericupdate)\r
{\r
- content+="Check for new versions at the <a href=\"http://"+fcphost+":"+fproxyport+"/USK@0npnMrqZNKRCRoGojZV93UNHCMN-6UU3rRSAmP6jNLE,~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fms/63/\">FMS Freesite</a><br>";\r
+ content+="Check for new versions at the <a href=\"http://"+fcphost+":"+fproxyport+"/USK@0npnMrqZNKRCRoGojZV93UNHCMN-6UU3rRSAmP6jNLE,~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fms/66/\">FMS Freesite</a><br>";\r
}\r
\r
content+="Use these pages to administer your FMS installation.";\r
--- /dev/null
+#include "../../../include/http/pages/versioninfopage.h"\r
+#include "../../../include/global.h"\r
+#include "../../../include/stringfunctions.h"\r
+\r
+#include <string>\r
+\r
+const std::string VersionInfoPage::GeneratePage(const std::string &method, const std::map<std::string,std::string> &queryvars)\r
+{\r
+ std::string content="";\r
+\r
+ std::string major=VERSION_MAJOR;\r
+ std::string minor=VERSION_MINOR;\r
+ std::string release=VERSION_RELEASE;\r
+\r
+ if(queryvars.find("Major")!=queryvars.end())\r
+ {\r
+ major=(*queryvars.find("Major")).second;\r
+ }\r
+ if(queryvars.find("Minor")!=queryvars.end())\r
+ {\r
+ minor=(*queryvars.find("Minor")).second;\r
+ }\r
+ if(queryvars.find("Release")!=queryvars.end())\r
+ {\r
+ release=(*queryvars.find("Release")).second;\r
+ }\r
+\r
+ SQLite3DB::Statement st=m_db->Prepare("SELECT Notes, Changes FROM tblFMSVersion WHERE Major=? AND Minor=? AND Release=?;");\r
+ st.Bind(0,major);\r
+ st.Bind(1,minor);\r
+ st.Bind(2,release);\r
+ st.Step();\r
+\r
+ if(st.RowReturned())\r
+ {\r
+ std::string notes="";\r
+ std::string changes="";\r
+\r
+ st.ResultText(0,notes);\r
+ st.ResultText(1,changes);\r
+\r
+ content+="<h2>Release "+major+"."+minor+"."+release+"</h2>";\r
+ content+="<h3>Notes</h3>";\r
+ content+=StringFunctions::Replace(notes,"\n","<br>");\r
+ content+="<h3>Changes</h3>";\r
+ content+=StringFunctions::Replace(changes,"\n","<br>");\r
+ }\r
+\r
+ return StringFunctions::Replace(m_template,"[CONTENT]",content);\r
+}\r
+\r
+const bool VersionInfoPage::WillHandleURI(const std::string &uri)\r
+{\r
+ if(uri.find("versioninfo.")!=std::string::npos)\r
+ {\r
+ return true;\r
+ }\r
+ else\r
+ {\r
+ return false;\r
+ }\r
+}\r
\r
// NNTPBindAddresses\r
st.Bind(0,"NNTPBindAddresses");\r
- st.Bind(1,"localhost");\r
+ st.Bind(1,"localhost,127.0.0.1");\r
st.Step();\r
st.Reset();\r
upd.Bind(0,"NNTP Server");\r