mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-15 02:57:07 +00:00
Update some code, add security txt file.
This commit is contained in:
@@ -96,7 +96,7 @@ class ReconcileController extends Controller
|
||||
$preFilled = [
|
||||
'date' => $this->repository->getJournalDate($journal, null),
|
||||
'category' => $this->repository->getJournalCategoryName($journal),
|
||||
'tags' => join(',', $journal->tags->pluck('tag')->toArray()),
|
||||
'tags' => implode(',', $journal->tags->pluck('tag')->toArray()),
|
||||
'amount' => $pTransaction->amount,
|
||||
];
|
||||
|
||||
@@ -319,7 +319,7 @@ class ReconcileController extends Controller
|
||||
'category_name' => null,
|
||||
],
|
||||
],
|
||||
'notes' => join(', ', $data['transactions']),
|
||||
'notes' => implode(', ', $data['transactions']),
|
||||
];
|
||||
|
||||
$journal = $repository->store($journalData);
|
||||
|
||||
@@ -76,6 +76,7 @@ class LinkController extends Controller
|
||||
* @param LinkType $linkType
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function delete(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
||||
{
|
||||
@@ -108,6 +109,7 @@ class LinkController extends Controller
|
||||
* @param LinkType $linkType
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function destroy(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
||||
{
|
||||
@@ -126,6 +128,7 @@ class LinkController extends Controller
|
||||
* @param LinkType $linkType
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function edit(Request $request, LinkType $linkType)
|
||||
{
|
||||
@@ -184,6 +187,7 @@ class LinkController extends Controller
|
||||
* @param LinkTypeRepositoryInterface $repository
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function store(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository)
|
||||
{
|
||||
@@ -212,6 +216,7 @@ class LinkController extends Controller
|
||||
* @param LinkType $linkType
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function update(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
||||
{
|
||||
|
||||
@@ -61,6 +61,8 @@ class UpdateController extends Controller
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||
* @throws \Psr\Container\ContainerExceptionInterface
|
||||
* @throws \Illuminate\Container\EntryNotFoundException
|
||||
*/
|
||||
public function index()
|
||||
|
||||
@@ -65,6 +65,7 @@ class LoginController extends Controller
|
||||
*
|
||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function login(Request $request)
|
||||
@@ -102,6 +103,7 @@ class LoginController extends Controller
|
||||
* @param CookieJar $cookieJar
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function logout(Request $request, CookieJar $cookieJar)
|
||||
{
|
||||
@@ -119,6 +121,7 @@ class LoginController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function showLoginForm(Request $request)
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ class TwoFactorController extends Controller
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws FireflyException
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
@@ -91,6 +92,7 @@ class TwoFactorController extends Controller
|
||||
*
|
||||
* @return mixed
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) // it's unused but the class does some validation.
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function postIndex(TokenFormRequest $request, CookieJar $cookieJar)
|
||||
{
|
||||
|
||||
@@ -97,6 +97,7 @@ class ConfigurationController extends Controller
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function post(Request $request, ImportJob $job)
|
||||
|
||||
@@ -71,7 +71,7 @@ class IndexController extends Controller
|
||||
*/
|
||||
public function create(string $bank)
|
||||
{
|
||||
if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
|
||||
if (true === !config(sprintf('import.enabled.%s', $bank))) {
|
||||
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class PrerequisitesController extends Controller
|
||||
*/
|
||||
public function index(string $bank)
|
||||
{
|
||||
if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
|
||||
if (true === !config(sprintf('import.enabled.%s', $bank))) {
|
||||
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
||||
}
|
||||
$class = strval(config(sprintf('import.prerequisites.%s', $bank)));
|
||||
@@ -103,13 +103,14 @@ class PrerequisitesController extends Controller
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function post(Request $request, string $bank)
|
||||
{
|
||||
Log::debug(sprintf('Now in postPrerequisites for %s', $bank));
|
||||
|
||||
if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
|
||||
if (true === !config(sprintf('import.enabled.%s', $bank))) {
|
||||
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
||||
@@ -244,6 +244,15 @@ class BoxController extends Controller
|
||||
if ($currencyId !== 0) {
|
||||
$accountCurrency = $currencyRepos->findNull($currencyId);
|
||||
}
|
||||
|
||||
// if the account is a credit card, subtract the virtual balance from the balance,
|
||||
// to better reflect that this is not money that is actually "yours".
|
||||
$role = (string)$repository->getMetaValue($account, 'accountRole');
|
||||
$virtualBalance = (string)$account->virtual_balance;
|
||||
if ($role === 'ccAsset' && $virtualBalance !== '' && (float)$virtualBalance > 0) {
|
||||
$balance = bcsub($balance, $virtualBalance);
|
||||
}
|
||||
|
||||
if (!isset($netWorth[$accountCurrency->id])) {
|
||||
$netWorth[$accountCurrency->id]['currency'] = $accountCurrency;
|
||||
$netWorth[$accountCurrency->id]['sum'] = '0';
|
||||
|
||||
@@ -35,6 +35,7 @@ use phpseclib\Crypt\RSA;
|
||||
*/
|
||||
class InstallController extends Controller
|
||||
{
|
||||
/** @noinspection MagicMethodsValidityInspection */
|
||||
/**
|
||||
* InstallController constructor.
|
||||
*/
|
||||
@@ -66,7 +67,7 @@ class InstallController extends Controller
|
||||
Passport::keyPath('oauth-private.key'),
|
||||
];
|
||||
|
||||
if ((file_exists($publicKey) || file_exists($privateKey))) {
|
||||
if (file_exists($publicKey) || file_exists($privateKey)) {
|
||||
return response()->json(['OK']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user