os.loadAPI(".var/kernal")

usr1 = kernal.getLine(".var/uaconf", 5)
pas1 = kernal.getLine(".var/uaconf", 7)

usr2 = kernal.getLine(".var/uaconf", 10)
pas2 = kernal.getLine(".var/uaconf", 12)

usr3 = kernal.getLine(".var/uaconf", 15)
pas3 = kernal.getLine(".var/uaconf", 17)

usr4 = kernal.getLine(".var/uaconf", 20)
pas4 = kernal.getLine(".var/uaconf", 22)

usr5 = kernal.getLine(".var/uaconf", 25)
pas5 = kernal.getLine(".var/uaconf", 27)




term.setBackgroundColour(colors.white)
term.clear()
--[[if fs.exists(".var/ver") then
	fs.delete(".var/ver")
end
local osEVer = http.get("http://cc.ndfjay.co.uk/NDFOS/.var/ver")
kernal.fwrite(".var/ver", osEVer.readAll())
osEVer.close()]]





if kernal.getLine(".var/settings", 7)=="Startup Logo: Visible" then
	kernal.NDFboot()
	sleep(2.5)
        term.setBackgroundColor(1)
	term.clear()


	if kernal.getLine(".var/settings", 8)=="New User: True" then
		kernal.drawLogo(18, 4)
		term.setCursorPos(17, 10)
		term.setTextColor(128)
		print("New User Name")
		term.setCursorPos(18, 11)
		term.setBackgroundColor(256)
		print("           ")
		term.setBackgroundColor(colors.white)
		term.setCursorPos(17, 13)
		term.setTextColor(128)
		print("New Password")
		term.setCursorPos(18, 14)
		term.setBackgroundColor(256)
		print("           ")

		term.setCursorPos(19, 11)
		term.setTextColor(128)

		write("")
		input = read()
		kernal.replaceLine(".var/uaconf", 10, input)
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		kernal.replaceLine(".var/uaconf", 12, input)
		kernal.replaceLine(".var/settings", 8, "New User: False")
		shell.run(".var/gui")
else
end

if kernal.getLine(".var/settings", 3)=="Auto Log-in: True" then
shell.run(".var/gui")
elseif kernal.getLine(".var/settings", 3)=="Auto Log-in: False" then

kernal.drawLogo(18, 4)
term.setCursorPos(19, 10)
term.setTextColor(128)
print("User Name")
term.setCursorPos(18, 11)
term.setBackgroundColor(256)
print("           ")
term.setBackgroundColor(colors.white)
term.setCursorPos(19, 13)
term.setTextColor(128)
print("Password")
term.setCursorPos(18, 14)
term.setBackgroundColor(256)
print("           ")

term.setCursorPos(19, 11)
term.setTextColor(128)

write("")
input = read()
if input == usr1 then
term.setCursorPos(19, 14)
	write("")
	input = read("*")
	if input == pas1 then
		shell.run(".var/gui")
		else
			os.reboot()
	end
	
	elseif input == usr2 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas2 then
			shell.run(".var/gui")
			else
				os.reboot()
		end
		
	elseif input == usr3 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas3 then
			shell.run(".var/gui")
			else
				os.reboot()
		end

	elseif input == usr4 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas4 then
			shell.run(".var/gui")
			else
				os.reboot()
		end
		
	elseif input == usr5 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas5 then
			shell.run(".var/gui")
			else
				os.reboot()
		end
		
		
		else
os.reboot()
end

end
		else
		
		if kernal.getLine(".var/settings", 8)=="New User: True" then
		kernal.drawLogo(18, 4)
		term.setCursorPos(17, 10)
		term.setTextColor(128)
		print("New User Name")
		term.setCursorPos(18, 11)
		term.setBackgroundColor(256)
		print("           ")
		term.setBackgroundColor(colors.white)
		term.setCursorPos(17, 13)
		term.setTextColor(128)
		print("New Password")
		term.setCursorPos(18, 14)
		term.setBackgroundColor(256)
		print("           ")

		term.setCursorPos(19, 11)
		term.setTextColor(128)

		write("")
		input = read()
		kernal.replaceLine(".var/uaconf", 10, input)
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		kernal.replaceLine(".var/uaconf", 12, input)
		kernal.replaceLine(".var/settings", 8, "New User: False")
		shell.run(".var/gui")
else
end
		
if kernal.getLine(".var/settings", 3)=="Auto Log-in: True" then
shell.run(".var/gui")
elseif kernal.getLine(".var/settings", 3)=="Auto Log-in: False" then

kernal.drawLogo(18, 4)
term.setCursorPos(19, 10)
term.setTextColor(128)
print("User Name")
term.setCursorPos(18, 11)
term.setBackgroundColor(256)
print("           ")
term.setBackgroundColor(colors.white)
term.setCursorPos(19, 13)
term.setTextColor(128)
print("Password")
term.setCursorPos(18, 14)
term.setBackgroundColor(256)
print("           ")

term.setCursorPos(19, 11)
term.setTextColor(128)

write("")
input = read()
if input == usr1 then
term.setCursorPos(19, 14)
	write("")
	input = read("*")
	if input == pas1 then
		shell.run(".var/gui")
		else
			os.reboot()
	end
	
	elseif input == usr2 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas2 then
			shell.run(".var/gui")
			else
				os.reboot()
		end
		
	elseif input == usr3 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas3 then
			shell.run(".var/gui")
			else
				os.reboot()
		end

	elseif input == usr4 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas4 then
			shell.run(".var/gui")
			else
				os.reboot()
		end
		
	elseif input == usr5 then
		term.setCursorPos(19, 14)
		write("")
		input = read("*")
		if input == pas5 then
			shell.run(".var/gui")
			else
				os.reboot()
		end
		
		
		else
os.reboot()
end


	end
	end
