Probably, you could just change login.php; I think it handles all login cases. The name as username is a bit more complicated, but could be most simply handled by generating and setting the username whenever the user profile is updated; however, this could be a problem if two users had the same name, because most things run under the assumption that there will only be one user with a given username.