mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 10:53:31 +00:00
Various bugfixes and code clean up.
This commit is contained in:
@@ -66,22 +66,18 @@ class ImportProvider implements BinderInterface
|
||||
$isDemoUser = $repository->hasRole($user, 'demo');
|
||||
$isDebug = (bool)config('app.debug');
|
||||
foreach ($providerNames as $providerName) {
|
||||
//Log::debug(sprintf('Now with provider %s', $providerName));
|
||||
// only consider enabled providers
|
||||
$enabled = (bool)config(sprintf('import.enabled.%s', $providerName));
|
||||
$allowedForDemo = (bool)config(sprintf('import.allowed_for_demo.%s', $providerName));
|
||||
$allowedForUser = (bool)config(sprintf('import.allowed_for_user.%s', $providerName));
|
||||
if (false === $enabled) {
|
||||
//Log::debug('Provider is not enabled. NEXT!');
|
||||
continue;
|
||||
}
|
||||
|
||||
if (true === $isDemoUser && false === $allowedForDemo) {
|
||||
//Log::debug('User is demo and this provider is not allowed for demo user. NEXT!');
|
||||
continue;
|
||||
}
|
||||
if (false === $isDemoUser && false === $allowedForUser && false === $isDebug) {
|
||||
//Log::debug('User is not demo and this provider is not allowed for such users. NEXT!');
|
||||
continue; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
@@ -28,8 +28,11 @@ use Illuminate\Support\Facades\Facade;
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Class FireflyConfig.
|
||||
* @method ?Configuration get($name, $default = null)
|
||||
* @method null|Configuration get($name, $default = null)
|
||||
* @method Configuration set(string $name, $value)
|
||||
* @method delete(string $name)
|
||||
* @method Configuration|null getFresh(string $name, $default = null)
|
||||
* @method Configuration put(string $name, $value)
|
||||
*/
|
||||
class FireflyConfig extends Facade
|
||||
{
|
||||
|
@@ -34,7 +34,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
* @method Collection beginsWith(User $user, string $search)
|
||||
* @method bool delete(string $name)
|
||||
* @method Collection findByName(string $name)
|
||||
* @method Preference get(string $name, $value)
|
||||
* @method Preference get(string $name, $value = null)
|
||||
* @method array getArrayForUser(User $user, array $list)
|
||||
* @method Preference|null getForUser(User $user, string $name, $default = null)
|
||||
* @method string lastActivity()
|
||||
|
@@ -55,7 +55,7 @@ class FireflyConfig
|
||||
*
|
||||
* @return \FireflyIII\Models\Configuration|null
|
||||
*/
|
||||
public function get(string $name, $default = null): ?Configuration
|
||||
public function get(string $name, $default = null): ?Configuration
|
||||
{
|
||||
$fullName = 'ff-config-' . $name;
|
||||
if (Cache::has($fullName)) {
|
||||
|
@@ -63,7 +63,6 @@ class ConfigureRolesHandler implements FileConfigurationInterface
|
||||
{
|
||||
/** @var array $roles */
|
||||
$roles = $config['column-roles'];
|
||||
$count = $config['column-count'];
|
||||
$assigned = 0;
|
||||
|
||||
// check if data actually contains amount column (foreign amount does not count)
|
||||
|
Reference in New Issue
Block a user