1
0

Remove old Android leftovers (#4722)

This commit is contained in:
Mat
2020-05-07 22:14:00 +03:00
committed by GitHub
parent f3b4183dc2
commit c710f6a4ea
22 changed files with 40 additions and 108 deletions

View File

@@ -143,7 +143,7 @@ void cWebAdmin::Stop(void)
bool cWebAdmin::LoadLoginPage(void)
{
cFile File(FILE_IO_PREFIX "webadmin/login_template.html", cFile::fmRead);
cFile File("webadmin/login_template.html", cFile::fmRead);
if (!File.IsOpen())
{
return false;
@@ -198,16 +198,16 @@ void cWebAdmin::Reload(void)
}
m_TemplateScript.Create();
m_TemplateScript.RegisterAPILibs();
if (!m_TemplateScript.LoadFile(FILE_IO_PREFIX "webadmin/template.lua"))
if (!m_TemplateScript.LoadFile("webadmin/template.lua"))
{
LOGWARN("Could not load WebAdmin template \"%s\". WebAdmin will not work properly!", FILE_IO_PREFIX "webadmin/template.lua");
LOGWARN("Could not load WebAdmin template \"%s\". WebAdmin will not work properly!", "webadmin/template.lua");
m_TemplateScript.Close();
}
// Load the login template, provide a fallback default if not found:
if (!LoadLoginPage())
{
LOGWARN("Could not load WebAdmin login page \"%s\", using fallback template.", FILE_IO_PREFIX "webadmin/login_template.html");
LOGWARN("Could not load WebAdmin login page \"%s\", using fallback template.", "webadmin/login_template.html");
// Set the fallback:
m_LoginPage = \
@@ -378,7 +378,7 @@ void cWebAdmin::HandleFileRequest(cHTTPServerConnection & a_Connection, cHTTPInc
// Read the file contents and guess its mime-type, based on the extension:
AString Content = "<h2>404 Not Found</h2>";
AString ContentType = "text/html";
AString Path = Printf(FILE_IO_PREFIX "webadmin/files/%s", FileURL.c_str());
AString Path = Printf("webadmin/files/%s", FileURL.c_str());
// Return 404 if the file is not found, or the URL contains '../' (for security reasons)
if ((FileURL.find("../") == AString::npos) && cFile::IsFile(Path))