iteration
This commit is contained in:
parent
c305bcd995
commit
6eca8bd3a5
11
lib/auth.lua
11
lib/auth.lua
@ -49,6 +49,15 @@ function check_user_group(username, group)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function list_to_string(list)
|
||||||
|
local str = ""
|
||||||
|
for i, v in ipairs(list) do
|
||||||
|
str = str .. v .. ", "
|
||||||
|
end
|
||||||
|
return str:sub(1, -3)
|
||||||
|
end
|
||||||
|
|
||||||
function list_user_groups(username)
|
function list_user_groups(username)
|
||||||
local data = {
|
local data = {
|
||||||
["action"] = "list_groups",
|
["action"] = "list_groups",
|
||||||
@ -71,7 +80,7 @@ function list_user_groups(username)
|
|||||||
io.write("Invalid token\n")
|
io.write("Invalid token\n")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
return msg
|
return list_to_string(msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user