iteration
This commit is contained in:
		
							
								
								
									
										11
									
								
								lib/auth.lua
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								lib/auth.lua
									
									
									
									
									
								
							@ -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
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user