changes in isUserLogedIn()

In function isUserLoggedIn() check if the object $loggedInUser is NULL before accessing it to avoid an error in the $sql query.