Fix error causing tasks to be un-deletable.

closes #786
This commit is contained in:
Dane Everitt 2017-12-01 20:10:06 -06:00
parent 47f2ca0673
commit 20beb2f280
3 changed files with 3 additions and 5 deletions

View File

@ -51,5 +51,5 @@ return PhpCsFixer\Config::create()
'equal' => false,
'identical' => false,
'less_and_greater' => false,
]
],
])->setRiskyAllowed(true)->setFinder($finder);

View File

@ -149,8 +149,6 @@ class TaskManagementController extends Controller
*
* @param \Pterodactyl\Http\Requests\Server\ScheduleCreationFormRequest $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function update(ScheduleCreationFormRequest $request): RedirectResponse
{
@ -177,7 +175,7 @@ class TaskManagementController extends Controller
*/
public function delete(Request $request): Response
{
$server = $request->attributes->get('server_data.model');
$server = $request->attributes->get('server');
$schedule = $request->attributes->get('schedule');
$this->authorize('delete-schedule', $server);

View File

@ -49,7 +49,7 @@ class ScheduleBelongsToServer
$scheduleId = $this->hashids->decodeFirst($request->route()->parameter('schedule'), 0);
$schedule = $this->repository->getScheduleWithTasks($scheduleId);
if (object_get($schedule, 'server_id') !== $server->id) {
if ($schedule->server_id !== $server->id) {
throw new NotFoundHttpException;
}