iteration

This commit is contained in:
Layla 2023-10-08 04:51:13 -04:00
parent c305bcd995
commit 6eca8bd3a5

View File

@ -49,6 +49,15 @@ function check_user_group(username, group)
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)
local data = {
["action"] = "list_groups",
@ -71,7 +80,7 @@ function list_user_groups(username)
io.write("Invalid token\n")
return
else
return msg
return list_to_string(msg)
end
end
end