login and logout function for adviser