From 013da806ec20b62a742aded9a9d2b8131193f30d Mon Sep 17 00:00:00 2001 From: jfhumann Date: Fri, 18 Apr 2014 21:09:44 +0200 Subject: Did some static analysis, fixed some bugs and optimized a lot of code --- src/WebAdmin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/WebAdmin.cpp') diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp index cd141f7eb..a3b3cc5be 100644 --- a/src/WebAdmin.cpp +++ b/src/WebAdmin.cpp @@ -229,10 +229,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) { @@ -388,7 +389,6 @@ AString cWebAdmin::GetDefaultPage(void) { continue; } - AString VersionNum; AppendPrintf(Content, "
  • %s V.%i
  • ", itr->second->GetName().c_str(), itr->second->GetVersion()); } Content += ""; -- cgit v1.2.3 From d15743df1c734aa44f791a180fe041e95590c97b Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 12:41:22 -0700 Subject: Removed old unused code --- src/WebAdmin.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/WebAdmin.cpp') diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp index a3b3cc5be..737705d7c 100644 --- a/src/WebAdmin.cpp +++ b/src/WebAdmin.cpp @@ -285,11 +285,6 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque Content = GetDefaultPage(); } - if (ShouldWrapInTemplate && (URL.size() > 1)) - { - Content += "\n

    Go back

    "; - } - int MemUsageKiB = cRoot::GetPhysicalRAMUsage(); if (MemUsageKiB > 0) { -- cgit v1.2.3 From ab2dfb44faf94fcae4b9ca2af13aa14035e96a97 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 30 Apr 2014 17:37:25 +0200 Subject: If webadmin.ini doesn't exist, example one is written immediately. --- src/WebAdmin.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/WebAdmin.cpp') diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp index 737705d7c..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)) -- cgit v1.2.3