Minor bug fixes

This commit is contained in:
Dane Everitt 2017-09-30 11:45:24 -05:00
parent 28d838eccd
commit 048784607d
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
3 changed files with 7 additions and 4 deletions

View File

@ -40,7 +40,7 @@ class SubuserAccess
} }
/** /**
* Determine if a user has permission to access a subuser. * Determine if a user has permission to access and modify subuser.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Closure $next * @param \Closure $next

View File

@ -19,6 +19,7 @@ use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Bus\DispatchesJobs;
use Pterodactyl\Contracts\Repository\TaskRepositoryInterface; use Pterodactyl\Contracts\Repository\TaskRepositoryInterface;
use Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService;
use Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface; use Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface;
use Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface;
use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface;
@ -71,6 +72,7 @@ class RunTaskJob extends Job implements ShouldQueue
* Run the job and send actions to the daemon running the server. * Run the job and send actions to the daemon running the server.
* *
* @param \Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface $commandRepository * @param \Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface $commandRepository
* @param \Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService $keyProviderService
* @param \Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface $powerRepository * @param \Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface $powerRepository
* @param \Pterodactyl\Contracts\Repository\TaskRepositoryInterface $taskRepository * @param \Pterodactyl\Contracts\Repository\TaskRepositoryInterface $taskRepository
* *
@ -80,6 +82,7 @@ class RunTaskJob extends Job implements ShouldQueue
*/ */
public function handle( public function handle(
CommandRepositoryInterface $commandRepository, CommandRepositoryInterface $commandRepository,
DaemonKeyProviderService $keyProviderService,
PowerRepositoryInterface $powerRepository, PowerRepositoryInterface $powerRepository,
TaskRepositoryInterface $taskRepository TaskRepositoryInterface $taskRepository
) { ) {
@ -95,13 +98,13 @@ class RunTaskJob extends Job implements ShouldQueue
case 'power': case 'power':
$this->powerRepository->setNode($server->node_id) $this->powerRepository->setNode($server->node_id)
->setAccessServer($server->uuid) ->setAccessServer($server->uuid)
->setAccessToken($server->accessToken->secret) ->setAccessToken($keyProviderService->handle($server->id, $server->owner_id))
->sendSignal($task->payload); ->sendSignal($task->payload);
break; break;
case 'command': case 'command':
$this->commandRepository->setNode($server->node_id) $this->commandRepository->setNode($server->node_id)
->setAccessServer($server->uuid) ->setAccessServer($server->uuid)
->setAccessToken($server->accessToken->secret) ->setAccessToken($keyProviderService->handle($server->id, $server->owner_id))
->send($task->payload); ->send($task->payload);
break; break;
default: default:

View File

@ -131,7 +131,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
*/ */
public function details() public function details()
{ {
return $this->getHttpClient()->request('GET', '/servers'); return $this->getHttpClient()->request('GET', '/server');
} }
/** /**