Posted 23 September 2012 - 05:30 PM
The program on the wiki 'Login with Roaming Profiles' don't work. I wrote it on 3 PCs on the Server
3 = Password Server
4 = Client
5 = Client
and every time I want to log in on PC 4 or 5 i get 'Not authorised'
I copied the code directly from the wiki and changed the numbers of the pcs.
I hope you can help me quickly :P/>/>
Password Server
term.setCursorPos(1,1)
print("This is a password server. There is no user interaction here.")
print("Please find a computer and login there.")
local firstCycle = true
local validSender = false
local modemSide = "left"
local valid = false
users = { test, test1 }
passwords = { test, test1 }
senders = { 4, 5 }
function bootUp()
rednet.open(modemSide)
end
while true do
validSender = false
if firstCycle then
bootUp()
firstCycle = false
end
senderId, message, distance = rednet.receive()
for i,v in ipairs(senders) do
if v == senderId then
validSender = true
break
end
end
if validSender then
for i,v in ipairs(users) do
if message == v then
valid = true
password = passwords
else
valid = false
end
end
if valid then
rednet.send(senderId, password)
else
rednet.send(senderId, "Not Valid")
end
end
end
Client 1 & 2
local failed = true
local attempted_login = true
local password_server = 3
rednet.open("left")
while locker do
attempted_login = false
term.clear()
term.setCursorPos(1,1)
print("Welcome to a USERS PC : Roaming Profile Enabled")
print("What would you like to do?")
print("[1] Login (*)")
print("[2] Shutdown")
write("> ")
local input = read()
if input == "2" then
os.shutdown()
elseif input == "1" then
attempted_login = true
print("Please login…")
write("Username: ")
local username = read()
write("Password: ")
local password = read("*")
rednet.send(password_server, username)
senderId, message, distance = rednet.receive(5)
if password == message then
failed = false
locker = false
term.clear()
term.setCursorPos(1,1)
print("Welcome ", username)
else
print("Not authorised.")
sleep(1)
end
else
print("Command not recognised…")
sleep(2)
end
end
3 = Password Server
4 = Client
5 = Client
and every time I want to log in on PC 4 or 5 i get 'Not authorised'
I copied the code directly from the wiki and changed the numbers of the pcs.
I hope you can help me quickly :P/>/>
Password Server
Spoiler
term.clear()term.setCursorPos(1,1)
print("This is a password server. There is no user interaction here.")
print("Please find a computer and login there.")
local firstCycle = true
local validSender = false
local modemSide = "left"
local valid = false
users = { test, test1 }
passwords = { test, test1 }
senders = { 4, 5 }
function bootUp()
rednet.open(modemSide)
end
while true do
validSender = false
if firstCycle then
bootUp()
firstCycle = false
end
senderId, message, distance = rednet.receive()
for i,v in ipairs(senders) do
if v == senderId then
validSender = true
break
end
end
if validSender then
for i,v in ipairs(users) do
if message == v then
valid = true
password = passwords
else
valid = false
end
end
if valid then
rednet.send(senderId, password)
else
rednet.send(senderId, "Not Valid")
end
end
end
Spoiler
local locker = truelocal failed = true
local attempted_login = true
local password_server = 3
rednet.open("left")
while locker do
attempted_login = false
term.clear()
term.setCursorPos(1,1)
print("Welcome to a USERS PC : Roaming Profile Enabled")
print("What would you like to do?")
print("[1] Login (*)")
print("[2] Shutdown")
write("> ")
local input = read()
if input == "2" then
os.shutdown()
elseif input == "1" then
attempted_login = true
print("Please login…")
write("Username: ")
local username = read()
write("Password: ")
local password = read("*")
rednet.send(password_server, username)
senderId, message, distance = rednet.receive(5)
if password == message then
failed = false
locker = false
term.clear()
term.setCursorPos(1,1)
print("Welcome ", username)
else
print("Not authorised.")
sleep(1)
end
else
print("Command not recognised…")
sleep(2)
end
end