2017-09-07 13:12:10 +10:00
|
|
|
function login()
|
2017-09-09 21:26:29 +10:00
|
|
|
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
|
2017-09-07 13:12:10 +10:00
|
|
|
end
|
|
|
|
end
|