diff --git a/app/Http/Controllers/AppController.php b/app/Http/Controllers/AppController.php index b799f973eab2..2d3a3c3a3aca 100644 --- a/app/Http/Controllers/AppController.php +++ b/app/Http/Controllers/AppController.php @@ -38,9 +38,9 @@ class AppController extends BaseController public function doSetup() { - // if (Utils::isNinja() || Utils::isDatabaseSetup()) { - // return Redirect::to('/'); - // } + if (Utils::isNinja() || Utils::isDatabaseSetup()) { + return Redirect::to('/'); + } $valid = false; $test = Input::get('test'); diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 9a036ffe4514..55cc619d81d5 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -10,9 +10,6 @@ class DashboardController extends BaseController { public function index() { - // For Debuging : Need to remove when it is not longer needed. - // Auth::login(\App\Models\User::first()); - // dd(Auth::user()); // total_income, billed_clients, invoice_sent and active_clients $select = DB::raw('COUNT(DISTINCT CASE WHEN invoices.id IS NOT NULL THEN clients.id ELSE null END) billed_clients, SUM(CASE WHEN invoices.invoice_status_id >= '.INVOICE_STATUS_SENT.' THEN 1 ELSE 0 END) invoices_sent, diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index c5ee506193e5..0c0c8b4678ff 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -3,9 +3,11 @@ use Auth; use Confide; use Config; +use Event; use Input; use View; use Redirect; +use Session; use App\Http\Requests; use App\Http\Controllers\Controller; @@ -257,6 +259,8 @@ class UserController extends BaseController */ public function login() { + + // Auth::login(\App\Models\User::first()); // Debug purposes only // Show Login | If not already logged in if (!Confide::user()) { return View::make(Config::get('confide.login_form')); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 72a7613af681..1780b299f005 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -40,7 +40,7 @@ class Authenticate { } else { - return redirect()->guest('auth/login'); + return redirect()->guest('/login'); } } diff --git a/app/Http/routes.php b/app/Http/routes.php index 828e94b75d4a..64a08a67e77c 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -70,7 +70,7 @@ if (\App\Libraries\Utils::isNinja()) { Route::get('/demo', 'AccountController@demo'); } -Route::group(array('before' => 'auth'), function() { +Route::group(array('middleware' => 'auth'), function() { Route::get('dashboard', 'DashboardController@index'); Route::get('view_archive/{entity_type}/{visible}', 'AccountController@setTrashVisible'); Route::get('hide_message', 'HomeController@hideMessage');