Archived
1
0
Fork 0
This repository has been archived on 2023-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
ts3web/src/Control/Actions/ServerCreateAction.php

19 lines
667 B
PHP
Raw Normal View History

2018-04-03 11:56:20 +00:00
<?php
use Slim\Http\Request;
use Slim\Http\Response;
final class ServerCreateAction extends AbstractAction
{
public function __invoke(Request $request, Response $response, $args)
{
$body = $request->getParsedBody();
$this->ts->login($this->auth->getIdentity()['user'], $this->auth->getIdentity()['password']);
$dataResult = $this->ts->getInstance()->serverCreate($body);
$this->ts->checkCommandResult($dataResult);
$this->flash->addMessage('success', $this->translator->trans('server_create.created.success', ['%token%' => $dataResult['data']['token']]));
return $response->withRedirect('/servers');
}
}