James Cole
2024-04-13 05:50:26 +02:00
parent c2e562623c
commit c54f84dc8e
4 changed files with 54 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails; use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View; use Illuminate\View\View;
/** /**
@@ -106,6 +107,7 @@ class ForgotPasswordController extends Controller
} }
$host = request()->host(); $host = request()->host();
if ($configuredHost !== $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'); 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');
} }
} }

View File

@@ -49,6 +49,7 @@ class Translation extends AbstractExtension
{ {
return [ return [
$this->journalLinkTranslation(), $this->journalLinkTranslation(),
$this->laravelTranslation(),
]; ];
} }
@@ -68,4 +69,19 @@ class Translation extends AbstractExtension
['is_safe' => ['html']] ['is_safe' => ['html']]
); );
} }
public function laravelTranslation(): TwigFunction
{
return new TwigFunction(
'__',
static function (string $key) {
$translation = trans($key);
if ($key === $translation) {
return $key;
}
return $translation;
}
);
}
} }

View File

@@ -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>

View File

@@ -65,5 +65,5 @@
</div> </div>
</div> </div>
</form> </form>
{% include 'partials.password-modal' %} {% include 'partials.password-modal-twig' %}
{% endblock %} {% endblock %}