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 // init clipboard.js
new ClipboardJS('.btn-clip'); 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 %} {% trans %}to access the administration tools{% endtrans %}
{%- endblock %} {%- endblock %}
{%+ block content %}
{% if config["SESSION_COOKIE_SECURE"] %} {% if config["SESSION_COOKIE_SECURE"] %}
<script language="javascript"> {%- block content %}
if(window.location.protocol != "https:") { <div id="login_needs_https" class="alert alert-danger d-none" role="alert">
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>'); {% trans %}The login form has been disabled as <b>SESSION_COOKIE_SECURE</b> is on but you are accessing Mailu over HTTP.{% endtrans %}
window.stop(); </div>
}
</script>
{% endif %}
{{ super() }} {{ super() }}
{%+ endblock %} {%- endblock %}
{% endif %}

Loading…
Cancel
Save