added unlogged in page redirect

curUser holds the current logged in username as a string which can be
used to get information from the database