diff options
author | nielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-06 21:53:35 +0200 |
---|---|---|
committer | nielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-06 21:53:35 +0200 |
commit | 474b113b2f5cb43c360f504ac43141eba9b071ee (patch) | |
tree | 5947fe910b713ed31e799e6ae8c06ff838a29189 /MCServer/Plugins | |
parent | Fixed player teleporting too far away ("Entity lost") (diff) | |
download | cuberite-474b113b2f5cb43c360f504ac43141eba9b071ee.tar cuberite-474b113b2f5cb43c360f504ac43141eba9b071ee.tar.gz cuberite-474b113b2f5cb43c360f504ac43141eba9b071ee.tar.bz2 cuberite-474b113b2f5cb43c360f504ac43141eba9b071ee.tar.lz cuberite-474b113b2f5cb43c360f504ac43141eba9b071ee.tar.xz cuberite-474b113b2f5cb43c360f504ac43141eba9b071ee.tar.zst cuberite-474b113b2f5cb43c360f504ac43141eba9b071ee.zip |
Diffstat (limited to 'MCServer/Plugins')
-rw-r--r-- | MCServer/Plugins/Core/web_permissions.lua | 23 |
1 files changed, 21 insertions, 2 deletions
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 [[<option value="]] .. value .. [[" selected>]] .. text .. [[</option>]]
+ else
+ return [[<option value="]] .. value .. [[">]] .. text .. [[</option>"]]
+ end
+end
+
local function ShowUsersTable()
local Content = "<h4>Users</h4>"
@@ -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 [[<select name="]] .. name .. [[">]] .. Groups .. [[</select>]]
+end
+
+
local function AddPlayers( Request )
- local Content = "<h4>Add Players</h4>"
+ local Content = "<h4>Add or change Players</h4>"
if( Request.PostParams["AddPlayerToGroup"] ~= nil ) then
if Request.PostParams["AddPlayer"] ~= "" then
if Request.PostParams["AddGroups"] ~= "" then
@@ -89,9 +107,10 @@ local function AddPlayers( Request ) <tr><td style="width: 20%;">Player:</td>
<td><input type="text" name="AddPlayer" value=""></td></tr><br>
<tr><td style="width: 20%;">Group:</td>
- <td><input type="text" name="AddGroup" value=""></td></tr>
+ <td>]] .. HTML_Select_Group("AddGroup", GroupsIni:KeyName(0) ) .. [[</td></tr>
</table>
<input type="submit" value="Add Player" name="AddPlayerToGroup">]]
+
return Content
end
|