mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-23 19:51:24 +00:00
🤖 Auto commit for release 'develop' on 2025-12-20
This commit is contained in:
@@ -61,25 +61,25 @@ class ConfigurationController extends Controller
|
||||
*
|
||||
* @return Factory|View
|
||||
*/
|
||||
public function index(): Factory | \Illuminate\Contracts\View\View
|
||||
public function index(): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$subTitle = (string)trans('firefly.instance_configuration');
|
||||
$subTitleIcon = 'fa-wrench';
|
||||
$subTitle = (string)trans('firefly.instance_configuration');
|
||||
$subTitleIcon = 'fa-wrench';
|
||||
|
||||
Log::channel('audit')->info('User visits admin config index.');
|
||||
|
||||
// all available configuration and their default value in case
|
||||
// they don't exist yet.
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$siteOwner = config('firefly.site_owner');
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$siteOwner = config('firefly.site_owner');
|
||||
|
||||
$enableExchangeRates = FireflyConfig::get('enable_exchange_rates', config('cer.enabled'))->data;
|
||||
$useRunningBalance = FireflyConfig::get('use_running_balance', config('firefly.feature_flags.running_balance_column'))->data;
|
||||
$enableExternalMap = FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
|
||||
$enableExternalRates = FireflyConfig::get('enable_external_rates', config('cer.download_enabled'))->data;
|
||||
$allowWebhooks = FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data;
|
||||
$validUrlProtocols = FireflyConfig::get('valid_url_protocols', config('firefly.valid_url_protocols'))->data;;
|
||||
$validUrlProtocols = FireflyConfig::get('valid_url_protocols', config('firefly.valid_url_protocols'))->data;
|
||||
|
||||
return view(
|
||||
'settings.configuration.index',
|
||||
|
||||
@@ -42,6 +42,7 @@ use Illuminate\Routing\Redirector;
|
||||
use Illuminate\View\View;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class UserController.
|
||||
@@ -164,7 +165,7 @@ class UserController extends Controller
|
||||
$subTitle = (string) trans('firefly.user_administration');
|
||||
$subTitleIcon = 'fa-users';
|
||||
$users = $this->repository->all();
|
||||
$singleUserMode = (bool) \FireflyIII\Support\Facades\FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$singleUserMode = (bool) FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$allowInvites = false;
|
||||
if (!$this->externalIdentity && $singleUserMode) {
|
||||
// also registration enabled.
|
||||
|
||||
@@ -36,6 +36,7 @@ use Illuminate\View\View;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Safe\Exceptions\UrlException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
use function Safe\parse_url;
|
||||
|
||||
@@ -142,7 +143,7 @@ class ForgotPasswordController extends Controller
|
||||
}
|
||||
|
||||
// is allowed to?
|
||||
$singleUserMode = \FireflyIII\Support\Facades\FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$userCount = User::count();
|
||||
$allowRegistration = true;
|
||||
$pageTitle = (string) trans('firefly.forgot_pw_page_title');
|
||||
|
||||
@@ -50,6 +50,7 @@ use Illuminate\Validation\ValidationException;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Symfony\Component\HttpFoundation\Response as ResponseAlias;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class LoginController
|
||||
@@ -236,7 +237,7 @@ class LoginController extends Controller
|
||||
}
|
||||
|
||||
// is allowed to register, etc.
|
||||
$singleUserMode = \FireflyIII\Support\Facades\FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$allowRegistration = true;
|
||||
$allowReset = true;
|
||||
if (true === $singleUserMode && $count > 0) {
|
||||
|
||||
@@ -41,6 +41,7 @@ use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\View\View;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class RegisterController
|
||||
@@ -121,7 +122,7 @@ class RegisterController extends Controller
|
||||
$allowRegistration = true;
|
||||
|
||||
try {
|
||||
$singleUserMode = \FireflyIII\Support\Facades\FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
} catch (ContainerExceptionInterface|NotFoundExceptionInterface) {
|
||||
$singleUserMode = true;
|
||||
}
|
||||
@@ -148,7 +149,7 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function showInviteForm(Request $request, string $code): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$isDemoSite = \FireflyIII\Support\Facades\FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$pageTitle = (string) trans('firefly.register_page_title');
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
$allowRegistration = $this->allowedToRegister();
|
||||
@@ -182,7 +183,7 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function showRegistrationForm(?Request $request = null): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$isDemoSite = \FireflyIII\Support\Facades\FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$pageTitle = (string) trans('firefly.register_page_title');
|
||||
$allowRegistration = $this->allowedToRegister();
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\View\View;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class ResetPasswordController
|
||||
@@ -131,7 +132,7 @@ class ResetPasswordController extends Controller
|
||||
}
|
||||
|
||||
// is allowed to register?
|
||||
$singleUserMode = \FireflyIII\Support\Facades\FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$userCount = User::count();
|
||||
$allowRegistration = true;
|
||||
$pageTitle = (string) trans('firefly.reset_pw_page_title');
|
||||
|
||||
@@ -38,6 +38,7 @@ use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
use function Safe\ini_get;
|
||||
use function Safe\realpath;
|
||||
@@ -71,7 +72,7 @@ abstract class Controller extends BaseController
|
||||
public function __construct()
|
||||
{
|
||||
// is site a demo site?
|
||||
$isDemoSiteConfig = \FireflyIII\Support\Facades\FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site', false));
|
||||
$isDemoSiteConfig = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site', false));
|
||||
$isDemoSite = (bool) $isDemoSiteConfig->data;
|
||||
View::share('IS_DEMO_SITE', $isDemoSite);
|
||||
View::share('DEMO_USERNAME', config('firefly.demo_username'));
|
||||
@@ -80,7 +81,7 @@ abstract class Controller extends BaseController
|
||||
View::share('FF_BUILD_TIME', config('firefly.build_time'));
|
||||
|
||||
// is webhooks enabled?
|
||||
View::share('featuringWebhooks', true === config('firefly.feature_flags.webhooks') && true === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data);
|
||||
View::share('featuringWebhooks', true === config('firefly.feature_flags.webhooks') && true === FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data);
|
||||
|
||||
// share custom auth guard info.
|
||||
$authGuard = config('firefly.authentication_guard');
|
||||
|
||||
@@ -51,6 +51,7 @@ use Illuminate\View\View;
|
||||
use Monolog\Handler\RotatingFileHandler;
|
||||
use Safe\Exceptions\FilesystemException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
use function Safe\file_get_contents;
|
||||
use function Safe\ini_get;
|
||||
@@ -241,7 +242,7 @@ class DebugController extends Controller
|
||||
{
|
||||
$userGuard = config('auth.defaults.guard');
|
||||
|
||||
$config = \FireflyIII\Support\Facades\FireflyConfig::get('last_rt_job', 0);
|
||||
$config = FireflyConfig::get('last_rt_job', 0);
|
||||
$lastTime = (int) $config->data;
|
||||
$lastCronjob = 'never';
|
||||
$lastCronjobAgo = 'never';
|
||||
|
||||
@@ -28,6 +28,7 @@ use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
class IndexController extends Controller
|
||||
{
|
||||
@@ -47,7 +48,7 @@ class IndexController extends Controller
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('enable_exchange_rates', config('cer.enabled'))->data) {
|
||||
if (false === FireflyConfig::get('enable_exchange_rates', config('cer.enabled'))->data) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ use Illuminate\Http\Request;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Safe\Exceptions\UrlException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
use function Safe\parse_url;
|
||||
|
||||
@@ -140,7 +141,7 @@ class CreateController extends Controller
|
||||
];
|
||||
$optionalFields['external_url'] ??= false;
|
||||
$optionalFields['location'] ??= false;
|
||||
$optionalFields['location'] = $optionalFields['location'] && true === \FireflyIII\Support\Facades\FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
|
||||
$optionalFields['location'] = $optionalFields['location'] && true === FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
|
||||
|
||||
// map info:
|
||||
$longitude = config('firefly.default_location.longitude');
|
||||
|
||||
@@ -38,6 +38,7 @@ use Illuminate\View\View;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Safe\Exceptions\UrlException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
use function Safe\parse_url;
|
||||
|
||||
@@ -114,7 +115,7 @@ class EditController extends Controller
|
||||
];
|
||||
$optionalFields['external_url'] ??= false;
|
||||
$optionalFields['location'] ??= false;
|
||||
$optionalFields['location'] = $optionalFields['location'] && true === \FireflyIII\Support\Facades\FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
|
||||
$optionalFields['location'] = $optionalFields['location'] && true === FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
|
||||
|
||||
// map info voor v2:
|
||||
$longitude = config('firefly.default_location.longitude');
|
||||
|
||||
@@ -29,6 +29,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class CreateController
|
||||
@@ -59,7 +60,7 @@ class CreateController extends Controller
|
||||
*/
|
||||
public function index(): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
if (false === 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.');
|
||||
|
||||
@@ -31,6 +31,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class DeleteController
|
||||
@@ -64,7 +65,7 @@ class DeleteController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook): Factory|View
|
||||
{
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
if (false === 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.');
|
||||
|
||||
@@ -31,6 +31,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class EditController
|
||||
@@ -63,7 +64,7 @@ class EditController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook): Factory|View
|
||||
{
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
if (false === 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.');
|
||||
|
||||
@@ -29,6 +29,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class IndexController
|
||||
@@ -55,7 +56,7 @@ class IndexController extends Controller
|
||||
*/
|
||||
public function index(): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
if (false === 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.');
|
||||
|
||||
@@ -31,6 +31,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
|
||||
/**
|
||||
* Class ShowController
|
||||
@@ -63,7 +64,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook): Factory|View
|
||||
{
|
||||
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
|
||||
if (false === 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