doc->addChild('content'); $content->addChild('p', L('home.welcome', $config['site']['name'])); $identity = $session->getIdentity(); if ($identity === null) { $content->addChild('p', L('home.logged-out')); $link = $content->addChild('a', L('login.title')); $link->addAttribute('href', '/login'); } else { $name = isset($identity->extras['name']) ? $identity->extras['name'] . " ($identity->user)" : $identity->user; $content->addChild('p', L('home.logged-in', $name)); $link = $content->addChild('a', L('logout.title')); $link->addAttribute('href', '/logout'); } $resp->send(); }