summaryrefslogtreecommitdiffstats
path: root/src/WebAdmin.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-05-25Added a warning if the webadmin is enabled without any users. (#5499)NiLSPACE1-0/+24
2023-05-16Removed all Printf-family functions from StringUtils.Mattes D1-4/+4
Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code.
2020-05-15Enable some more clang-tidy linter checks (#4738)peterbell101-2/+2
* Avoid inefficient AString -> c_str() -> AString round trip * Avoid redundant string init expressions * Avoid unnecessary return, continue, etc. * Add .clang-format to help with clang-tidy fix-its * Avoid unnecessary passing by value * Avoid unnecessary local copying * Avoid copying in range-for loops * Avoid over-complicated boolean expressions * Some violations missed by my local clang-tidy * Allow unnecessary continue statements * Add brackets * Another expression missed locally * Move BindingsProcessor call into clang-tidy.sh and add space * Fix pushd not found error * Different grouping of CheckBlockInteractionRate
2020-05-07Remove old Android leftovers (#4722)Mat1-5/+5
2019-06-11Fix directory traversal bug (#4341)Wilhem Barbier1-9/+8
Refuse to serve an URL containing `../`.
2017-09-11Replace ItemCallbacks with lambdas (#3993)peterbell101-24/+0
2017-09-02Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot1-0/+24
This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
2017-09-01Replace ItemCallbacks with lambdas (#3948)peterbell101-24/+0
2017-07-21Remove smart pointer macrospeterbell101-1/+1
2017-03-19Removed development plugins from settings filemathiascode1-0/+1
2017-01-18WebAdmin: Renamed two neighboring locks for better clarity / style.Mattes D1-2/+2
2017-01-18Webadmin: Added a missing CS lock.Mattes D1-0/+1
This fixes an assert when accessing the login-page and the plugin-failure pages in the webadmin.
2016-12-25Refactored to put URL Encoding / Decoding in a single place. (#3491)Mattes D1-24/+1
2016-06-27Removed cWebPlugin, WebAdmin uses cLuaState::cCallback.Mattes D1-211/+204
2016-03-21Revert "Lua callback"Mattes D1-204/+211
2016-03-17Removed cWebPlugin, WebAdmin uses cLuaState::cCallback.Mattes D1-211/+204
2016-03-03WebAdmin: Finish HTTP responses.Mattes D1-0/+1
2016-03-01Renamed HTTPResponse to HTTPOutgoingResponse.Mattes D1-4/+4
2016-03-01WebAdmin uses the new HTTP parser framework.Mattes D1-27/+47
2016-03-01Renamed HTTPServer folder to HTTP.Mattes D1-2/+2
It contains client code as well.
2016-03-01Moved cHTTPRequest to a separate file, renamed to cHTTPRequestParser.Mattes D1-7/+7
2016-03-01Renamed the HTTP classes to indicate they're for server.Mattes D1-7/+7
2016-02-05Bulk clearing of whitespaceLogicParrot1-3/+3
2015-09-25Compile.sh namechange to cuberiteSafwat Halaby1-5/+5
2015-09-25Namechange to CuberiteMattes D1-5/+5
2015-05-28Fix commentstycho1-2/+2
2015-05-24Made -Weverything an error.tycho1-3/+3
2015-05-09CheckBasicStyle: checks spaces around * and &.Mattes D1-1/+1
2015-04-21Added URL member to the HTTPRequest API class.Mattes D1-1/+2
2015-04-19Refactored cWebPlugin for C++11 style and proper WebTab clearing.Mattes D1-2/+2
2015-04-19Split the plugin names and plugin folders to avoid confusing them.Mattes D1-8/+20
Ref.: http://forum.mc-server.org/showthread.php?tid=1877
2015-01-27WebAdmin uses the new cNetwork API.Mattes D1-32/+43
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-5/+5
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-5/+5
2014-09-07Webadmin: Added default ports to auto-generated ini file.Mattes D1-2/+6
Fixes #1382.
2014-09-02[WebAdmin] Code improvements.Howaner1-59/+91
2014-08-31WebAdmin: Stop webadmin if template can't load.Howaner1-1/+3
2014-08-31WebAdmin: Added "files" folder and load the login template from login_template.htmlHowaner1-10/+96
2014-08-13Fixed shadowing variableTycho1-5/+5
2014-08-13Removed unused methodTycho1-22/+0
2014-08-09WebAdmin: Added GetURLEncodedString().madmaxoft1-0/+32
2014-08-09WebAdmin: Added GetURLEncodedString().madmaxoft1-0/+32
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft1-3/+3
2014-07-21Style: Normalized spaces after if, for and while.madmaxoft1-1/+1
2014-07-17Normalized comments.madmaxoft1-1/+1
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-17Fixed spaces around single-line comments.madmaxoft1-1/+1
There should be at least two spaces in front and one space after //-style comments.
2014-06-19Nullify deleted pointers.archshift1-0/+1
2014-04-30If webadmin.ini doesn't exist, example one is written immediately.madmaxoft1-0/+1
2014-04-27Removed old unused codeTycho1-5/+0
2014-04-18Did some static analysis, fixed some bugs and optimized a lot of codejfhumann1-3/+3
2014-04-01Rewritten HTTPServer to use size_t for data lengths.madmaxoft1-2/+2
2014-03-12Moved Lua API registering into a separate function.madmaxoft1-0/+1
This will allow us to use Lua as lite-config files as well, should we want to.
2014-02-07WebAdmin is stopped properly on server shutdown / restart.madmaxoft1-11/+27
Fixes #272.
2013-12-31fixed warnings in webadmin.cppTycho Bickerstaff1-0/+3
2013-12-24Fixed getting configure button going to port 0.STRWarrior1-3/+3
2013-12-08Moved bindings-related to a Bindings subfolder.madmaxoft1-3/+3
Ref.: #407
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-09Removed cStringMap.madmaxoft1-2/+0
It wasn't used for anything anymore.
2013-11-05Implemented suggestionsTiger Wang1-1/+1
- Reverted changes to WebAdmin.cpp IPv6 ports and Server.cpp server description + Added default value explicitly for HardCore value * Split PluginManager plugin defaults write to new function - Removed a commented block from BlockTorch and... + Added g_BlockIsTorchPlaceable to Defines.h
2013-11-04Autogeneration of settings.ini and webadmin.iniTiger Wang1-5/+10
Fixes issue #75
2013-10-25cIniFile doesn't store filename internally anymore.madmaxoft1-5/+4
2013-10-21Fixed GetHTMLEscapedString() binding, removed obsolete memory function from API.madmaxoft1-11/+1
2013-10-19Added a string reserve.Alexander Harkness1-0/+1
2013-10-19Fixed compile error. silly parentheses creeping in.Alexander Harkness1-1/+1
2013-10-19Changed the code according to xoft's suggestions.Alexander Harkness1-10/+10
2013-10-19Fixed general failings with everything. Fixes #211.Alexander Harkness1-3/+3
My editor fixed some extra tabs in globals.
2013-10-19Added a HTML escaping function to cWebAdmin.Alexander Harkness1-15/+54
Apparently my editor fixed some failed tabs too.
2013-10-18Fixed webadmin logging.madmaxoft1-0/+16
This fixes #262.
2013-10-13WebAdmin honors the [WebAdmin].Enable setting.madmaxoft1-2/+8
This fixes #234.
2013-10-13Fixed WebAdmin's request parameters.madmaxoft1-1/+12
Also added doxycomments on what they really contain.
2013-10-08Implemented the two memory-statistics functions in cRoot.madmaxoft1-52/+2
This fixes #185. cWebAdmin::GetMemoryUsage() is accessible but deprecated (with a warning output to the screen).
2013-10-06Fixed memory leaks in the HTTP frameworkmadmaxoft1-4/+9
2013-10-06Removed remnants of the old webserver.madmaxoft1-23/+2
2013-10-05WebAdmin uses the new HTTP functionality.madmaxoft1-216/+277
This is a partial implementation of #183.
2013-09-30Removed unneeded statementTiger Wang1-1/+1
Also LOGINFO'd "Starting WebAdmin"
2013-09-28Minor startup streamliningTiger Wang1-1/+1
* LOGD'd unneeded debugging messages, streamlining startup + Added a basic timer for how long in seconds it took to start up + Added two checks for plural (plugin/s, second/s)
2013-09-22Updated coding style to match ours.madmaxoft1-4/+8
2013-09-22Implemented Apple-specific GetMemoryUsage.Samuel Barney1-2/+11
2013-09-21Prepared cWebAdmin for Apple-specific GetMmeoryUsage()madmaxoft1-0/+8
2013-09-21Implemented cWebAdmin:GetMemoryUsage() on Linux proper.madmaxoft1-25/+43
Also the function now returns an int, number of KiB used, or -1 on failure.
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-1/+1
2013-08-08Removed LuaScript.madmaxoft1-12/+11
The WebAdmin now uses LuaState directly to call the one function it needs.
2013-08-06cLuaScript now uses cLuaStatemadmaxoft1-4/+4
2013-07-29WebAdmin: Removed the duplicate memory usage queryingmadmaxoft1-31/+8
2013-07-29WebAdmin templates can use LuaFakeTruth1-107/+195
New WebAdmin templates can use Lua to completely compose the pages themselves. This should allow infinite WebAdmin design possibilities.
2013-02-05Added new hooks: OnChunkAvailable(), OnChunkUnloaded() and OnChunkUnloading(). Modified OnChunkGenerated() signature.madmaxoft@gmail.com1-5/+12
http://forum.mc-server.org/showthread.php?tid=464&pid=6312#pid6312 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1193 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-8/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-16Fixed boolean comparison.madmaxoft@gmail.com1-2/+2
Don't compare booleans to false / true, use them directly. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1048 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-14Completely removed support for old style Lua plugins (can use both Plugin and NewPlugin in settings.ini for now)faketruth1-3/+4
Removed cPlugin_Lua, obviously cPluginManager stores plugins by their (folder)name cPluginManager now scans the Plugins folder for potential plugins and adds them as non-loaded plugins Added a DisablePlugin and LoadPlugin to disable and load plugins on a per-plugin basis instead of all at once cPluginManager::FindPlugins refreshes the plugin list by removing non-existing plugins and adding new plugins Made it incredibly easy to use new plugins from the WebAdmin Exposed some food/hunger related functions in cPlayer to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@959 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-9/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-23Fixed WebAdmin showing tab names (thanks for pointing it out Lapayo)faketruth1-6/+3
Changed some std::string to AString git-svn-id: http://mc-server.googlecode.com/svn/trunk@780 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22Added a documentation for block and item handlerslapayo94@gmail.com1-1/+3
Probably fixed dependencies on cWebPlugin_Lua Fixed VC2010 Project file git-svn-id: http://mc-server.googlecode.com/svn/trunk@778 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22WebAdmin should not cause crashes anymorefaketruth1-34/+8
Got rid of cWebPlugin_Lua cPlugin_Lua is also a cWebPlugin now, so plugins don't need a separate cWebPlugin object Changed some stuff to use AString instead of char* git-svn-id: http://mc-server.googlecode.com/svn/trunk@777 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22Chat history limit on the WebAdmin chatfaketruth1-2/+5
Did some refactoring on the JavaScript side of the WebAdmin chat Got rid of cRoot::sRootState Fixed a crash on the WebAdmin when a page is loaded before a world exists git-svn-id: http://mc-server.googlecode.com/svn/trunk@775 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22Now it's possible to only show the plugin's WebAdmin content without the template around it by going to /~webadmin/ instead of /webadmin/faketruth1-3/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@772 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-383/+383
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-05Fixed webadmin for the fixed stringsplittingmadmaxoft@gmail.com1-140/+150
git-svn-id: http://mc-server.googlecode.com/svn/trunk@559 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-14/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Fixed a few obsoleted functionsmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@397 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16git-svn-id: http://mc-server.googlecode.com/svn/trunk@281 0a769ca7-a7f5-676a-18bf-c427514a06d6faketruth1-1/+1
2012-02-13Rewritten most of the code for multithreading; still not 100%, but getting there. If this commit proves to be too problematic, we can always undo it.madmaxoft@gmail.com1-7/+26
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08Added total chunk count to webadminmadmaxoft@gmail.com1-5/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@248 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Rewritten cAuthenticator to make use of the new cIsThread architecture - now authentication runs in a single separate thread for all clients;madmaxoft@gmail.com1-6/+0
Global player-kicking function (cServer, cRoot); More char * -> AString conversion git-svn-id: http://mc-server.googlecode.com/svn/trunk@221 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01AString logging fix 2madmaxoft@gmail.com1-4/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@218 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01sprintf() begone! Replaced with StringUtils' Printf()madmaxoft@gmail.com1-6/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@216 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Introducing StringUtils - the place to be if you are a generic string routine :) No more sprintf()!madmaxoft@gmail.com1-4/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@209 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Plugins can now be enabled and disabled through WebAdminfaketruth1-4/+4
WebPlugins can now have spaces in their tab names git-svn-id: http://mc-server.googlecode.com/svn/trunk@204 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-31Changed how Lua handles the (Post)Params in the HTTPRequest of a WebPluginfaketruth1-5/+14
It should now be theoretically possible to upload files through WebAdmin git-svn-id: http://mc-server.googlecode.com/svn/trunk@203 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-31Linux fixes, but while it compiles, when a user joins it crashes the server with "*** glibc detected *** ./MCServer: double free or corruption (out): 0x00007fb5f5158db0 ***"mtilden@gmail.com1-0/+1
Please look into this. Also, am I the only one compiling/using Linux? git-svn-id: http://mc-server.googlecode.com/svn/trunk@198 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-31Can now receive POST data in WebPlugins!faketruth1-0/+2
Fixed Debug With optimized Noise in VS2010 by having it run the correct MCServer_debug.exe instead of MCServer.exe Changed winsock.h to Winsock2.h in Globals.h so sockets can be graciously closed (See webserver Socket::Close() ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@197 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-30Replaced most FILE operations with a cFile objectmadmaxoft@gmail.com1-24/+27
git-svn-id: http://mc-server.googlecode.com/svn/trunk@196 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-29VC2008 / VC2010: Enabled precompiled header through Globals.h; the header included in every module in the project. Compilation optimization.madmaxoft@gmail.com1-8/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-28Now also compiles in Linuxfaketruth1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@184 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-28Converted entire Core plugin including WebAdmin interface to new plugin method/system/thingy and sexyfied it.faketruth1-13/+37
Made some changes to WebAdmin to make the new plugins work Old plugins still work like they're supposed to Not all hooks have been programmed for the new plugins yet, this still needs to be done git-svn-id: http://mc-server.googlecode.com/svn/trunk@182 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-22Improved Core's WebAmin interface a bit.faketruth1-26/+34
Can now kick players through WebAdmin Can now enable/disable whitelist through WebAdmin Tick speed is limited in a better way now, instead of always sleeping 50ms before each tick, it now add only sleeps additional time when the tick time was faster than 50ms. Server should run slightly faster because of this (and use more cpu%) git-svn-id: http://mc-server.googlecode.com/svn/trunk@167 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-08It's a Squirrel!!faketruth1-1/+1
In SquirrelBindings.h use #define USE_SQUIRREL 1 to enable squirrel git-svn-id: http://mc-server.googlecode.com/svn/trunk@76 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-31Prepared some parts of the code for multi world support, I created lots of TODO'sfaketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03MCServer c++ source filesfaketruth1-0/+309
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6