protected function _layoutLogin(array $args = null)
    {
        // During error reporting the user or menu are not always known.
        if ($this->currentUser && $this->menu) {
            $div = \MUtil_Html::create('div', array('id' => 'login'), $args);

            $p = $div->p();
            if ($this->currentUser->isActive()) {
                $p->append(sprintf($this->_('You are logged in as %s'), $this->currentUser->getFullName()));
                $item = $this->menu->findController('index', 'logoff');
                $p->a($item->toHRefAttribute(), $this->_('Logoff'), array('class' => 'logout'));
                $item->set('visible', false);
            } else {
                $item = $this->menu->findController('index', 'login');
                $p->a($item->toHRefAttribute(), $this->_('You are not logged in'), array('class' => 'logout'));
            }

            return $div;
        }
    }