diff --git a/app/Http/Controllers/Import/IndexController.php b/app/Http/Controllers/Import/IndexController.php index 361d81b490..8ddf08856d 100644 --- a/app/Http/Controllers/Import/IndexController.php +++ b/app/Http/Controllers/Import/IndexController.php @@ -168,22 +168,22 @@ class IndexController extends Controller $isDemoUser = $this->userRepository->hasRole(auth()->user(), 'demo'); $isDebug = (bool)config('app.debug'); foreach ($providerNames as $providerName) { - Log::debug(sprintf('Now with provider %s', $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 ($enabled === false) { - Log::debug('Provider is not enabled. NEXT!'); + //Log::debug('Provider is not enabled. NEXT!'); continue; } if ($isDemoUser === true && $allowedForDemo === false) { - Log::debug('User is demo and this provider is not allowed for demo user. NEXT!'); + //Log::debug('User is demo and this provider is not allowed for demo user. NEXT!'); continue; } if ($isDemoUser === false && $allowedForUser === false && $isDebug === false) { - Log::debug('User is not demo and this provider is not allowed for such users. NEXT!'); + //Log::debug('User is not demo and this provider is not allowed for such users. NEXT!'); continue; } @@ -194,7 +194,7 @@ class IndexController extends Controller $class = (string)config(sprintf('import.prerequisites.%s', $providerName)); $result = false; if ($class !== '' && class_exists($class)) { - Log::debug('Will not check prerequisites.'); + //Log::debug('Will not check prerequisites.'); /** @var PrerequisitesInterface $object */ $object = app($class); $object->setUser(auth()->user()); @@ -202,6 +202,7 @@ class IndexController extends Controller } $providers[$providerName]['prereq_complete'] = $result; } + Log::debug(sprintf('Enabled providers: %s', json_encode(array_keys($providers)))); return $providers; } diff --git a/app/Http/Controllers/Import/JobConfigurationController.php b/app/Http/Controllers/Import/JobConfigurationController.php index 518072703b..2273cf0cbc 100644 --- a/app/Http/Controllers/Import/JobConfigurationController.php +++ b/app/Http/Controllers/Import/JobConfigurationController.php @@ -24,7 +24,6 @@ namespace FireflyIII\Http\Controllers\Import; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; -use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Import\JobConfiguration\JobConfigurationInterface; use FireflyIII\Models\ImportJob; use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface; @@ -57,7 +56,6 @@ class JobConfigurationController extends Controller return $next($request); } ); - $this->middleware(IsDemoUser::class); } /** @@ -71,9 +69,11 @@ class JobConfigurationController extends Controller */ public function index(ImportJob $importJob) { + Log::debug('Now in JobConfigurationController::index()'); // catch impossible status: $allowed = ['has_prereq', 'need_job_config']; if (null !== $importJob && !\in_array($importJob->status, $allowed, true)) { + Log::debug(sprintf('Job has state "%s", but we only accept %s', $importJob->status, json_encode($allowed))); session()->flash('error', trans('import.bad_job_status', ['status' => $importJob->status])); return redirect(route('import.index')); diff --git a/app/Http/Controllers/Import/JobStatusController.php b/app/Http/Controllers/Import/JobStatusController.php index bbfaed422a..081e59591e 100644 --- a/app/Http/Controllers/Import/JobStatusController.php +++ b/app/Http/Controllers/Import/JobStatusController.php @@ -25,7 +25,6 @@ namespace FireflyIII\Http\Controllers\Import; use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; -use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Import\Routine\RoutineInterface; use FireflyIII\Import\Storage\ImportArrayStorage; use FireflyIII\Models\ImportJob; @@ -57,7 +56,6 @@ class JobStatusController extends Controller return $next($request); } ); - $this->middleware(IsDemoUser::class); } /** @@ -172,7 +170,9 @@ class JobStatusController extends Controller if (null !== $importJob && !\in_array($importJob->status, $allowed, true)) { Log::error('Job is not ready.'); - return response()->json(['status' => 'NOK', 'message' => sprintf('JobStatusController::start expects status "provider_finished" instead of "%s".', $importJob->status)]); + return response()->json( + ['status' => 'NOK', 'message' => sprintf('JobStatusController::start expects status "provider_finished" instead of "%s".', $importJob->status)] + ); } // set job to be storing data: