diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index e018002bfc..4b043280fe 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -26,6 +26,7 @@ class AccountController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('mainTitleIcon', 'fa-credit-card'); View::share('title', trans('firefly.accounts')); diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index 5a750ac786..41602ea21a 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -29,6 +29,7 @@ class AttachmentController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('mainTitleIcon', 'fa-paperclip'); View::share('title', trans('firefly.attachments')); diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 14f0855ac1..2ff6fde373 100755 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -22,6 +22,8 @@ use Validator; class AuthController extends Controller { + protected $guard = 'session'; + /* |-------------------------------------------------------------------------- | Registration & Login Controller @@ -93,7 +95,7 @@ class AuthController extends Controller $credentials = $this->getCredentials($request); $credentials['blocked'] = 0; // most not be blocked. - if (Auth::guard($this->getGuard())->attempt($credentials, true)) { + if (Auth::guard($this->getGuard())->attempt($credentials, $request->has('remember'))) { return $this->handleUserWasAuthenticated($request, $throttles); } diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index ca59f0d256..ed706b9315 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -24,6 +24,7 @@ class BillController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.bills')); View::share('mainTitleIcon', 'fa-calendar-o'); diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 144cd44693..badaf90906 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -30,6 +30,7 @@ class BudgetController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.budgets')); View::share('mainTitleIcon', 'fa-tasks'); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index d564789c21..12b8272c75 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -29,6 +29,7 @@ class CategoryController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.categories')); View::share('mainTitleIcon', 'fa-bar-chart'); diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index dc6fe0cf13..0447f905b1 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -28,6 +28,7 @@ class AccountController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); // create chart generator: $this->generator = app('FireflyIII\Generator\Chart\Account\AccountChartGenerator'); diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index 5f05b25c5c..340cf2d025 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -27,6 +27,7 @@ class BillController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); // create chart generator: $this->generator = app('FireflyIII\Generator\Chart\Bill\BillChartGenerator'); diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 39d3c4dffa..dffd7dca38 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -31,6 +31,7 @@ class BudgetController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); // create chart generator: $this->generator = app('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator'); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 2314d61c74..362d13e701 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -31,6 +31,7 @@ class CategoryController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); // create chart generator: $this->generator = app('FireflyIII\Generator\Chart\Category\CategoryChartGenerator'); diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index a6972d2a75..2c811f79d0 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -26,6 +26,7 @@ class PiggyBankController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); // create chart generator: $this->generator = app('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator'); diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 545fe46d7a..74ac96f6b9 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -26,6 +26,7 @@ class ReportController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); // create chart generator: $this->generator = app('FireflyIII\Generator\Chart\Report\ReportChartGenerator'); diff --git a/app/Http/Controllers/CsvController.php b/app/Http/Controllers/CsvController.php index bde7d5b7e0..a78df75634 100644 --- a/app/Http/Controllers/CsvController.php +++ b/app/Http/Controllers/CsvController.php @@ -34,6 +34,7 @@ class CsvController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.csv')); View::share('mainTitleIcon', 'fa-file-text-o'); diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index d2bdbf7e06..3213934435 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -25,6 +25,7 @@ class CurrencyController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.currencies')); View::share('mainTitleIcon', 'fa-usd'); diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index 7220742700..adb1aa7245 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -11,6 +11,10 @@ use Response; */ class HelpController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } /** * @param HelpInterface $help diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index a838ba8736..7f88eb38b3 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -6,6 +6,7 @@ use Config; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use Input; +use Log; use Preferences; use Session; use Steam; @@ -17,6 +18,10 @@ use Steam; */ class HomeController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } public function dateRange() { @@ -68,6 +73,7 @@ class HomeController extends Controller */ public function index(ARI $repository) { + Log::debug('You are at index.'); $types = Config::get('firefly.accountTypesByIdentifier.asset'); $count = $repository->countAccounts($types); bcscale(2); diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index bc1b25539b..802173a18a 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -20,6 +20,10 @@ use Session; */ class JsonController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } /** * @return \Illuminate\Http\JsonResponse diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 440c5c74d0..637a2ecb14 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -17,6 +17,10 @@ use View; */ class NewUserController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } /** diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 92ceb4cb88..799e2f3c3a 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -31,6 +31,7 @@ class PiggyBankController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.piggyBanks')); View::share('mainTitleIcon', 'fa-sort-amount-asc'); diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 9cc7d3e861..fd0f4f2a77 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -20,6 +20,7 @@ class PreferencesController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.preferences')); View::share('mainTitleIcon', 'fa-gear'); diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 71e3ffc473..133cc415a1 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -15,6 +15,10 @@ use Session; */ class ProfileController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } /** * @return \Illuminate\View\View diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 59f4f112b4..b48566c11c 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -16,6 +16,7 @@ use View; class ReportController extends Controller { + /** @var ReportHelperInterface */ protected $helper; @@ -26,6 +27,7 @@ class ReportController extends Controller */ public function __construct(ReportHelperInterface $helper) { + $this->middleware('auth'); parent::__construct(); $this->helper = $helper; diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index ad3eb16b62..a9d2b30d55 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -10,6 +10,11 @@ use Input; */ class SearchController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } + /** * Results always come in the form of an array [results, count, fullCount] * diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index bf0baa0805..4402d44ec2 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -39,6 +39,7 @@ class TagController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', 'Tags'); View::share('mainTitleIcon', 'fa-tags'); diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 54e9b5fc2b..b8f1d067a2 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -37,6 +37,7 @@ class TransactionController extends Controller */ public function __construct() { + $this->middleware('auth'); parent::__construct(); View::share('title', trans('firefly.transactions')); View::share('mainTitleIcon', 'fa-repeat'); diff --git a/app/Http/routes.php b/app/Http/routes.php index 8e6aba0054..83c4ab6249 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -265,13 +265,13 @@ Route::group( ['middleware' => 'web'], function () { Route::auth(); - Route::get('/home', 'HomeController@index'); + //Route::get('/home', 'HomeController@index'); } ); Route::group( - ['middleware' => ['auth', 'range', 'web']], function () { + ['middleware' => ['range', 'web']], function () { /** * Home Controller