summaryrefslogtreecommitdiffstats
path: root/src/WebAdmin.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-12 19:13:46 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-12 19:13:46 +0200
commit1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f (patch)
treef7cf72e49a7ca60d10af12ad9ff70910e089b028 /src/WebAdmin.h
parentRenamed SetWalkSpeed() to SetRelativeWalkSpeed() (diff)
parentFixed iron ore drop. (diff)
downloadcuberite-1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f.tar
cuberite-1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f.tar.gz
cuberite-1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f.tar.bz2
cuberite-1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f.tar.lz
cuberite-1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f.tar.xz
cuberite-1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f.tar.zst
cuberite-1223a24d3c87832c08545e6f3e8e4c51ff1e7e3f.zip
Diffstat (limited to '')
-rw-r--r--src/WebAdmin.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/WebAdmin.h b/src/WebAdmin.h
index aefc1d145..94b95dbcf 100644
--- a/src/WebAdmin.h
+++ b/src/WebAdmin.h
@@ -116,6 +116,9 @@ public:
/** Stops the HTTP server, if it was started. */
void Stop(void);
+ /** Loads the login template. Returns true if the loading succeeds, false if not. */
+ bool LoadLoginTemplate(void);
+
void AddPlugin(cWebPlugin * a_Plugin);
void RemovePlugin(cWebPlugin * a_Plugin);
@@ -146,6 +149,9 @@ public:
/** Returns the prefix needed for making a link point to the webadmin root from the given URL ("../../../webadmin"-style) */
static AString GetBaseURL(const AStringVector & a_URLSplit);
+ /** Returns the content type from the file extension. If the extension isn't in the list, the function returns "text/html" */
+ static AString GetContentTypeFromFileExt(const AString & a_FileExtension);
+
protected:
/** Common base class for request body data handlers */
class cRequestData
@@ -205,6 +211,9 @@ protected:
/** The Lua template script to provide templates: */
cLuaState m_TemplateScript;
+ /** The template that provides the login site: */
+ AString m_LoginTemplate;
+
/** The HTTP server which provides the underlying HTTP parsing, serialization and events */
cHTTPServer m_HTTPServer;
@@ -214,6 +223,9 @@ protected:
/** Handles requests for the root page */
void HandleRootRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request);
+ /** Handles requests for a file */
+ void HandleFileRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request);
+
// cHTTPServer::cCallbacks overrides:
virtual void OnRequestBegun (cHTTPConnection & a_Connection, cHTTPRequest & a_Request) override;
virtual void OnRequestBody (cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, size_t a_Size) override;