diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index d394e870bd..9f8ede9be1 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -241,7 +241,6 @@ class Import implements ShouldQueue $this->company->account->companies()->update(['is_large' => true]); } - $this->company->client_registration_fields = \App\DataMapper\ClientRegistrationFields::generate(); $this->company->save(); diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index 3cb6dd1612..b5b64f20a5 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -81,9 +81,31 @@ class SystemHealth 'pdf_engine' => (string) self::getPdfEngine(), 'queue' => (string) config('queue.default'), 'trailing_slash' => (bool) self::checkUrlState(), + 'file_permissions' => (string) self::checkFileSystem() ]; } + public static function checkFileSystem() + { + + $directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS); + + foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) { + + if(strpos($file->getPathname(), '.git') !== false) + continue; + + //nlog($file->getPathname()); + + if ($file->isFile() && ! $file->isWritable()) { + return "{$file->getFileName()} is not writable"; + } + } + + return 'Ok'; + + } + public static function checkUrlState() { if (env('APP_URL') && substr(env('APP_URL'), -1) == '/')