added $temp parameter to login to allow a temporary login of the $user