iteration

This commit is contained in:
Layla 2023-10-08 05:07:48 -04:00
parent b4d9af64d0
commit f9ae7618c9

View File

@ -77,12 +77,11 @@ while true do
password = convert_password(request.password) password = convert_password(request.password)
} }
-- if only user in database, add to admin group local user_count = #data.users
log(table.getn(data.users)) if user_count == 1 then
if table.getn(data.users) == 0 then data.users[request.username].groups = {
log("Adding " .. request.username .. " to admin group") ["admin"] = true
data.users[request.username].groups = {} }
data.users[request.username].groups["admin"] = true
end end
save_data() save_data()