Modify template to handle login problem and add login.php page