OC-PsychOS/modules/applications/login.lua

16 lines
322 B
Lua
Raw Normal View History

function login()
if not userlib then return true end
local un,pw,cc = "","",false
if #userlib.users() > 0 then
repeat
io.write("\f"..MOTD.."\n"..net.id.." login: ")
un = io.read()
io.write("Password: ")
pw = io.read("*")
cc = userlib.verify(un,pw)
until cc
os.setuser(un)
return true
end
end