cWebAdmin


Index:
Articles
Classes
Hooks

Quick navigation:
BannerPattern
BossBarColor
BossBarDivisionType
cArrowEntity
cBeaconEntity
cBedEntity
cBlockArea
cBlockEntity
cBlockEntityWithItems
cBlockInfo
cBoat
cBoundingBox
cBrewingstandEntity
cChatColor
cChestEntity
cChunkDesc
cClientHandle
cColor
cCommandBlockEntity
cCompositeChat
cCraftingGrid
cCraftingRecipe
cCryptoHash
cCuboid
cDispenserEntity
cDropperEntity
cDropSpenserEntity
cEnchantments
cEnderCrystal
cEntity
cEntityEffect
cExpBottleEntity
cExpOrb
cFallingBlock
cFile
cFireChargeEntity
cFireworkEntity
cFloater
cFlowerPotEntity
cFurnaceEntity
cGhastFireballEntity
cHangingEntity
cHopperEntity
cIniFile
cInventory
cItem
cItemFrame
cItemGrid
cItems
cJson
cJukeboxEntity
cLeashKnot
cLineBlockTracer
cLuaWindow
cMap
cMapManager
cMobHeadEntity
cMobSpawnerEntity
cMojangAPI
cMonster
cNetwork
cNoteEntity
cObjective
cPainting
cPawn
cPickup
cPlayer
cPlugin
cPluginLua
cPluginManager
cProjectileEntity
cRankManager
cRoot
cScoreboard
cServer
cServerHandle
cSignEntity
cSplashPotionEntity
cStringCompression
cTCPLink
cTeam
cThrownEggEntity
cThrownEnderPearlEntity
cThrownSnowballEntity
cTNTEntity
cUDPEndpoint
cUrlClient
cUrlParser
CustomStatistic
cUUID
cWebAdmin
cWindow
cWitherSkullEntity
cWorld
EffectID
HTTPFormData
HTTPRequest
HTTPTemplateRequest
ItemCategory
lxp
SmokeDirection
sqlite3
StatisticsManager
TakeDamageInfo
tolua
Vector3d
Vector3f
Vector3i
Globals

Contents


cWebAdmin class


Functions

NameParametersReturn valueNotes
AddWebTab
Titlestring
UrlPathstring
HandlerFnfunction
(STATIC) Adds a new web tab to webadmin. The tab uses "Title" as its display string and is identified in the URL using the UrlPath (https://server.domain.com/webadmin/{PluginName}/{UrlPath}). The HandlerFn is the callback function that is called when the admin accesses the page, it has the following signature:
function (a_Request, a_UrlPath)
return Content, ContentType
end
URLPath must not contain a '/', the recommendation is to use only 7-bit-clean ASCII character set.
GetAllWebTabs
table
(STATIC) Returns an array-table with each item describing a web tab, for all web tabs registered in the WebAdmin, for all plugins. The returned table has the following format:
{
{
PluginName = "Plugin's API name",
UrlPath = "UrlPath given to AddWebTab",
Title = "Title given to AddWebTab",
},
...
}
GetBaseURL
URLstring
string
(STATIC) Returns the string that is the path of the base webadmin ("../../../webadmin") relative to the given URL.
GetContentTypeFromFileExt
FileExtstring
string
(STATIC) Returns the content-type that should be used for files with the specified extension (without the dot), such as "text/plain" for the "txt" extension. If the extension is not known, returns an empty string.
GetHTMLEscapedString
Inputstring
string
(STATIC) Gets the HTML-escaped representation of a requested string. This is useful for user input and game data that is not guaranteed to be escaped already.
GetPage
RequestHTTPRequest
table
(STATIC) Returns the (inner HTML) page contents for the specified request. Calls the appropriate WebTab handler registered via AddWebTab() and returns the information from that plugin wrapped in a table with the following structure:
{
Content = "", -- Content returned by the plugin
ContentType = "", -- Content type returned by the plugin, or "text/html" if none returned
UrlPath = "", -- UrlPath decoded from the request
TabTitle = "", -- Title of the tab that handled the request, as given to AddWebTab()
PluginName = "", -- API name of the plugin that handled the request
PluginFolder = "", -- Folder name (= display name) of the plugin that handled the request
}
This function is mainly used in the webadmin template file.
GetPorts
string
Returns a comma-separated list of ports on which the webadmin is configured to listen. Note that this list does include ports that may currently be unavailable (another server was already listening on them prior to launching Cuberite).
GetURLEncodedString
Inputstring
string
(STATIC) OBSOLETE - use cUrlParser:UrlEncode() instead.
Returns the string given to it escaped by URL encoding, which makes the string suitable for transmission in an URL. Invalid characters are turned into "%xy" values.
Reload Reloads the webadmin's config - the allowed logins, the template script and the login page. Note that reloading will not change the "enabled" state of the server, and it will not update listening ports. Existing WebTabs will be kept registered even after the reload.
Generated by APIDump on 2022-10-28 17:00:47, Build ID Unknown, Commit approx: 21ec3ebe26bff24b5fc6d96f86a441c9c9628247