Update to login function

Added ability to login with email or username when set by admin, based
on value from the config.php file (for now)