summaryrefslogtreecommitdiffstats
path: root/source/WebAdmin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/WebAdmin.cpp')
-rw-r--r--source/WebAdmin.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/WebAdmin.cpp b/source/WebAdmin.cpp
index 8c95e4e21..7a1d332a5 100644
--- a/source/WebAdmin.cpp
+++ b/source/WebAdmin.cpp
@@ -56,7 +56,7 @@ cWebAdmin::~cWebAdmin()
{
if (m_IsInitialized)
{
- LOG("Stopping WebAdmin...");
+ LOGD("Stopping WebAdmin...");
}
}
@@ -87,7 +87,11 @@ bool cWebAdmin::Init(void)
{
if (!m_IniFile.ReadFile("webadmin.ini"))
{
- return false;
+ LOGWARN("Regenerating webadmin.ini, all settings will be reset");
+ m_IniFile.AddHeaderComment(" This file controls the webadmin feature of MCServer");
+ m_IniFile.AddHeaderComment(" Username format: [User:*username*] | Password format: Password=*password*; for example:");
+ m_IniFile.AddHeaderComment(" [User:admin]");
+ m_IniFile.AddHeaderComment(" Password=admin");
}
if (!m_IniFile.GetValueSetB("WebAdmin", "Enabled", true))
@@ -96,7 +100,7 @@ bool cWebAdmin::Init(void)
return true;
}
- LOG("Initialising WebAdmin...");
+ LOGD("Initialising WebAdmin...");
AString PortsIPv4 = m_IniFile.GetValueSet("WebAdmin", "Port", "8080");
AString PortsIPv6 = m_IniFile.GetValueSet("WebAdmin", "PortsIPv6", "");
@@ -106,6 +110,7 @@ bool cWebAdmin::Init(void)
return false;
}
m_IsInitialized = true;
+ m_IniFile.WriteFile("webadmin.ini");
return true;
}
@@ -121,7 +126,7 @@ bool cWebAdmin::Start(void)
return false;
}
- LOG("Starting WebAdmin...");
+ LOGD("Starting WebAdmin...");
// Initialize the WebAdmin template script and load the file
m_TemplateScript.Create();