mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 19:53:44 +00:00
Add lots of audit logs.
This commit is contained in:
@@ -31,6 +31,7 @@ use FireflyIII\Models\WebhookAttempt;
|
||||
use FireflyIII\Models\WebhookMessage;
|
||||
use FireflyIII\Repositories\Webhook\WebhookRepositoryInterface;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class DestroyController
|
||||
@@ -60,6 +61,7 @@ class DestroyController extends Controller
|
||||
*/
|
||||
public function destroy(Webhook $webhook): JsonResponse
|
||||
{
|
||||
Log::channel('audit')->info(sprintf('User destroys webhook #%d.', $webhook->id));
|
||||
$this->repository->destroy($webhook);
|
||||
app('preferences')->mark();
|
||||
|
||||
@@ -82,6 +84,7 @@ class DestroyController extends Controller
|
||||
if ($attempt->webhook_message_id !== $message->id) {
|
||||
throw new FireflyException('200041: Webhook message and webhook attempt are no match');
|
||||
}
|
||||
Log::channel('audit')->info(sprintf('User destroys webhook #%d, message #%d, attempt #%d.', $webhook->id, $message->id, $attempt->id));
|
||||
|
||||
$this->repository->destroyAttempt($attempt);
|
||||
app('preferences')->mark();
|
||||
@@ -99,6 +102,7 @@ class DestroyController extends Controller
|
||||
*/
|
||||
public function destroyMessage(Webhook $webhook, WebhookMessage $message): JsonResponse
|
||||
{
|
||||
Log::channel('audit')->info(sprintf('User destroys webhook #%d, message #%d.', $webhook->id, $message->id));
|
||||
if ($message->webhook_id !== $webhook->id) {
|
||||
throw new FireflyException('200040: Webhook and webhook message are no match');
|
||||
}
|
||||
|
Reference in New Issue
Block a user