Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/8779

James Colec54f84dc8e1a
diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
index 41d7fa95b4..d317b67b2c 100644
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -31,6 +31,7 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
/**
@@ -106,6 +107,7 @@ class ForgotPasswordController extends Controller
}
$host = request()->host();
if ($configuredHost !== $host) {
+ Log::error(sprintf('Host header is "%s", APP_URL is "%s".', $host, $configuredHost));
throw new FireflyException('The Host-header does not match the host in the APP_URL environment variable. Please make sure these match. See also: https://bit.ly/FF3-host-header');
}
}
diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php
index eaeac5ca6c..4167f64c31 100644
--- a/app/Support/Twig/Translation.php
+++ b/app/Support/Twig/Translation.php
@@ -49,6 +49,7 @@ class Translation extends AbstractExtension
{
return [
$this->journalLinkTranslation(),
+ $this->laravelTranslation(),
];
}
@@ -68,4 +69,19 @@ class Translation extends AbstractExtension
['is_safe' => ['html']]
);
}
+
+ public function laravelTranslation(): TwigFunction
+ {
+ return new TwigFunction(
+ '__',
+ static function (string $key) {
+ $translation = trans($key);
+ if ($key === $translation) {
+ return $key;
+ }
+
+ return $translation;
+ }
+ );
+ }
}
diff --git a/resources/views/partials/password-modal-twig.twig b/resources/views/partials/password-modal-twig.twig
new file mode 100644
index 0000000000..f8365acc9a
--- /dev/null
+++ b/resources/views/partials/password-modal-twig.twig
@@ -0,0 +1,35 @@
+<div class="modal fade" id="passwordModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title">
+ {{ __('firefly.secure_pw_title') }}
+ </h5>
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('firefly.close') }}"></button>
+ </div>
+ <div class="modal-body">
+ <p>
+ {{ __('firefly.secure_pw_history') }}
+ </p>
+ <p>
+ {{ __('firefly.secure_pw_ff') }}
+ </p>
+ <p>
+ {{ __('firefly.secure_pw_check_box') }}
+ </p>
+
+ <h4>{{ __('firefly.secure_pw_working_title') }}</h4>
+ <p>
+ {{ __('firefly.secure_pw_working')|raw }}
+ </p>
+ <h4>{{ __('firefly.secure_pw_should') }}</h4>
+ <p>
+ {{ __('firefly.secure_pw_long_password') }}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ __('firefly.close') }}</button>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/resources/views/profile/change-password.twig b/resources/views/profile/change-password.twig
index 17ed60e71b..80bf41056d 100644
--- a/resources/views/profile/change-password.twig
+++ b/resources/views/profile/change-password.twig
@@ -65,5 +65,5 @@
</div>
</div>
</form>
- {% include 'partials.password-modal' %}
+ {% include 'partials.password-modal-twig' %}
{% endblock %}