diff --git a/VERSION.txt b/VERSION.txt index c554ea8c958d..3172f4f92dd6 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.1.56 \ No newline at end of file +5.1.57 \ No newline at end of file diff --git a/app/Console/Commands/PostUpdate.php b/app/Console/Commands/PostUpdate.php index fb6a014613d1..64f7adb29746 100644 --- a/app/Console/Commands/PostUpdate.php +++ b/app/Console/Commands/PostUpdate.php @@ -42,12 +42,12 @@ class PostUpdate extends Command { set_time_limit(0); - nlog('running post update'); + info('running post update'); try { Artisan::call('migrate', ['--force' => true]); } catch (\Exception $e) { - nlog("I wasn't able to migrate the data."); + info("I wasn't able to migrate the data."); } nlog("finished migrating"); @@ -56,35 +56,28 @@ class PostUpdate extends Command exec('vendor/bin/composer install --no-dev -o', $output); - info(print_r($output,1)); - - nlog($output); - - nlog("finished running composer install "); - + info(print_r($output,1)); + info("finished running composer install "); try { Artisan::call('optimize'); } catch (\Exception $e) { - nlog("I wasn't able to optimize."); + info("I wasn't able to optimize."); } - nlog("optimized"); + info("optimized"); try { Artisan::call('view:clear'); } catch (\Exception $e) { - nlog("I wasn't able to clear the views."); + info("I wasn't able to clear the views."); } - nlog("view cleared"); - - /* For the following to work, the web user (www-data) must own all the directories */ + info("view cleared"); VersionCheck::dispatch(); - nlog("sent for version check"); + info("Sent for version check"); - // echo "Done."; } } diff --git a/app/Http/Controllers/LogoutController.php b/app/Http/Controllers/LogoutController.php index eda0c48d991c..b49fa716abca 100644 --- a/app/Http/Controllers/LogoutController.php +++ b/app/Http/Controllers/LogoutController.php @@ -59,9 +59,11 @@ class LogoutController extends BaseController */ public function index(Request $request) { - CompanyToken::with('company') + $ct = CompanyToken::with('company.tokens') ->whereRaw('BINARY `token`= ?', [$request->header('X-API-TOKEN')]) - ->company + ->first(); + + $ct->company ->tokens() ->where('is_system', true) ->forceDelete(); diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 70e3e03698a9..cb3bcb1eff7c 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -62,21 +62,16 @@ class SelfUpdateController extends BaseController return response()->json(['message' => ctrans('texts.self_update_not_available')], 403); } - if(!$this->testWritable()) - throw new FilePermissionsFailure('Cannot update system because files are not writable!'); + $this->testWritable(); - // Check if new version is available - //if($updater->source()->isNewVersionAvailable()) { + // Get the new version available + $versionAvailable = $updater->source()->getVersionAvailable(); - // Get the new version available - $versionAvailable = $updater->source()->getVersionAvailable(); + // Create a release + $release = $updater->source()->fetch($versionAvailable); - // Create a release - $release = $updater->source()->fetch($versionAvailable); + $updater->source()->update($release); - $updater->source()->update($release); - - //} $cacheCompiled = base_path('bootstrap/cache/compiled.php'); if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); } @@ -105,7 +100,9 @@ class SelfUpdateController extends BaseController // nlog($file->getPathname()); if ($file->isFile() && ! $file->isWritable()) { - throw new FilePermissionsFailure($file); + // throw new FilePermissionsFailure($file); + nlog("Cannot update system because {$file->getFileName()} is not writable"); + throw new FilePermissionsFailure("Cannot update system because {$file->getFileName()} is not writable"); return false; } } diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 4bbbd63eba7b..6958204ca92b 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -284,18 +284,17 @@ class SetupController extends Controller if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); } + $cacheServices = base_path('bootstrap/cache/services.php'); if (file_exists($cacheServices)) { unlink ($cacheServices); } Artisan::call('clear-compiled'); - Artisan::call('cache:clear'); - Artisan::call('debugbar:clear'); Artisan::call('route:clear'); Artisan::call('view:clear'); Artisan::call('config:clear'); - Cache::flush(); + Artisan::call('migrate', ['--force' => true]); Artisan::call('db:seed', ['--force' => true]); diff --git a/app/Jobs/Util/VersionCheck.php b/app/Jobs/Util/VersionCheck.php index 8348b984f6e1..56c6ea952238 100644 --- a/app/Jobs/Util/VersionCheck.php +++ b/app/Jobs/Util/VersionCheck.php @@ -46,6 +46,9 @@ class VersionCheck implements ShouldQueue { $account = Account::first(); + if(!$account) + return; + if($account->plan == 'white_label' && $account->plan_expires->lt(now())){ $account->plan = null; $account->plan_expires = null; diff --git a/config/ninja.php b/config/ninja.php index ac6696c0f031..ebf67f544610 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.1.56', - 'app_tag' => '5.1.56-release', + 'app_version' => '5.1.57', + 'app_tag' => '5.1.57-release', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false),