iteration

This commit is contained in:
Layla 2023-10-08 04:56:10 -04:00
parent 4199e6e793
commit c06a8f2265
2 changed files with 7 additions and 7 deletions

View File

@ -102,20 +102,20 @@ function add_user_to_group(username, group)
if id == auth_server_id then
if msg == "invalid request" then
io.write("Invalid request\n")
return
return false
elseif msg == "user not found" then
io.write("User not found\n")
return
return false
elseif msg == "invalid token" then
io.write("Invalid token\n")
return
return false
elseif msg == "invalid privileges" then
io.write("Invalid privileges\n")
return
return false
elseif msg == "ok" then
return
return true
else
return
return false
end
end
end

View File

@ -199,7 +199,7 @@ while true do
if not found then
rednet.send(client_id, "invalid token", "auth")
elseif data.users[acting_user].groups["admin"] == nil then
elseif data.users[acting_user]["groups"] ~= nil or data.users[acting_user].groups["admin"] == nil then
rednet.send(client_id, "invalid privileges", "auth")
else
if data.users[request.username].groups == nil then