mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-23 03:31:25 +00:00
Replace references to hard coded config with variables.
This commit is contained in:
@@ -59,7 +59,7 @@ class CreateController extends Controller
|
||||
*/
|
||||
public function index(): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
Log::channel('audit')->warning('User visits webhook create page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
||||
@@ -64,7 +64,7 @@ class DeleteController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook): Factory|View
|
||||
{
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
Log::channel('audit')->warning('User visits webhook delete page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
||||
@@ -63,7 +63,7 @@ class EditController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook): Factory|View
|
||||
{
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
Log::channel('audit')->warning('User visits webhook edit page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
||||
@@ -55,7 +55,7 @@ class IndexController extends Controller
|
||||
*/
|
||||
public function index(): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
Log::channel('audit')->warning('User visits webhook index page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
||||
@@ -63,7 +63,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook): Factory|View
|
||||
{
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
Log::channel('audit')->warning(sprintf('User visits webhook #%d page, but webhooks are DISABLED.', $webhook->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
||||
Reference in New Issue
Block a user