parent
49dd719117
commit
28f7a809a5
3 changed files with 5 additions and 3 deletions
|
@ -127,7 +127,7 @@ class UserController extends Controller
|
||||||
public function delete(Request $request, User $user)
|
public function delete(Request $request, User $user)
|
||||||
{
|
{
|
||||||
if ($request->user()->id === $user->id) {
|
if ($request->user()->id === $user->id) {
|
||||||
throw new DisplayException($this->translator->trans('admin/user.exceptions.user_has_servers'));
|
throw new DisplayException($this->translator->get('admin/user.exceptions.user_has_servers'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->deletionService->handle($user);
|
$this->deletionService->handle($user);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pterodactyl - Panel
|
* Pterodactyl - Panel
|
||||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||||
|
@ -62,7 +63,7 @@ class NodeDeletionService
|
||||||
|
|
||||||
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['node_id', '=', $node]]);
|
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['node_id', '=', $node]]);
|
||||||
if ($servers > 0) {
|
if ($servers > 0) {
|
||||||
throw new HasActiveServersException($this->translator->trans('exceptions.node.servers_attached'));
|
throw new HasActiveServersException($this->translator->get('exceptions.node.servers_attached'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->repository->delete($node);
|
return $this->repository->delete($node);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pterodactyl - Panel
|
* Pterodactyl - Panel
|
||||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||||
|
@ -62,7 +63,7 @@ class UserDeletionService
|
||||||
|
|
||||||
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['owner_id', '=', $user]]);
|
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['owner_id', '=', $user]]);
|
||||||
if ($servers > 0) {
|
if ($servers > 0) {
|
||||||
throw new DisplayException($this->translator->trans('admin/user.exceptions.user_has_servers'));
|
throw new DisplayException($this->translator->get('admin/user.exceptions.user_has_servers'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->repository->delete($user);
|
return $this->repository->delete($user);
|
||||||
|
|
Loading…
Reference in a new issue