Clarify error messaging for transfers
This commit is contained in:
parent
a2548c14ac
commit
6c39288def
|
@ -7,8 +7,11 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
|
||||||
class ServerTransferringException extends HttpException
|
class ServerTransferringException extends HttpException
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* ServerTransferringException constructor.
|
||||||
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(Response::HTTP_CONFLICT, 'Server is currently being transferred.');
|
parent::__construct(Response::HTTP_CONFLICT, 'This server is currently being transferred to a new machine, please try again laster.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ class SftpAuthenticationController extends Controller
|
||||||
|
|
||||||
// Prevent SFTP access to servers that are being transferred.
|
// Prevent SFTP access to servers that are being transferred.
|
||||||
if (! is_null($server->transfer)) {
|
if (! is_null($server->transfer)) {
|
||||||
throw new ServerTransferringException();
|
throw new ServerTransferringException;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remember, for security purposes, only reveal the existence of the server to people that
|
// Remember, for security purposes, only reveal the existence of the server to people that
|
||||||
|
|
|
@ -82,7 +82,7 @@ class AuthenticateServerAccess
|
||||||
|
|
||||||
if (! is_null($server->transfer)) {
|
if (! is_null($server->transfer)) {
|
||||||
if (! $user->root_admin || ($user->root_admin && ! $request->routeIs($this->except))) {
|
if (! $user->root_admin || ($user->root_admin && ! $request->routeIs($this->except))) {
|
||||||
throw new ServerTransferringException();
|
throw new ServerTransferringException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ class AccessingValidServer
|
||||||
|
|
||||||
if (! is_null($server->transfer)) {
|
if (! is_null($server->transfer)) {
|
||||||
if ($isApiRequest) {
|
if ($isApiRequest) {
|
||||||
throw new ServerTransferringException();
|
throw new ServerTransferringException;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response->view('errors.transferring', [], 409);
|
return $this->response->view('errors.transferring', [], 409);
|
||||||
|
|
|
@ -60,7 +60,7 @@ class SuspensionService
|
||||||
|
|
||||||
// Check if the server is currently being transferred.
|
// Check if the server is currently being transferred.
|
||||||
if (! is_null($server->transfer)) {
|
if (! is_null($server->transfer)) {
|
||||||
throw new ServerTransferringException();
|
throw new ServerTransferringException;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->connection->transaction(function () use ($action, $server) {
|
$this->connection->transaction(function () use ($action, $server) {
|
||||||
|
|
Loading…
Reference in New Issue