diff --git a/config/ACL.php b/config/ACL.php index 122821e..0877017 100644 --- a/config/ACL.php +++ b/config/ACL.php @@ -34,6 +34,7 @@ class ACL extends \Zend\Permissions\Acl\Acl '/servers/create', '/servers/{sid}', '/servers/select/{sid}', + '/servers/deselect', '/servers/delete/{sid}', '/servers/start/{sid}', '/servers/stop/{sid}', diff --git a/config/env.example b/config/env.example index 64b8b56..66f7946 100644 --- a/config/env.example +++ b/config/env.example @@ -1,7 +1,6 @@ # site site_title="Teamspeak 3 Web" site_url="http://localhost:8080" -site_index="/servers" # values: "/", "..." site_language="en" # values: each yml you specified in data/locale/ site_date_format="d.m.Y H:i:s" # values: all possible for Date::class diff --git a/config/routes.php b/config/routes.php index 5062c5d..76b7ee4 100644 --- a/config/routes.php +++ b/config/routes.php @@ -85,6 +85,11 @@ $container[ServerSelectAction::class] = function ($container) { }; $app->get('/servers/select/{sid}', ServerSelectAction::class); +$container[ServerDeselectAction::class] = function ($container) { + return new ServerDeselectAction($container); +}; +$app->get('/servers/deselect', ServerDeselectAction::class); + $container[ServerDeleteAction::class] = function ($container) { return new ServerDeleteAction($container); }; diff --git a/src/Control/Actions/IndexAction.php b/src/Control/Actions/IndexAction.php index ba5b2b9..c451834 100644 --- a/src/Control/Actions/IndexAction.php +++ b/src/Control/Actions/IndexAction.php @@ -7,6 +7,6 @@ final class IndexAction extends AbstractAction { public function __invoke(Request $request, Response $response, $args) { - return $response->withRedirect(getenv('site_index')); + return $response->withRedirect('/servers'); } } \ No newline at end of file diff --git a/src/Control/Actions/ServerDeselectAction.php b/src/Control/Actions/ServerDeselectAction.php new file mode 100644 index 0000000..2fe87bb --- /dev/null +++ b/src/Control/Actions/ServerDeselectAction.php @@ -0,0 +1,17 @@ +session->delete('sid'); + $this->session->delete('name'); + + $this->flash->addMessage('success', $this->translator->trans('done')); + return $response->withRedirect('/servers'); + } +} \ No newline at end of file diff --git a/src/Util/BootstrapHelper.php b/src/Util/BootstrapHelper.php index 08e7afa..e3a971c 100644 --- a/src/Util/BootstrapHelper.php +++ b/src/Util/BootstrapHelper.php @@ -30,7 +30,6 @@ class BootstrapHelper $env->required([ 'site_title', 'site_url', - 'site_index', 'site_language', 'site_date_format', 'theme', diff --git a/src/View/material/layout.twig b/src/View/material/layout.twig index c475267..746166b 100644 --- a/src/View/material/layout.twig +++ b/src/View/material/layout.twig @@ -11,7 +11,7 @@