Apply fixes from StyleCI
This commit is contained in:
parent
a1d3bbf73d
commit
c1fb0a665f
150 changed files with 1558 additions and 1760 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>
|
||||
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -21,47 +21,47 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Http\Controllers\Remote;
|
||||
|
||||
use Pterodactyl\Models;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
use Pterodactyl\Services\NotificationService;
|
||||
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Services\NotificationService;
|
||||
|
||||
class RemoteController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Controller Constructor
|
||||
* Controller Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// No middleware for this route.
|
||||
}
|
||||
|
||||
public function postDownload(Request $request) {
|
||||
public function postDownload(Request $request)
|
||||
{
|
||||
$download = Models\Download::where('token', $request->input('token', '00'))->first();
|
||||
if (!$download) {
|
||||
if (! $download) {
|
||||
return response()->json([
|
||||
'error' => 'An invalid request token was recieved with this request.'
|
||||
'error' => 'An invalid request token was recieved with this request.',
|
||||
], 403);
|
||||
}
|
||||
|
||||
$download->delete();
|
||||
|
||||
return response()->json([
|
||||
'path' => $download->path,
|
||||
'server' => $download->server
|
||||
'server' => $download->server,
|
||||
]);
|
||||
}
|
||||
|
||||
public function postInstall(Request $request)
|
||||
{
|
||||
$server = Models\Server::where('uuid', $request->input('server'))->first();
|
||||
if (!$server) {
|
||||
if (! $server) {
|
||||
return response()->json([
|
||||
'error' => 'No server by that ID was found on the system.'
|
||||
'error' => 'No server by that ID was found on the system.',
|
||||
], 422);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ class RemoteController extends Controller
|
|||
|
||||
if (base64_decode($hmac) !== hash_hmac('sha256', $server->uuid, $node->daemonSecret, true)) {
|
||||
return response()->json([
|
||||
'error' => 'Signed HMAC was invalid.'
|
||||
'error' => 'Signed HMAC was invalid.',
|
||||
], 403);
|
||||
}
|
||||
|
||||
|
@ -79,16 +79,16 @@ class RemoteController extends Controller
|
|||
$server->save();
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Recieved!'
|
||||
'message' => 'Recieved!',
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function event(Request $request)
|
||||
{
|
||||
$server = Models\Server::where('uuid', $request->input('server'))->first();
|
||||
if (!$server) {
|
||||
if (! $server) {
|
||||
return response()->json([
|
||||
'error' => 'No server by that ID was found on the system.'
|
||||
'error' => 'No server by that ID was found on the system.',
|
||||
], 422);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ class RemoteController extends Controller
|
|||
$hmac = $request->input('signed');
|
||||
if (base64_decode($hmac) !== hash_hmac('sha256', $server->uuid, $node->daemonSecret, true)) {
|
||||
return response()->json([
|
||||
'error' => 'Signed HMAC was invalid.'
|
||||
'error' => 'Signed HMAC was invalid.',
|
||||
], 403);
|
||||
}
|
||||
|
||||
|
@ -107,5 +107,4 @@ class RemoteController extends Controller
|
|||
|
||||
return response('', 201);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue