From: benrubson Date: Sat, 23 May 2020 10:06:37 +0000 (+0200) Subject: Properly use env/config functions X-Git-Tag: v0.30.0~1^2~4^2~12^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/8f1f73defa321f026d487b3e9344055746bc6f58 Properly use env/config functions --- diff --git a/app/Config/logging.php b/app/Config/logging.php index 0b55dc24d..406b9f2f9 100644 --- a/app/Config/logging.php +++ b/app/Config/logging.php @@ -79,4 +79,9 @@ return [ ], ], + // Failed Access Message + // Defines the message to log into webserver logs in case of failed access, + // for further processing by tools like Fail2Ban. + 'failed_access_message' => env('FAILED_ACCESS_MESSAGE', ''), + ]; diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index c000af49e..cf9e44e43 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -176,7 +176,7 @@ class LoginController extends Controller */ protected function logFailedAccess($request) { - $log_msg = env('FAILED_ACCESS_MESSAGE', ''); + $log_msg = config('logging.failed_access_message'); if (!is_string($request->get($this->username())) || !is_string($log_msg) || strlen($log_msg)<1) return;