fix session error; add selected server name to menu
This commit is contained in:
parent
9446d0280a
commit
34a8ab231f
3 changed files with 5 additions and 2 deletions
|
@ -21,8 +21,6 @@ if (PHP_SAPI === 'cli-server' && $_SERVER['SCRIPT_FILENAME'] !== __FILE__) {
|
||||||
|
|
||||||
require __DIR__ . DIRECTORY_SEPARATOR . '../vendor/autoload.php';
|
require __DIR__ . DIRECTORY_SEPARATOR . '../vendor/autoload.php';
|
||||||
|
|
||||||
session_start();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Step 2: Bootstrap database, ACL, Twig, FlashMessages, Logger
|
* Step 2: Bootstrap database, ACL, Twig, FlashMessages, Logger
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -11,8 +11,10 @@ final class ServerSelectAction extends AbstractAction
|
||||||
|
|
||||||
$this->ts->login($this->auth->getIdentity()['user'], $this->auth->getIdentity()['password']);
|
$this->ts->login($this->auth->getIdentity()['user'], $this->auth->getIdentity()['password']);
|
||||||
$selectResult = $this->ts->getInstance()->selectServer($sid, 'serverId');
|
$selectResult = $this->ts->getInstance()->selectServer($sid, 'serverId');
|
||||||
|
$dataResult = $this->ts->getInstance()->serverInfo();
|
||||||
|
|
||||||
$this->session->set('sid', $sid);
|
$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'));
|
$this->flash->addMessage('success', $this->translator->trans('done'));
|
||||||
return $response->withRedirect('/servers');
|
return $response->withRedirect('/servers');
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
|
|
||||||
{% if session_exists('sid') %}
|
{% if session_exists('sid') %}
|
||||||
<hr/>
|
<hr/>
|
||||||
|
{% if session_exists('sname') %}
|
||||||
|
<h6 class="header" data-target="#page">{{ session_get('sname') }}</h6>
|
||||||
|
{% endif %}
|
||||||
<a href="/servers/{{ session_get('sid') }}">
|
<a href="/servers/{{ session_get('sid') }}">
|
||||||
<li class="active withripple" data-target="#page">{% trans %}menu.servers.info{% endtrans %}</li>
|
<li class="active withripple" data-target="#page">{% trans %}menu.servers.info{% endtrans %}</li>
|
||||||
</a>
|
</a>
|
||||||
|
|
Reference in a new issue