diff --git a/app/Http/Controllers/Admin/DatabaseController.php b/app/Http/Controllers/Admin/DatabaseController.php index 777b27792..4fecbbccf 100644 --- a/app/Http/Controllers/Admin/DatabaseController.php +++ b/app/Http/Controllers/Admin/DatabaseController.php @@ -131,7 +131,7 @@ class DatabaseController extends Controller sprintf('There was an error while trying to connect to the host or while executing a query: "%s"', $exception->getMessage()) )->flash(); - redirect()->route('admin.databases')->withInput($request->validated()); + return redirect()->route('admin.databases')->withInput($request->validated()); } else { throw $exception; } @@ -165,7 +165,7 @@ class DatabaseController extends Controller $this->alert->danger( sprintf('There was an error while trying to connect to the host or while executing a query: "%s"', $exception->getMessage()) )->flash(); - $redirect->withInput($request->normalize()); + return $redirect->withInput($request->normalize()); } else { throw $exception; } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index c18b004b4..d5141c8d2 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -20,8 +20,6 @@ class LoginController extends Controller { use AuthenticatesUsers; - const USER_INPUT_FIELD = 'user'; - /** * @var \Illuminate\Auth\AuthManager */ @@ -64,14 +62,14 @@ class LoginController extends Controller * * @var int */ - protected $lockoutTime; + protected $decayMinutes; /** * After how many attempts should logins be throttled and locked. * * @var int */ - protected $maxLoginAttempts; + protected $maxAttempts; /** * LoginController constructor. @@ -98,8 +96,8 @@ class LoginController extends Controller $this->google2FA = $google2FA; $this->repository = $repository; - $this->lockoutTime = $this->config->get('auth.lockout.time'); - $this->maxLoginAttempts = $this->config->get('auth.lockout.attempts'); + $this->decayMinutes = $this->config->get('auth.lockout.time'); + $this->maxAttempts = $this->config->get('auth.lockout.attempts'); } /** @@ -112,7 +110,7 @@ class LoginController extends Controller */ public function login(Request $request) { - $username = $request->input(self::USER_INPUT_FIELD); + $username = $request->input($this->username()); $useColumn = $this->getField($username); if ($this->hasTooManyLoginAttempts($request)) { @@ -209,20 +207,30 @@ class LoginController extends Controller { $this->incrementLoginAttempts($request); $this->fireFailedLoginEvent($user, [ - $this->getField($request->input(self::USER_INPUT_FIELD)) => $request->input(self::USER_INPUT_FIELD), + $this->getField($request->input($this->username())) => $request->input($this->username()), ]); - $errors = [self::USER_INPUT_FIELD => trans('auth.failed')]; + $errors = [$this->username() => trans('auth.failed')]; if ($request->expectsJson()) { return response()->json($errors, 422); } return redirect()->route('auth.login') - ->withInput($request->only(self::USER_INPUT_FIELD)) + ->withInput($request->only($this->username())) ->withErrors($errors); } + /** + * Get the login username to be used by the controller. + * + * @return string + */ + public function username() + { + return 'user'; + } + /** * Determine if the user is logging in using an email or username,. * diff --git a/app/Services/Nests/NestDeletionService.php b/app/Services/Nests/NestDeletionService.php index 6bdaf8de2..0f01a5e58 100644 --- a/app/Services/Nests/NestDeletionService.php +++ b/app/Services/Nests/NestDeletionService.php @@ -51,7 +51,7 @@ class NestDeletionService { $count = $this->serverRepository->findCountWhere([['nest_id', '=', $nest]]); if ($count > 0) { - throw new HasActiveServersException(trans('exceptions.service.delete_has_servers')); + throw new HasActiveServersException(trans('exceptions.nest.delete_has_servers')); } return $this->repository->delete($nest); diff --git a/config/auth.php b/config/auth.php index e83406286..02f4807e4 100644 --- a/config/auth.php +++ b/config/auth.php @@ -12,7 +12,7 @@ return [ | */ 'lockout' => [ - 'time' => 120, + 'time' => 2, 'attempts' => 3, ], diff --git a/resources/themes/pterodactyl/admin/nodes/new.blade.php b/resources/themes/pterodactyl/admin/nodes/new.blade.php index 94ecb609f..eff033265 100644 --- a/resources/themes/pterodactyl/admin/nodes/new.blade.php +++ b/resources/themes/pterodactyl/admin/nodes/new.blade.php @@ -106,7 +106,7 @@
-
+

Enter the directory where server files should be stored. If you use OVH you should check your partition scheme. You may need to use /home/daemon-data to have enough space.

@@ -177,4 +177,4 @@ -@endsection \ No newline at end of file +@endsection diff --git a/resources/themes/pterodactyl/server/files/list.blade.php b/resources/themes/pterodactyl/server/files/list.blade.php index f8abc5a7b..e6a252e5f 100644 --- a/resources/themes/pterodactyl/server/files/list.blade.php +++ b/resources/themes/pterodactyl/server/files/list.blade.php @@ -141,7 +141,7 @@ @if(in_array($file['mime'], $editableMime)) @can('edit-files', $server) - {{ $file['entry'] }} + {{ $file['entry'] }} @else {{ $file['entry'] }} @endcan diff --git a/tests/Unit/Services/Nests/NestDeletionServiceTest.php b/tests/Unit/Services/Nests/NestDeletionServiceTest.php index 28fcc7517..29fd9d559 100644 --- a/tests/Unit/Services/Nests/NestDeletionServiceTest.php +++ b/tests/Unit/Services/Nests/NestDeletionServiceTest.php @@ -73,7 +73,7 @@ class NestDeletionServiceTest extends TestCase $this->service->handle(1); } catch (PterodactylException $exception) { $this->assertInstanceOf(HasActiveServersException::class, $exception); - $this->assertEquals(trans('exceptions.service.delete_has_servers'), $exception->getMessage()); + $this->assertEquals(trans('exceptions.nest.delete_has_servers'), $exception->getMessage()); } }