From 18bbe82f30af5f0ebb0b4789f386f5179ec56f2b Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 13 Oct 2013 22:19:13 +0200 Subject: WebAdmin honors the [WebAdmin].Enable setting. This fixes #234. --- source/WebAdmin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/WebAdmin.cpp b/source/WebAdmin.cpp index daec2f925..316513f11 100644 --- a/source/WebAdmin.cpp +++ b/source/WebAdmin.cpp @@ -79,8 +79,14 @@ bool cWebAdmin::Init(void) return false; } - AString PortsIPv4 = m_IniFile.GetValue("WebAdmin", "Port", "8080"); - AString PortsIPv6 = m_IniFile.GetValue("WebAdmin", "PortsIPv6", ""); + if (!m_IniFile.GetValueSetB("WebAdmin", "Enabled", true)) + { + // WebAdmin is disabled, bail out faking a success + return true; + } + + AString PortsIPv4 = m_IniFile.GetValueSet("WebAdmin", "Port", "8080"); + AString PortsIPv6 = m_IniFile.GetValueSet("WebAdmin", "PortsIPv6", ""); if (!m_HTTPServer.Initialize(PortsIPv4, PortsIPv6)) { -- cgit v1.2.3