diff --git a/app/Http/Controllers/Install/Updates.php b/app/Http/Controllers/Install/Updates.php index 340ecedc8..740f25555 100644 --- a/app/Http/Controllers/Install/Updates.php +++ b/app/Http/Controllers/Install/Updates.php @@ -6,10 +6,26 @@ use App\Http\Controllers\Controller; use App\Models\Module\Module as Model; use App\Utilities\Updater; use App\Utilities\Versions; +use Illuminate\Routing\Route; use Module; class Updates extends Controller { + + /** + * Instantiate a new controller instance. + * + * @param Route $route + */ + public function __construct(Route $route) + { + if (!setting('general.api_token')) { + return redirect('modules/token/create')->send(); + } + + parent::__construct($route); + } + /** * Show the form for creating a new resource. * @@ -56,6 +72,24 @@ class Updates extends Controller return Versions::changelog(); } + /** + * Check for updates. + * + * @return Response + */ + public function check() + { + // Clear cache in order to check for updates + Updater::clear(); + + return redirect()->back(); + } + + /** + * Update the core or modules. + * + * @return Response + */ public function update($alias, $version) { set_time_limit(600); // 10 minutes diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index a056797c9..6759e3e2c 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -92,6 +92,7 @@ return [ 'help' => 'Help', 'all' => 'All', 'upcoming' => 'Upcoming', + 'created' => 'Created', 'title' => [ 'new' => 'New :type', diff --git a/resources/lang/en-GB/updates.php b/resources/lang/en-GB/updates.php index f2afb339a..bfcdd24e8 100644 --- a/resources/lang/en-GB/updates.php +++ b/resources/lang/en-GB/updates.php @@ -6,6 +6,7 @@ return [ 'latest_version' => 'Latest Version', 'update' => 'Update Akaunting to :version version', 'changelog' => 'Changelog', + 'check' => 'Check', 'new_core' => 'An updated version of Akaunting is available.', 'latest_core' => 'Congratulations! You have the latest version of Akaunting. Future security updates will be applied automatically.', diff --git a/resources/views/companies/companies/index.blade.php b/resources/views/companies/companies/index.blade.php index 3a2116e13..87023aee6 100644 --- a/resources/views/companies/companies/index.blade.php +++ b/resources/views/companies/companies/index.blade.php @@ -35,7 +35,7 @@