Here is what I would like to do:
Create a central server for storing/validating the username(s), password(s) entered through the client terminal connected to the door of the facility.
Allow 3 failed login attempts before completely disabling the terminal for 1 hour (86400 seconds).
I would like to maintin the current structure of the system in that, it still requires a match of BOTH variables to proceed through the the hall into the facility. Below is a copy of the current code running on that door. Please feel free to comment / corrent / suggest changes in the current design. ANY help with this project is MUCH appreciated. Thanks in advance.
--Disable Manual Termination
os.pullEvent = os.pullEventRaw
--Declare Variables
local username;
local password;
id = "Crysys";
key = "thewhiterabbit";
override= "6552180573395";
alarmSide = "back";
alarmTimeout = "3";
doorSide = "bottom";
doorTimeout = "5";
errorTimeout = "1";
delay = "1";
--Display Data Requests, Get Inputs
term.clear();
term.setCursorPos(1,1);
print("Nuclear Facility - Access Verification Required");
print("");
print("Username:");
term.setCursorPos(11,3);
username = read();
print("Password:");
term.setCursorPos(11,4);
password = read("*");
--Handle Inputs
if username == id and password == key then
term.clear();
term.setCursorPos(1,1);
print("Access Granted");
rs.setOutput(alarmSide, true);
sleep(alarmTimeout);
rs.setOutput(alarmSide, false);
sleep(delay);
rs.setOutput(doorSide, true);
sleep(doorTimeout);
rs.setOutput(doorSide, false);
os.reboot();
elseif username == id and password == override then
term.clear();
term.setCursorPos(1,1);
print("Maintanence Mode ENABLED");
print("");
else
print("Login FAILED");
sleep(errorTimeout);
os.reboot();
end











