summaryrefslogtreecommitdiffstats
path: root/src/WebAdmin.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/WebAdmin.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp
index cd141f7eb..08e164d78 100644
--- a/src/WebAdmin.cpp
+++ b/src/WebAdmin.cpp
@@ -89,6 +89,7 @@ bool cWebAdmin::Init(void)
m_IniFile.AddHeaderComment(" Password format: Password=*password*; for example:");
m_IniFile.AddHeaderComment(" [User:admin]");
m_IniFile.AddHeaderComment(" Password=admin");
+ m_IniFile.WriteFile("webadmin.ini");
}
if (!m_IniFile.GetValueSetB("WebAdmin", "Enabled", true))
@@ -229,10 +230,11 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque
} // for itr - Data->m_Form[]
// Parse the URL into individual params:
- size_t idxQM = a_Request.GetURL().find('?');
+ const AString & URL = a_Request.GetURL();
+ size_t idxQM = URL.find('?');
if (idxQM != AString::npos)
{
- cHTTPFormParser URLParams(cHTTPFormParser::fpkURL, a_Request.GetURL().c_str() + idxQM + 1, a_Request.GetURL().length() - idxQM - 1, *Data);
+ cHTTPFormParser URLParams(cHTTPFormParser::fpkURL, URL.c_str() + idxQM + 1, URL.length() - idxQM - 1, *Data);
URLParams.Finish();
for (cHTTPFormParser::const_iterator itr = URLParams.begin(), end = URLParams.end(); itr != end; ++itr)
{
@@ -284,11 +286,6 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque
Content = GetDefaultPage();
}
- if (ShouldWrapInTemplate && (URL.size() > 1))
- {
- Content += "\n<p><a href='" + BaseURL + "'>Go back</a></p>";
- }
-
int MemUsageKiB = cRoot::GetPhysicalRAMUsage();
if (MemUsageKiB > 0)
{
@@ -388,7 +385,6 @@ AString cWebAdmin::GetDefaultPage(void)
{
continue;
}
- AString VersionNum;
AppendPrintf(Content, "<li>%s V.%i</li>", itr->second->GetName().c_str(), itr->second->GetVersion());
}
Content += "</ul>";