reworked loggedInTemplate.php[master]