1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Merge branch 'auth' of git://github.com/benrubson/BookStack into benrubson-auth

This commit is contained in:
Dan Brown
2020-07-28 10:46:40 +01:00
4 changed files with 36 additions and 1 deletions

View File

@@ -159,4 +159,21 @@ class ActivityService
session()->flash('success', $message);
}
}
/**
* Log failed accesses, for further processing by tools like Fail2Ban
*
* @param username
* @return void
*/
public function logFailedAccess($username)
{
$log_msg = config('logging.failed_access_message');
if (!is_string($username) || !is_string($log_msg) || strlen($log_msg)<1)
return;
$log_msg = str_replace("%u", $username, $log_msg);
error_log($log_msg, 4);
}
}