diff --git a/public/index.php b/public/index.php index 48e0883..9e94c56 100644 --- a/public/index.php +++ b/public/index.php @@ -21,8 +21,6 @@ if (PHP_SAPI === 'cli-server' && $_SERVER['SCRIPT_FILENAME'] !== __FILE__) { require __DIR__ . DIRECTORY_SEPARATOR . '../vendor/autoload.php'; -session_start(); - /** * Step 2: Bootstrap database, ACL, Twig, FlashMessages, Logger */ diff --git a/src/Control/Actions/ServerSelectAction.php b/src/Control/Actions/ServerSelectAction.php index 93fde77..14b3b40 100644 --- a/src/Control/Actions/ServerSelectAction.php +++ b/src/Control/Actions/ServerSelectAction.php @@ -11,8 +11,10 @@ final class ServerSelectAction extends AbstractAction $this->ts->login($this->auth->getIdentity()['user'], $this->auth->getIdentity()['password']); $selectResult = $this->ts->getInstance()->selectServer($sid, 'serverId'); + $dataResult = $this->ts->getInstance()->serverInfo(); $this->session->set('sid', $sid); + $this->session->set('sname', $this->ts->getInstance()->getElement('data', $dataResult)['virtualserver_name']); $this->flash->addMessage('success', $this->translator->trans('done')); return $response->withRedirect('/servers'); diff --git a/src/View/material/layout/menu.twig b/src/View/material/layout/menu.twig index 4045d1b..d570de3 100644 --- a/src/View/material/layout/menu.twig +++ b/src/View/material/layout/menu.twig @@ -13,6 +13,9 @@ {% if session_exists('sid') %}