2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
2016-01-20 00:10:39 +00:00
|
|
|
/**
|
2016-01-20 21:05:16 +00:00
|
|
|
* Pterodactyl - Panel
|
2017-01-24 22:57:08 +00:00
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
2016-01-20 00:10:39 +00:00
|
|
|
*/
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
namespace Pterodactyl\Http\Controllers\Server;
|
|
|
|
|
2016-12-07 22:46:38 +00:00
|
|
|
use Log;
|
2016-01-22 04:53:48 +00:00
|
|
|
use Alert;
|
2017-05-01 18:21:18 +00:00
|
|
|
use Cache;
|
2016-01-23 00:40:48 +00:00
|
|
|
use Pterodactyl\Models;
|
2015-12-06 18:58:49 +00:00
|
|
|
use Illuminate\Http\Request;
|
2016-12-07 22:46:38 +00:00
|
|
|
use Pterodactyl\Exceptions\DisplayException;
|
|
|
|
use Pterodactyl\Http\Controllers\Controller;
|
|
|
|
use Pterodactyl\Repositories\ServerRepository;
|
|
|
|
use Pterodactyl\Exceptions\DisplayValidationException;
|
2017-08-05 22:26:30 +00:00
|
|
|
use Pterodactyl\Repositories\old_Daemon\FileRepository;
|
2016-10-06 21:27:30 +00:00
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
class ServerController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Renders server index page for specified server.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
2015-12-06 18:58:49 +00:00
|
|
|
*/
|
2017-02-02 23:21:36 +00:00
|
|
|
public function getIndex(Request $request, $uuid)
|
2015-12-06 18:58:49 +00:00
|
|
|
{
|
2017-02-02 23:21:36 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js([
|
2017-01-03 21:47:33 +00:00
|
|
|
'meta' => [
|
|
|
|
'saveFile' => route('server.files.save', $server->uuidShort),
|
|
|
|
'csrfToken' => csrf_token(),
|
|
|
|
],
|
2017-03-19 15:04:03 +00:00
|
|
|
'config' => [
|
|
|
|
'console_count' => config('pterodactyl.console.count'),
|
2017-04-18 01:54:26 +00:00
|
|
|
'console_freq' => config('pterodactyl.console.frequency'),
|
2017-03-19 15:04:03 +00:00
|
|
|
],
|
2017-01-03 21:47:33 +00:00
|
|
|
]);
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
return view('server.index', [
|
|
|
|
'server' => $server,
|
2017-02-03 00:41:38 +00:00
|
|
|
'node' => $server->node,
|
2015-12-06 18:58:49 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2017-04-15 22:23:29 +00:00
|
|
|
/**
|
|
|
|
* Renders server console as an individual item.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-04-15 22:23:29 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
|
|
|
public function getConsole(Request $request, $uuid)
|
|
|
|
{
|
|
|
|
\Debugbar::disable();
|
|
|
|
$server = Models\Server::byUuid($uuid);
|
|
|
|
|
|
|
|
$server->js([
|
|
|
|
'config' => [
|
|
|
|
'console_count' => config('pterodactyl.console.count'),
|
2017-04-18 01:54:26 +00:00
|
|
|
'console_freq' => config('pterodactyl.console.frequency'),
|
2017-04-15 22:23:29 +00:00
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
|
|
|
return view('server.console', [
|
|
|
|
'server' => $server,
|
|
|
|
'node' => $server->node,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
/**
|
|
|
|
* Renders file overview page.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
2015-12-06 18:58:49 +00:00
|
|
|
*/
|
2017-01-03 21:47:33 +00:00
|
|
|
public function getFiles(Request $request, $uuid)
|
2015-12-06 18:58:49 +00:00
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2015-12-06 18:58:49 +00:00
|
|
|
$this->authorize('list-files', $server);
|
|
|
|
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js([
|
2017-01-03 21:47:33 +00:00
|
|
|
'meta' => [
|
|
|
|
'directoryList' => route('server.files.directory-list', $server->uuidShort),
|
|
|
|
'csrftoken' => csrf_token(),
|
|
|
|
],
|
|
|
|
'permissions' => [
|
|
|
|
'moveFiles' => $request->user()->can('move-files', $server),
|
|
|
|
'copyFiles' => $request->user()->can('copy-files', $server),
|
|
|
|
'compressFiles' => $request->user()->can('compress-files', $server),
|
|
|
|
'decompressFiles' => $request->user()->can('decompress-files', $server),
|
|
|
|
'createFiles' => $request->user()->can('create-files', $server),
|
|
|
|
'downloadFiles' => $request->user()->can('download-files', $server),
|
|
|
|
'deleteFiles' => $request->user()->can('delete-files', $server),
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
return view('server.files.index', [
|
|
|
|
'server' => $server,
|
2017-02-03 00:41:38 +00:00
|
|
|
'node' => $server->node,
|
2015-12-06 18:58:49 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders add file page.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
2015-12-06 18:58:49 +00:00
|
|
|
*/
|
2017-01-03 21:47:33 +00:00
|
|
|
public function getAddFile(Request $request, $uuid)
|
2015-12-06 18:58:49 +00:00
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2017-03-17 20:19:45 +00:00
|
|
|
$this->authorize('create-files', $server);
|
2017-01-20 22:10:14 +00:00
|
|
|
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js();
|
2015-12-06 18:58:49 +00:00
|
|
|
|
|
|
|
return view('server.files.add', [
|
|
|
|
'server' => $server,
|
2017-02-03 00:41:38 +00:00
|
|
|
'node' => $server->node,
|
2016-12-07 22:46:38 +00:00
|
|
|
'directory' => (in_array($request->get('dir'), [null, '/', ''])) ? '' : trim($request->get('dir'), '/') . '/',
|
2015-12-06 18:58:49 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders edit file page for a given file.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
|
|
|
* @param string $file
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
2015-12-06 18:58:49 +00:00
|
|
|
*/
|
|
|
|
public function getEditFile(Request $request, $uuid, $file)
|
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2015-12-06 18:58:49 +00:00
|
|
|
$this->authorize('edit-files', $server);
|
|
|
|
|
|
|
|
$fileInfo = (object) pathinfo($file);
|
2016-01-22 04:53:48 +00:00
|
|
|
$controller = new FileRepository($uuid);
|
2015-12-06 18:58:49 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
$fileContent = $controller->returnFileContents($file);
|
2016-09-07 20:12:06 +00:00
|
|
|
} catch (DisplayException $ex) {
|
|
|
|
Alert::danger($ex->getMessage())->flash();
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2016-09-07 20:12:06 +00:00
|
|
|
return redirect()->route('server.files.index', $uuid);
|
|
|
|
} catch (\Exception $ex) {
|
|
|
|
Log::error($ex);
|
|
|
|
Alert::danger('An error occured while attempting to load the requested file for editing, please try again.')->flash();
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2016-09-07 19:28:57 +00:00
|
|
|
return redirect()->route('server.files.index', $uuid);
|
2015-12-06 18:58:49 +00:00
|
|
|
}
|
|
|
|
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js([
|
2017-01-19 21:58:57 +00:00
|
|
|
'stat' => $fileContent['stat'],
|
|
|
|
]);
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
return view('server.files.edit', [
|
|
|
|
'server' => $server,
|
2017-02-03 00:41:38 +00:00
|
|
|
'node' => $server->node,
|
2015-12-06 18:58:49 +00:00
|
|
|
'file' => $file,
|
2016-10-02 03:09:55 +00:00
|
|
|
'stat' => $fileContent['stat'],
|
|
|
|
'contents' => $fileContent['file']->content,
|
2016-12-07 22:46:38 +00:00
|
|
|
'directory' => (in_array($fileInfo->dirname, ['.', './', '/'])) ? '/' : trim($fileInfo->dirname, '/') . '/',
|
2015-12-06 18:58:49 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles downloading a file for the user.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
|
|
|
* @param string $file
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
2015-12-06 18:58:49 +00:00
|
|
|
*/
|
|
|
|
public function getDownloadFile(Request $request, $uuid, $file)
|
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2015-12-06 18:58:49 +00:00
|
|
|
$this->authorize('download-files', $server);
|
|
|
|
|
2017-05-01 18:21:18 +00:00
|
|
|
$token = str_random(40);
|
2017-05-01 18:52:14 +00:00
|
|
|
Cache::tags(['Server:Downloads'])->put($token, [
|
2017-05-01 18:21:18 +00:00
|
|
|
'server' => $server->uuid,
|
|
|
|
'path' => $file,
|
2017-05-01 18:52:14 +00:00
|
|
|
], 5);
|
2015-12-06 18:58:49 +00:00
|
|
|
|
2017-05-01 18:26:59 +00:00
|
|
|
return redirect($server->node->scheme . '://' . $server->node->fqdn . ':' . $server->node->daemonListen . '/server/file/download/' . $token);
|
2015-12-06 18:58:49 +00:00
|
|
|
}
|
|
|
|
|
2017-03-19 23:36:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the allocation overview for a server.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-01-19 01:45:10 +00:00
|
|
|
public function getAllocation(Request $request, $uuid)
|
2016-01-22 04:53:48 +00:00
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2017-01-19 01:45:10 +00:00
|
|
|
$this->authorize('view-allocation', $server);
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js();
|
2016-01-23 00:40:48 +00:00
|
|
|
|
2017-01-19 01:45:10 +00:00
|
|
|
return view('server.settings.allocation', [
|
2017-02-03 00:41:38 +00:00
|
|
|
'server' => $server->load(['allocations' => function ($query) {
|
|
|
|
$query->orderBy('ip', 'asc');
|
|
|
|
$query->orderBy('port', 'asc');
|
|
|
|
}]),
|
|
|
|
'node' => $server->node,
|
2016-01-22 04:53:48 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2017-03-19 23:36:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the startup overview for a server.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-01-18 00:30:27 +00:00
|
|
|
public function getStartup(Request $request, $uuid)
|
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2017-01-18 00:30:27 +00:00
|
|
|
$this->authorize('view-startup', $server);
|
|
|
|
|
2017-06-19 02:38:00 +00:00
|
|
|
$server->load(['node', 'allocation', 'variables']);
|
|
|
|
$variables = Models\ServiceVariable::where('option_id', $server->option_id)->get();
|
|
|
|
|
2017-03-12 23:34:06 +00:00
|
|
|
$replacements = [
|
2017-01-18 00:30:27 +00:00
|
|
|
'{{SERVER_MEMORY}}' => $server->memory,
|
2017-03-12 23:34:06 +00:00
|
|
|
'{{SERVER_IP}}' => $server->allocation->ip,
|
|
|
|
'{{SERVER_PORT}}' => $server->allocation->port,
|
2017-01-18 00:30:27 +00:00
|
|
|
];
|
|
|
|
|
2017-03-12 23:34:06 +00:00
|
|
|
$processed = str_replace(array_keys($replacements), array_values($replacements), $server->startup);
|
2017-06-19 02:38:00 +00:00
|
|
|
|
|
|
|
foreach ($variables as $var) {
|
|
|
|
if ($var->user_viewable) {
|
|
|
|
$serverVar = $server->variables->where('variable_id', $var->id)->first();
|
|
|
|
$var->server_set_value = $serverVar->variable_value ?? $var->default_value;
|
|
|
|
} else {
|
|
|
|
$var->server_set_value = '[hidden]';
|
|
|
|
}
|
|
|
|
|
|
|
|
$processed = str_replace('{{' . $var->env_variable . '}}', $var->server_set_value, $processed);
|
2017-01-18 00:30:27 +00:00
|
|
|
}
|
|
|
|
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js();
|
|
|
|
|
2017-01-18 00:30:27 +00:00
|
|
|
return view('server.settings.startup', [
|
|
|
|
'server' => $server,
|
2017-02-03 00:41:38 +00:00
|
|
|
'node' => $server->node,
|
2017-06-19 02:38:00 +00:00
|
|
|
'variables' => $variables->where('user_viewable', 1),
|
2017-03-12 23:34:06 +00:00
|
|
|
'service' => $server->service,
|
2017-01-18 00:30:27 +00:00
|
|
|
'processedStartup' => $processed,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2017-03-19 23:36:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the database overview for a server.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-01-16 01:28:54 +00:00
|
|
|
public function getDatabases(Request $request, $uuid)
|
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2017-01-16 01:28:54 +00:00
|
|
|
$this->authorize('view-databases', $server);
|
2017-03-17 21:17:36 +00:00
|
|
|
|
|
|
|
$server->load('node', 'databases.host');
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js();
|
2017-01-16 01:28:54 +00:00
|
|
|
|
|
|
|
return view('server.settings.databases', [
|
|
|
|
'server' => $server,
|
2017-02-03 00:41:38 +00:00
|
|
|
'node' => $server->node,
|
2017-03-17 21:17:36 +00:00
|
|
|
'databases' => $server->databases,
|
2017-01-16 01:28:54 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2017-03-19 23:36:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the SFTP overview for a server.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-01-16 01:28:54 +00:00
|
|
|
public function getSFTP(Request $request, $uuid)
|
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2017-01-16 01:28:54 +00:00
|
|
|
$this->authorize('view-sftp', $server);
|
2017-02-03 00:41:38 +00:00
|
|
|
$server->js();
|
2017-01-16 01:28:54 +00:00
|
|
|
|
|
|
|
return view('server.settings.sftp', [
|
|
|
|
'server' => $server,
|
2017-02-03 00:41:38 +00:00
|
|
|
'node' => $server->node,
|
2017-01-16 01:28:54 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2017-03-19 23:36:50 +00:00
|
|
|
/**
|
|
|
|
* Handles changing the SFTP password for a server.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
|
|
*/
|
2016-01-22 04:53:48 +00:00
|
|
|
public function postSettingsSFTP(Request $request, $uuid)
|
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2016-01-22 04:53:48 +00:00
|
|
|
$this->authorize('reset-sftp', $server);
|
|
|
|
|
|
|
|
try {
|
|
|
|
$repo = new ServerRepository;
|
|
|
|
$repo->updateSFTPPassword($server->id, $request->input('sftp_pass'));
|
|
|
|
Alert::success('Successfully updated this servers SFTP password.')->flash();
|
|
|
|
} catch (DisplayValidationException $ex) {
|
2017-01-16 01:28:54 +00:00
|
|
|
return redirect()->route('server.settings.sftp', $uuid)->withErrors(json_decode($ex->getMessage()));
|
2016-01-22 04:53:48 +00:00
|
|
|
} catch (DisplayException $ex) {
|
|
|
|
Alert::danger($ex->getMessage())->flash();
|
|
|
|
} catch (\Exception $ex) {
|
|
|
|
Log::error($ex);
|
|
|
|
Alert::danger('An unknown error occured while attempting to update this server\'s SFTP settings.')->flash();
|
|
|
|
}
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-01-16 01:28:54 +00:00
|
|
|
return redirect()->route('server.settings.sftp', $uuid);
|
2016-01-22 04:53:48 +00:00
|
|
|
}
|
|
|
|
|
2017-03-19 23:36:50 +00:00
|
|
|
/**
|
|
|
|
* Handles changing the startup settings for a server.
|
|
|
|
*
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param string $uuid
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
|
|
*/
|
2016-01-23 00:40:48 +00:00
|
|
|
public function postSettingsStartup(Request $request, $uuid)
|
|
|
|
{
|
2017-02-03 00:41:38 +00:00
|
|
|
$server = Models\Server::byUuid($uuid);
|
2016-01-23 00:40:48 +00:00
|
|
|
$this->authorize('edit-startup', $server);
|
|
|
|
|
|
|
|
try {
|
|
|
|
$repo = new ServerRepository;
|
2017-03-05 04:45:22 +00:00
|
|
|
$repo->updateStartup($server->id, $request->except('_token'));
|
2016-01-23 00:40:48 +00:00
|
|
|
Alert::success('Server startup variables were successfully updated.')->flash();
|
2017-03-12 23:34:06 +00:00
|
|
|
} catch (DisplayValidationException $ex) {
|
|
|
|
return redirect()->route('server.settings.startup', $uuid)->withErrors(json_decode($ex->getMessage()));
|
2016-01-23 00:40:48 +00:00
|
|
|
} catch (DisplayException $ex) {
|
|
|
|
Alert::danger($ex->getMessage())->flash();
|
2016-12-07 22:46:38 +00:00
|
|
|
} catch (\Exception $ex) {
|
2016-01-23 00:40:48 +00:00
|
|
|
Log::error($ex);
|
|
|
|
Alert::danger('An unhandled exception occured while attemping to update startup variables for this server. Please try again.')->flash();
|
|
|
|
}
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-02-16 19:04:15 +00:00
|
|
|
return redirect()->route('server.settings.startup', $uuid);
|
2016-01-23 00:40:48 +00:00
|
|
|
}
|
2015-12-06 18:58:49 +00:00
|
|
|
}
|