This commit is contained in:
James Cole 2017-11-18 16:30:45 +01:00
parent 5f127b7bec
commit e8e0a44cca
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
11 changed files with 17 additions and 18 deletions

View File

@ -409,7 +409,7 @@ class AccountController extends Controller
* and for each period, the amount of money spent and earned. This is a complex operation which is cached for
* performance reasons.
*
* @param Account $account The account involved.
* @param Account $account the account involved
*
* @return Collection
*

View File

@ -101,7 +101,7 @@ class LoginController extends Controller
}
// forget 2fa cookie:
$cookie = $cookieJar->forever('twoFactorAuthenticated', 'false');
$request->session()->forget('twoFactorAuthenticated');
// is allowed to?
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
@ -114,6 +114,7 @@ class LoginController extends Controller
$email = $request->old('email');
$remember = $request->old('remember');
return view('auth.login', compact('allowRegistration', 'email', 'remember'))->withCookie($cookie);
return view('auth.login', compact('allowRegistration', 'email', 'remember'));//->withCookie($cookie);
}
}

View File

@ -96,9 +96,9 @@ class TwoFactorController extends Controller
*/
public function postIndex(TokenFormRequest $request, CookieJar $cookieJar)
{
// set cookie!
$cookie = $cookieJar->forever('twoFactorAuthenticated', 'true');
// update session, not cookie:
$request->session()->put('twoFactorAuthenticated', true);
return redirect(route('home'))->withCookie($cookie);
return redirect(route('home'));
}
}

View File

@ -94,7 +94,7 @@ class HomeController extends Controller
{
$phpVersion = PHP_VERSION;
$phpOs = php_uname();
$interface = php_sapi_name();
$interface = PHP_SAPI;
$now = Carbon::create()->format('Y-m-d H:i:s e');
$extensions = join(', ', get_loaded_extensions());
$drivers = join(', ', DB::availableDrivers());
@ -211,7 +211,7 @@ class HomeController extends Controller
return view(
'index',
compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount','start','end','today')
compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount', 'start', 'end', 'today')
);
}

View File

@ -100,7 +100,7 @@ class JavascriptController extends Controller
$currencyId = intval($account->getMeta('currency_id'));
}
/** @var TransactionCurrency $currency */
$currency = $currencyRepository->find($currencyId);
$currency = $currencyRepository->find($currencyId);
if (0 === $currencyId) {
$currency = app('amount')->getDefaultCurrency();
}

View File

@ -72,7 +72,6 @@ class NewUserController extends Controller
/**
* @param NewUserFormRequest $request
* @param AccountRepositoryInterface $repository
*
* @param CurrencyRepositoryInterface $currencyRepository
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector

View File

@ -261,6 +261,7 @@ class ProfileController extends Controller
* @param string $hash
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException
*/
public function undoEmailChange(string $token, string $hash)

View File

@ -133,9 +133,7 @@ class MassController extends Controller
// skip transactions that have multiple destinations, multiple sources or are an opening balance.
$filtered = new Collection;
$messages = [];
/**
* @var TransactionJournal
*/
// @var TransactionJournal
foreach ($journals as $journal) {
$sources = $journal->sourceAccountList();
$destinations = $journal->destinationAccountList();

View File

@ -64,8 +64,8 @@ class AuthenticateTwoFactor
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
// grab 2auth information from cookie, not from session.
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
// grab 2auth information from session.
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
if ($is2faEnabled && $has2faSecret && !$is2faAuthed) {
Log::debug('Does not seem to be 2 factor authed, redirect.');

View File

@ -47,8 +47,8 @@ class RedirectIfTwoFactorAuthenticated
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
// grab 2auth information from cookie
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
// grab 2auth information from session.
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
if ($is2faEnabled && $has2faSecret && $is2faAuthed) {
return redirect('/');

View File

@ -87,7 +87,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
$defaultCurrency = app('amount')->getDefaultCurrency();
$defaultCurrency = app('amount')->getDefaultCurrency();
$return = [];
/** @var Budget $budget */
foreach ($budgets as $budget) {