Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Move authentication around.
James Colefd9a7080eacb
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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 $helpdiff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.phpindex 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.phpindex 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\JsonResponsediff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.phpindex 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.phpindex 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.phpindex 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.phpindex 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\Viewdiff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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