moved javascript to app.js

master
Alexander Graf 3 years ago
parent b48779ea70
commit aaf3ddd002

@ -66,5 +66,12 @@ $('document').ready(function() {
// init clipboard.js
new ClipboardJS('.btn-clip');
// disable login if not possible
var l = $('#login_needs_https');
if (l.length && window.location.protocol != 'https:') {
l.removeClass("d-none");
$('form :input').prop('disabled', true);
}
});

@ -8,14 +8,11 @@
{% trans %}to access the administration tools{% endtrans %}
{%- endblock %}
{%+ block content %}
{% if config["SESSION_COOKIE_SECURE"] %}
<script language="javascript">
if(window.location.protocol != "https:") {
document.write('<div class="alert alert-danger" role="alert">The login form has been disabled as <b>SESSION_COOKIE_SECURE</b> is on but you are accessing Mailu over HTTP</div>');
window.stop();
}
</script>
{% endif %}
{%- block content %}
<div id="login_needs_https" class="alert alert-danger d-none" role="alert">
{% trans %}The login form has been disabled as <b>SESSION_COOKIE_SECURE</b> is on but you are accessing Mailu over HTTP.{% endtrans %}
</div>
{{ super() }}
{%+ endblock %}
{%- endblock %}
{% endif %}

Loading…
Cancel
Save