2017-09-15 09:05:51 +02:00
|
|
|
$(document).ready(function() {
|
2020-04-17 16:56:28 +02:00
|
|
|
$(".arrow-toggle").on('click', function(e) { e.preventDefault(); $(this).find('.arrow').toggleClass("animation"); });
|
2020-04-18 10:15:03 +02:00
|
|
|
$("#pushover_delete").click(function() { return confirm(lang.delete_ays); });
|
2018-07-29 00:38:22 +02:00
|
|
|
$(".goto_checkbox").click(function( event ) {
|
|
|
|
$("form[data-id='editalias'] .goto_checkbox").not(this).prop('checked', false);
|
|
|
|
if ($("form[data-id='editalias'] .goto_checkbox:checked").length > 0) {
|
2017-09-15 09:05:51 +02:00
|
|
|
$('#textarea_alias_goto').prop('disabled', true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#textarea_alias_goto").removeAttr('disabled');
|
|
|
|
}
|
|
|
|
});
|
2018-08-03 20:31:33 +02:00
|
|
|
$("#disable_sender_check").click(function( event ) {
|
|
|
|
if ($("form[data-id='editmailbox'] #disable_sender_check:checked").length > 0) {
|
[Docker API] Use TLS encryption for communication with "on-the-fly" created key paris (non-exposed)
[Docker API] Create pipe to pass Rspamd UI worker password
[Dovecot] Pull Spamassassin ruleset to be read by Rspamd (MANY THANKS to Peer Heinlein!)
[Dovecot] Garbage collector for deleted maildirs (set keep time via MAILDIR_GC_TIME which defaults to 1440 minutes)
[Web] Flush memcached after mailbox item changes, fixes #1808
[Web] Fix duplicate IDs, fixes #1792
[Compose] Use SQL sockets
[PHP-FPM] Update APCu and Redis libs
[Dovecot] Encrypt maildir with global key pair in crypt-vol-1 (BACKUP!), also fixes #1791
[Web] Fix deletion of spam aliases
[Helper] Add "crypt" to backup script
[Helper] Override file for external SQL socket (not supported!)
[Compose] New images for Rspamd, PHP-FPM, SOGo, Dovecot, Docker API, Watchdog, ACME, Postfix
2018-09-29 22:01:23 +02:00
|
|
|
$('#editSelectSenderACL').prop('disabled', true);
|
|
|
|
$('#editSelectSenderACL').selectpicker('refresh');
|
2018-08-03 20:31:33 +02:00
|
|
|
}
|
|
|
|
else {
|
[Docker API] Use TLS encryption for communication with "on-the-fly" created key paris (non-exposed)
[Docker API] Create pipe to pass Rspamd UI worker password
[Dovecot] Pull Spamassassin ruleset to be read by Rspamd (MANY THANKS to Peer Heinlein!)
[Dovecot] Garbage collector for deleted maildirs (set keep time via MAILDIR_GC_TIME which defaults to 1440 minutes)
[Web] Flush memcached after mailbox item changes, fixes #1808
[Web] Fix duplicate IDs, fixes #1792
[Compose] Use SQL sockets
[PHP-FPM] Update APCu and Redis libs
[Dovecot] Encrypt maildir with global key pair in crypt-vol-1 (BACKUP!), also fixes #1791
[Web] Fix deletion of spam aliases
[Helper] Add "crypt" to backup script
[Helper] Override file for external SQL socket (not supported!)
[Compose] New images for Rspamd, PHP-FPM, SOGo, Dovecot, Docker API, Watchdog, ACME, Postfix
2018-09-29 22:01:23 +02:00
|
|
|
$('#editSelectSenderACL').prop('disabled', false);
|
|
|
|
$('#editSelectSenderACL').selectpicker('refresh');
|
2018-08-03 20:31:33 +02:00
|
|
|
}
|
|
|
|
});
|
2018-07-29 00:38:22 +02:00
|
|
|
if ($("form[data-id='editalias'] .goto_checkbox:checked").length > 0) {
|
|
|
|
$('#textarea_alias_goto').prop('disabled', true);
|
|
|
|
}
|
[Docker API] Use TLS encryption for communication with "on-the-fly" created key paris (non-exposed)
[Docker API] Create pipe to pass Rspamd UI worker password
[Dovecot] Pull Spamassassin ruleset to be read by Rspamd (MANY THANKS to Peer Heinlein!)
[Dovecot] Garbage collector for deleted maildirs (set keep time via MAILDIR_GC_TIME which defaults to 1440 minutes)
[Web] Flush memcached after mailbox item changes, fixes #1808
[Web] Fix duplicate IDs, fixes #1792
[Compose] Use SQL sockets
[PHP-FPM] Update APCu and Redis libs
[Dovecot] Encrypt maildir with global key pair in crypt-vol-1 (BACKUP!), also fixes #1791
[Web] Fix deletion of spam aliases
[Helper] Add "crypt" to backup script
[Helper] Override file for external SQL socket (not supported!)
[Compose] New images for Rspamd, PHP-FPM, SOGo, Dovecot, Docker API, Watchdog, ACME, Postfix
2018-09-29 22:01:23 +02:00
|
|
|
|
|
|
|
$("#mailbox-password-warning-close").click(function( event ) {
|
|
|
|
$('#mailbox-passwd-hidden-info').addClass('hidden');
|
|
|
|
$('#mailbox-passwd-form-groups').removeClass('hidden');
|
|
|
|
});
|
2021-02-14 11:48:18 +02:00
|
|
|
// Sender ACL
|
[Docker API] Use TLS encryption for communication with "on-the-fly" created key paris (non-exposed)
[Docker API] Create pipe to pass Rspamd UI worker password
[Dovecot] Pull Spamassassin ruleset to be read by Rspamd (MANY THANKS to Peer Heinlein!)
[Dovecot] Garbage collector for deleted maildirs (set keep time via MAILDIR_GC_TIME which defaults to 1440 minutes)
[Web] Flush memcached after mailbox item changes, fixes #1808
[Web] Fix duplicate IDs, fixes #1792
[Compose] Use SQL sockets
[PHP-FPM] Update APCu and Redis libs
[Dovecot] Encrypt maildir with global key pair in crypt-vol-1 (BACKUP!), also fixes #1791
[Web] Fix deletion of spam aliases
[Helper] Add "crypt" to backup script
[Helper] Override file for external SQL socket (not supported!)
[Compose] New images for Rspamd, PHP-FPM, SOGo, Dovecot, Docker API, Watchdog, ACME, Postfix
2018-09-29 22:01:23 +02:00
|
|
|
if ($("#editSelectSenderACL option[value='\*']:selected").length > 0){
|
2018-08-03 20:31:33 +02:00
|
|
|
$("#sender_acl_disabled").show();
|
|
|
|
}
|
2021-02-14 11:48:18 +02:00
|
|
|
$('#editSelectSenderACL').change(function() {
|
|
|
|
if ($("#editSelectSenderACL option[value='\*']:selected").length > 0){
|
|
|
|
$("#sender_acl_disabled").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#sender_acl_disabled").hide();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// Resources
|
|
|
|
if ($("#editSelectMultipleBookings").val() == "custom") {
|
|
|
|
$("#multiple_bookings_custom_div").show();
|
|
|
|
$('input[name=multiple_bookings]').val($("#multiple_bookings_custom").val());
|
2018-08-03 20:31:33 +02:00
|
|
|
}
|
2021-02-14 11:48:18 +02:00
|
|
|
$("#editSelectMultipleBookings").change(function() {
|
|
|
|
$('input[name=multiple_bookings]').val($("#editSelectMultipleBookings").val());
|
|
|
|
if ($('input[name=multiple_bookings]').val() == "custom") {
|
|
|
|
$("#multiple_bookings_custom_div").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#multiple_bookings_custom_div").hide();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("#multiple_bookings_custom").bind("change keypress keyup blur", function() {
|
|
|
|
$('input[name=multiple_bookings]').val($("#multiple_bookings_custom").val());
|
|
|
|
});
|
2022-11-10 17:22:18 +02:00
|
|
|
|
|
|
|
// load tags
|
|
|
|
if ($('#tags').length){
|
|
|
|
var tagsEl = $('#tags').parent().find('.tag-values')[0];
|
|
|
|
console.log($(tagsEl).val())
|
|
|
|
var tags = JSON.parse($(tagsEl).val());
|
|
|
|
$(tagsEl).val("");
|
|
|
|
|
|
|
|
for (var i = 0; i < tags.length; i++)
|
|
|
|
addTag($('#tags'), tags[i]);
|
|
|
|
}
|
2018-08-03 20:31:33 +02:00
|
|
|
});
|
2021-02-14 11:48:18 +02:00
|
|
|
|
2017-05-23 09:36:59 +02:00
|
|
|
jQuery(function($){
|
|
|
|
// http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
|
|
|
|
function validateEmail(email) {
|
|
|
|
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
|
|
return re.test(email);
|
|
|
|
}
|
|
|
|
function draw_wl_policy_domain_table() {
|
2022-06-08 11:19:20 +02:00
|
|
|
$('#wl_policy_domain_table').DataTable({
|
|
|
|
processing: true,
|
|
|
|
serverSide: false,
|
|
|
|
language: lang_datatables,
|
|
|
|
ajax: {
|
|
|
|
type: "GET",
|
2017-05-23 09:36:59 +02:00
|
|
|
url: '/api/v1/get/policy_wl_domain/' + table_for_domain,
|
2022-06-08 11:19:20 +02:00
|
|
|
dataSrc: function(data){
|
2017-05-23 09:36:59 +02:00
|
|
|
$.each(data, function (i, item) {
|
|
|
|
if (!validateEmail(item.object)) {
|
|
|
|
item.chkbox = '<input type="checkbox" data-id="policy_wl_domain" name="multi_select" value="' + item.prefid + '" />';
|
|
|
|
}
|
|
|
|
else {
|
2018-09-09 21:17:59 +02:00
|
|
|
item.chkbox = '<input type="checkbox" disabled title="' + lang_user.spamfilter_table_domain_policy + '" />';
|
2017-05-23 09:36:59 +02:00
|
|
|
}
|
|
|
|
});
|
2022-06-08 11:19:20 +02:00
|
|
|
|
|
|
|
return data;
|
2017-05-23 09:36:59 +02:00
|
|
|
}
|
|
|
|
},
|
2022-06-08 11:19:20 +02:00
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
// placeholder, so checkbox will not block child row toggle
|
|
|
|
title: '',
|
|
|
|
data: null,
|
|
|
|
searchable: false,
|
|
|
|
orderable: false,
|
|
|
|
defaultContent: ''
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '',
|
2022-06-08 12:03:54 +02:00
|
|
|
data: 'chkbox',
|
|
|
|
searchable: false,
|
|
|
|
orderable: false,
|
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'ID',
|
|
|
|
data: 'prefid',
|
2022-07-01 16:20:39 +02:00
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: lang_user.spamfilter_table_rule,
|
2022-07-01 16:20:39 +02:00
|
|
|
data: 'value',
|
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Scope',
|
2022-07-01 16:20:39 +02:00
|
|
|
data: 'object',
|
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
}
|
|
|
|
]
|
2017-05-23 09:36:59 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
function draw_bl_policy_domain_table() {
|
2022-06-08 11:19:20 +02:00
|
|
|
$('#bl_policy_domain_table').DataTable({
|
|
|
|
processing: true,
|
|
|
|
serverSide: false,
|
|
|
|
language: lang_datatables,
|
|
|
|
ajax: {
|
|
|
|
type: "GET",
|
2017-05-23 09:36:59 +02:00
|
|
|
url: '/api/v1/get/policy_bl_domain/' + table_for_domain,
|
2022-06-08 11:19:20 +02:00
|
|
|
dataSrc: function(data){
|
2017-05-23 09:36:59 +02:00
|
|
|
$.each(data, function (i, item) {
|
|
|
|
if (!validateEmail(item.object)) {
|
|
|
|
item.chkbox = '<input type="checkbox" data-id="policy_bl_domain" name="multi_select" value="' + item.prefid + '" />';
|
|
|
|
}
|
|
|
|
else {
|
2018-09-09 21:17:59 +02:00
|
|
|
item.chkbox = '<input type="checkbox" disabled tooltip="' + lang_user.spamfilter_table_domain_policy + '" />';
|
2017-05-23 09:36:59 +02:00
|
|
|
}
|
|
|
|
});
|
2022-06-08 11:19:20 +02:00
|
|
|
|
|
|
|
return data;
|
2017-05-23 09:36:59 +02:00
|
|
|
}
|
|
|
|
},
|
2022-06-08 11:19:20 +02:00
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
// placeholder, so checkbox will not block child row toggle
|
|
|
|
title: '',
|
|
|
|
data: null,
|
|
|
|
searchable: false,
|
|
|
|
orderable: false,
|
|
|
|
defaultContent: ''
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '',
|
2022-06-08 12:03:54 +02:00
|
|
|
data: 'chkbox',
|
|
|
|
searchable: false,
|
|
|
|
orderable: false,
|
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'ID',
|
|
|
|
data: 'prefid',
|
2022-07-01 16:20:39 +02:00
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: lang_user.spamfilter_table_rule,
|
2022-07-01 16:20:39 +02:00
|
|
|
data: 'value',
|
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Scope',
|
2022-07-01 16:20:39 +02:00
|
|
|
data: 'object',
|
|
|
|
defaultContent: ''
|
2022-06-08 11:19:20 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// detect element visibility changes
|
|
|
|
function onVisible(element, callback) {
|
2022-07-01 16:20:39 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
element_object = document.querySelector(element);
|
|
|
|
if (element_object === null) return;
|
|
|
|
|
2022-06-08 11:19:20 +02:00
|
|
|
new IntersectionObserver((entries, observer) => {
|
|
|
|
entries.forEach(entry => {
|
|
|
|
if(entry.intersectionRatio > 0) {
|
|
|
|
callback(element_object);
|
|
|
|
observer.disconnect();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}).observe(element_object);
|
2017-05-23 09:36:59 +02:00
|
|
|
});
|
|
|
|
}
|
2022-06-08 11:19:20 +02:00
|
|
|
// Draw Table if tab is active
|
|
|
|
onVisible("[id^=wl_policy_domain_table]", () => draw_wl_policy_domain_table());
|
|
|
|
onVisible("[id^=bl_policy_domain_table]", () => draw_bl_policy_domain_table());
|
2021-06-30 10:13:29 +02:00
|
|
|
});
|