Posted 10 October 2016 - 04:11 AM
When using the fs.open files and re-writing the seralized table with users outside of the code, the user login works fine. However, using a 'System Admin Account' with its 'Add User' command from the UI will break the Authenticator/Verifier portion before the UI's.
(Authenticator:
(The Admin Add User command:
The Following is a link to the whole code for perspective, should you need it:
http://pastebin.com/9ivJ7e6w
(Authenticator:
for username,password in pairs(UserCredentials) do
if user == username and pass == password then
success = true
for username,user_rank in pairs(UserRanks) do
rank = user_rank
end
else
success = false
end
end
)(The Admin Add User command:
elseif key == keys.numPad2 then
write("What is their username: ")
NewUser = read()
write("What is their password: ")
NewPass = read()
GetUsers = fs.open("UserData.config","r")
UserFileData = GetUsers.readAll()
AllUsers = textutils.unserialize(UserFileData)
GetUsers.close()
Addusers = fs.open("UserData.config","w")
AllUsers[NewUser] = NewPass
Addusers.write(textutils.serialize(AllUsers))
Addusers.close()
)The Following is a link to the whole code for perspective, should you need it:
http://pastebin.com/9ivJ7e6w