diff --git a/app/Http/Controllers/Server/AjaxController.php b/app/Http/Controllers/Server/AjaxController.php index 8f3736da7..4609ae270 100644 --- a/app/Http/Controllers/Server/AjaxController.php +++ b/app/Http/Controllers/Server/AjaxController.php @@ -224,17 +224,16 @@ class AjaxController extends Controller $server = Models\Server::byUuid($uuid); $this->authorize('reset-db-password', $server); - $database = Models\Database::where('id', $request->input('database'))->where('server_id', $server->id)->firstOrFail(); + $database = Models\Database::where('server_id', $server->id)->findOrFail($request->input('database')); + $repo = new Repositories\DatabaseRepository; + try { - $repo = new Repositories\DatabaseRepository; - $password = str_random(16); - $repo->modifyPassword($request->input('database'), $password); + $password = str_random(20); + $repo->password($database->id, $password); return response($password); - } catch (\Pterodactyl\Exceptions\DisplayException $ex) { - return response()->json([ - 'error' => $ex->getMessage(), - ], 503); + } catch (DisplayException $ex) { + return response()->json(['error' => $ex->getMessage()], 503); } catch (\Exception $ex) { Log::error($ex); diff --git a/public/themes/pterodactyl/css/pterodactyl.css b/public/themes/pterodactyl/css/pterodactyl.css index c4b1cf256..ca34e46a5 100644 --- a/public/themes/pterodactyl/css/pterodactyl.css +++ b/public/themes/pterodactyl/css/pterodactyl.css @@ -65,7 +65,7 @@ code { font-size: 14px !important; } -.middle { +.middle, .align-middle { vertical-align: middle !important; } diff --git a/resources/themes/pterodactyl/server/settings/databases.blade.php b/resources/themes/pterodactyl/server/settings/databases.blade.php index b69b0f36d..5e90be84f 100644 --- a/resources/themes/pterodactyl/server/settings/databases.blade.php +++ b/resources/themes/pterodactyl/server/settings/databases.blade.php @@ -49,17 +49,19 @@
{{ Crypt::decrypt($database->password) }}
- @can('reset-db-password', $server)
-
- @endcan
- {{ $database->a_host }}:{{ $database->a_port }}
{{ Crypt::decrypt($database->password) }}
{{ $database->a_host }}:{{ $database->a_port }}