public function isLoggedIn()
    {
        if (!$this->hasFakeFrontEnd()) {
            throw new Exception('Please create a front end before calling isLoggedIn.', 1334439494);
        }

        return isset($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])
            && is_array($GLOBALS['TSFE']->fe_user->user);
    }