made passwordless login work
This commit is contained in:
parent
0e3d368896
commit
83a84ea117
@ -4,10 +4,10 @@ function login()
|
||||
if #os.users() > 0 then
|
||||
repeat
|
||||
io.write(net.id.." login: ")
|
||||
un = io.read()
|
||||
un = io.read()
|
||||
io.write("Password: ")
|
||||
pw = io.read("*")
|
||||
cc = os.su(un,pw)
|
||||
pw = io.read("*")
|
||||
cc = os.su(un,pw)
|
||||
until cc
|
||||
return true
|
||||
end
|
||||
|
@ -156,6 +156,7 @@ do -- so local works
|
||||
function os.verifyuser(username,pass)
|
||||
if sha then
|
||||
if ut[username] then
|
||||
if not os.getuattr(username,"hpass") or not os.getuattr(username,"salt") then return true end
|
||||
if sha.sha256(pass..ut[username].salt) == ut[username].hpass then
|
||||
return true
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user