diff --git a/MCServer/Plugins/Core/web_permissions.lua b/MCServer/Plugins/Core/web_permissions.lua index 962078bb2..5278767e7 100644 --- a/MCServer/Plugins/Core/web_permissions.lua +++ b/MCServer/Plugins/Core/web_permissions.lua @@ -1,3 +1,11 @@ +local function HTML_Option( value, text, selected ) + if( selected == true ) then + return [[]] + else + return [["]] + end +end + local function ShowUsersTable() local Content = "

Users

" @@ -59,8 +67,18 @@ local function ShowGroupsTable() return Content end +local function HTML_Select_Group( name, defaultValue ) + Groups = "" + for I=0, GroupsIni:GetNumKeys() - 1 do + Groups = Groups .. + HTML_Option(GroupsIni:KeyName(I), GroupsIni:KeyName(I), defaultValue == GroupsIni:KeyName(I) ) + end + return [[]] +end + + local function AddPlayers( Request ) - local Content = "

Add Players

" + local Content = "

Add or change Players

" if( Request.PostParams["AddPlayerToGroup"] ~= nil ) then if Request.PostParams["AddPlayer"] ~= "" then if Request.PostParams["AddGroups"] ~= "" then @@ -89,9 +107,10 @@ local function AddPlayers( Request ) Player:
Group: - + ]] .. HTML_Select_Group("AddGroup", GroupsIni:KeyName(0) ) .. [[ ]] + return Content end