1
0

made the permission page more manageable.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1453 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
nielsbreu@gmail.com 2013-05-06 19:53:35 +00:00
parent 5d4591de47
commit 474b113b2f

View File

@ -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