diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-22 00:17:59 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-22 00:17:59 +0200 |
commit | 46904e182077154770273e9ea5210f6ad42245cd (patch) | |
tree | cc32898b7d9ceaaff628f8f6339e2a16f4b048cf /source | |
parent | Fixed nightbuild script after files move. (diff) | |
download | cuberite-46904e182077154770273e9ea5210f6ad42245cd.tar cuberite-46904e182077154770273e9ea5210f6ad42245cd.tar.gz cuberite-46904e182077154770273e9ea5210f6ad42245cd.tar.bz2 cuberite-46904e182077154770273e9ea5210f6ad42245cd.tar.lz cuberite-46904e182077154770273e9ea5210f6ad42245cd.tar.xz cuberite-46904e182077154770273e9ea5210f6ad42245cd.tar.zst cuberite-46904e182077154770273e9ea5210f6ad42245cd.zip |
Diffstat (limited to 'source')
-rw-r--r-- | source/cWebAdmin.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/cWebAdmin.cpp b/source/cWebAdmin.cpp index 33068ec38..dab6fe9e8 100644 --- a/source/cWebAdmin.cpp +++ b/source/cWebAdmin.cpp @@ -122,7 +122,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r) AStringVector Split = StringSplit(r->path_.substr(1), "/"); - if (Split.empty() || (Split[0] != "webadmin")) + if (Split.empty() || (Split[0] != "webadmin" && Split[0] != "~webadmin")) { r->answer_ += "<h1>Bad request</h1>"; return; @@ -133,6 +133,12 @@ void cWebAdmin::Request_Handler(webserver::http_request* r) r->answer_ += "no auth"; r->auth_realm_ = "MCServer WebAdmin"; } + + bool bDontShowTemplate = false; + if (Split[0] == "~webadmin") + { + bDontShowTemplate = true; + } std::string UserPassword = WebAdmin->m_IniFile->GetValue( "User:"+r->username_, "Password", ""); if ((UserPassword != "") && (r->password_ == UserPassword)) @@ -149,7 +155,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r) std::string Menu; std::string Content; - std::string Template = WebAdmin->GetTemplate(); + std::string Template = bDontShowTemplate ? "{CONTENT}" : WebAdmin->GetTemplate(); std::string FoundPlugin; for (PluginList::iterator itr = WebAdmin->m_Plugins.begin(); itr != WebAdmin->m_Plugins.end(); ++itr) @@ -238,7 +244,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r) - if( Split.size() > 1 ) + if (bDontShowTemplate == false && Split.size() > 1) { Content += "\n<p><a href='" + BaseURL + "'>Go back</a></p>"; } |