diff --git a/app/filters.php b/app/filters.php index 6492b4a0..58f2c2d1 100644 --- a/app/filters.php +++ b/app/filters.php @@ -1,6 +1,7 @@ first(); + if (!$setting->value) { + return Redirect::to('setup'); + } + } catch (Exception $e) { + return Redirect::to('setup'); + } + } +} diff --git a/app/routes/app.php b/app/routes/app.php index f1e160b8..6afe4eac 100644 --- a/app/routes/app.php +++ b/app/routes/app.php @@ -1,7 +1,13 @@ 'has_setting:app_name'], function() { + Route::get('/', 'HomeController@showIndex'); + Route::get('/incident/{incident}', 'HomeController@showIncident'); + + Route::get('/auth/login', 'AuthController@showLogin')->before('guest'); + Route::post('/auth/login', 'AuthController@postLogin')->before('guest|csrf'); +}); Route::group(['before' => 'no_setup:app_name'], function() { Route::get('/setup', 'SetupController@showSetup'); @@ -10,9 +16,6 @@ Route::group(['before' => 'no_setup:app_name'], function() { }); }); -Route::get('/auth/login', 'AuthController@showLogin')->before('guest'); -Route::post('/auth/login', 'AuthController@postLogin')->before('guest|csrf'); - Route::group(['before' => 'auth'], function() { // Dashboard/Management Panel etc. Route::get('/dashboard', 'DashboardController@showDashboard');