mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Start throwing 404's
This commit is contained in:
@@ -28,6 +28,7 @@ use FireflyIII\Http\Controllers\Controller;
|
|||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CreateController
|
* Class CreateController
|
||||||
@@ -59,6 +60,9 @@ class CreateController extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
Log::channel('audit')->info('User visits webhook create page.');
|
Log::channel('audit')->info('User visits webhook create page.');
|
||||||
|
if(false === config('firefly.allow_webhooks')) {
|
||||||
|
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||||
|
}
|
||||||
$previousUrl = $this->rememberPreviousUrl('webhooks.create.url');
|
$previousUrl = $this->rememberPreviousUrl('webhooks.create.url');
|
||||||
|
|
||||||
return view('webhooks.create', compact('previousUrl'));
|
return view('webhooks.create', compact('previousUrl'));
|
||||||
|
@@ -29,6 +29,7 @@ use Illuminate\Contracts\Foundation\Application;
|
|||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DeleteController
|
* Class DeleteController
|
||||||
@@ -60,9 +61,12 @@ class DeleteController extends Controller
|
|||||||
*
|
*
|
||||||
* @return Application|Factory|View
|
* @return Application|Factory|View
|
||||||
*/
|
*/
|
||||||
public function index(Webhook $webhook)
|
public function index(Webhook $webhook) {
|
||||||
{
|
|
||||||
Log::channel('audit')->info('User visits webhook delete page.');
|
Log::channel('audit')->info('User visits webhook delete page.');
|
||||||
|
if(false === config('firefly.allow_webhooks')) {
|
||||||
|
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||||
|
}
|
||||||
$subTitle = (string)trans('firefly.delete_webhook', ['title' => $webhook->title]);
|
$subTitle = (string)trans('firefly.delete_webhook', ['title' => $webhook->title]);
|
||||||
$this->rememberPreviousUrl('webhooks.delete.url');
|
$this->rememberPreviousUrl('webhooks.delete.url');
|
||||||
|
|
||||||
|
@@ -29,6 +29,7 @@ use Illuminate\Contracts\Foundation\Application;
|
|||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EditController
|
* Class EditController
|
||||||
@@ -62,6 +63,9 @@ class EditController extends Controller
|
|||||||
public function index(Webhook $webhook)
|
public function index(Webhook $webhook)
|
||||||
{
|
{
|
||||||
Log::channel('audit')->info('User visits webhook edit page.');
|
Log::channel('audit')->info('User visits webhook edit page.');
|
||||||
|
if(false === config('firefly.allow_webhooks')) {
|
||||||
|
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||||
|
}
|
||||||
$subTitle = (string)trans('firefly.edit_webhook', ['title' => $webhook->title]);
|
$subTitle = (string)trans('firefly.edit_webhook', ['title' => $webhook->title]);
|
||||||
$this->rememberPreviousUrl('webhooks.edit.url');
|
$this->rememberPreviousUrl('webhooks.edit.url');
|
||||||
|
|
||||||
|
@@ -28,6 +28,7 @@ use FireflyIII\Http\Controllers\Controller;
|
|||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IndexController
|
* Class IndexController
|
||||||
@@ -55,6 +56,9 @@ class IndexController extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
Log::channel('audit')->info('User visits webhook index page.');
|
Log::channel('audit')->info('User visits webhook index page.');
|
||||||
|
if(false === config('firefly.allow_webhooks')) {
|
||||||
|
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||||
|
}
|
||||||
|
|
||||||
return view('webhooks.index');
|
return view('webhooks.index');
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,7 @@ use Illuminate\Contracts\Foundation\Application;
|
|||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ShowController
|
* Class ShowController
|
||||||
@@ -62,6 +63,9 @@ class ShowController extends Controller
|
|||||||
public function index(Webhook $webhook)
|
public function index(Webhook $webhook)
|
||||||
{
|
{
|
||||||
Log::channel('audit')->info(sprintf('User visits webhook #%d page.', $webhook->id));
|
Log::channel('audit')->info(sprintf('User visits webhook #%d page.', $webhook->id));
|
||||||
|
if(false === config('firefly.allow_webhooks')) {
|
||||||
|
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||||
|
}
|
||||||
$subTitle = (string)trans('firefly.show_webhook', ['title' => $webhook->title]);
|
$subTitle = (string)trans('firefly.show_webhook', ['title' => $webhook->title]);
|
||||||
|
|
||||||
return view('webhooks.show', compact('webhook', 'subTitle'));
|
return view('webhooks.show', compact('webhook', 'subTitle'));
|
||||||
|
Reference in New Issue
Block a user