Added code to setup a connection to the database and system for logging in the user (untested).