diff --git a/data/Dockerfiles/dovecot/imapsync_cron.pl b/data/Dockerfiles/dovecot/imapsync_cron.pl
index 132e536e..ddd4746a 100755
--- a/data/Dockerfiles/dovecot/imapsync_cron.pl
+++ b/data/Dockerfiles/dovecot/imapsync_cron.pl
@@ -54,6 +54,10 @@ while ($row = $sth->fetchrow_arrayref()) {
$delete1 = @$row[12];
$delete2 = @$row[13];
+ $is_running = $dbh->prepare("UPDATE imapsync SET is_running = 1 WHERE id = ?");
+ $is_running->bind_param( 1, ${id} );
+ $is_running->execute();
+
if ($enc1 eq "TLS") { $enc1 = "--tls1"; } elsif ($enc1 eq "SSL") { $enc1 = "--ssl1"; } else { undef $enc1; }
my $template = $run_dir . '/imapsync.XXXXXXX';
@@ -83,7 +87,7 @@ while ($row = $sth->fetchrow_arrayref()) {
"--passfile2", $passfile2->filename,
'--no-modulesversion'], ">", \my $stdout;
- $update = $dbh->prepare("UPDATE imapsync SET returned_text = ?, last_run = NOW() WHERE id = ?");
+ $update = $dbh->prepare("UPDATE imapsync SET returned_text = ?, last_run = NOW(), is_running = 0 WHERE id = ?");
$update->bind_param( 1, ${stdout} );
$update->bind_param( 2, ${id} );
$update->execute();
diff --git a/data/web/inc/init_db.inc.php b/data/web/inc/init_db.inc.php
index 9b6a63c9..1bc02497 100644
--- a/data/web/inc/init_db.inc.php
+++ b/data/web/inc/init_db.inc.php
@@ -3,7 +3,7 @@ function init_db_schema() {
try {
global $pdo;
- $db_version = "31102017_1049";
+ $db_version = "08112017_1049";
$stmt = $pdo->query("SHOW TABLES LIKE 'versions'");
$num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC));
@@ -314,6 +314,7 @@ function init_db_schema() {
"delete2duplicates" => "TINYINT(1) NOT NULL DEFAULT '1'",
"delete1" => "TINYINT(1) NOT NULL DEFAULT '0'",
"delete2" => "TINYINT(1) NOT NULL DEFAULT '0'",
+ "is_running" => "TINYINT(1) NOT NULL DEFAULT '0'",
"returned_text" => "TEXT",
"last_run" => "TIMESTAMP NULL DEFAULT NULL",
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)",
diff --git a/data/web/js/api.js b/data/web/js/api.js
index 23bf229e..824e2d64 100644
--- a/data/web/js/api.js
+++ b/data/web/js/api.js
@@ -79,6 +79,21 @@ $(document).ready(function() {
$(this).removeClass('inputMissingAttr');
}
}
+ if ($(this).attr("max")) {
+ if ($(this).val() > $(this).attr("max")) {
+ invalid = true;
+ $(this).addClass('inputMissingAttr');
+ } else {
+ if ($(this).attr("min")) {
+ if ($(this).val() < $(this).attr("min")) {
+ invalid = true;
+ $(this).addClass('inputMissingAttr');
+ } else {
+ $(this).removeClass('inputMissingAttr');
+ }
+ }
+ }
+ }
});
if (!req_empty) {
var attr_to_merge = $(this).closest("form").serializeObject();
@@ -129,18 +144,33 @@ $(document).ready(function() {
// If clicked button is in a form with the same data-id as the button,
// we merge all input fields by {"name":"value"} into api-attr
if ($(this).closest("form").data('id') == id) {
- var req_empty = false;
+ var invalid = false;
$(this).closest("form").find('select, textarea, input').each(function() {
if ($(this).prop('required')) {
if (!$(this).val() && $(this).prop('disabled') === false) {
- req_empty = true;
+ invalid = true;
$(this).addClass('inputMissingAttr');
} else {
$(this).removeClass('inputMissingAttr');
}
}
+ if ($(this).attr("max")) {
+ if ($(this).val() > $(this).attr("max")) {
+ invalid = true;
+ $(this).addClass('inputMissingAttr');
+ } else {
+ if ($(this).attr("min")) {
+ if ($(this).val() < $(this).attr("min")) {
+ invalid = true;
+ $(this).addClass('inputMissingAttr');
+ } else {
+ $(this).removeClass('inputMissingAttr');
+ }
+ }
+ }
+ }
});
- if (!req_empty) {
+ if (!invalid) {
var attr_to_merge = $(this).closest("form").serializeObject();
var api_attr = $.extend(api_attr, attr_to_merge)
} else {
diff --git a/data/web/js/mailbox.js b/data/web/js/mailbox.js
index d55b1913..9e2afa2c 100644
--- a/data/web/js/mailbox.js
+++ b/data/web/js/mailbox.js
@@ -421,7 +421,8 @@ jQuery(function($){
{"name":"mins_interval","title":lang.mins_interval,"breakpoints":"all"},
{"name":"last_run","title":lang.last_run,"breakpoints":"all"},
{"name":"log","title":"Log"},
- {"name":"active","filterable": false,"style":{"maxWidth":"50px","width":"70px"},"title":lang.active},
+ {"name":"active","filterable": false,"style":{"maxWidth":"70px","width":"70px"},"title":lang.active},
+ {"name":"is_running","filterable": false,"style":{"maxWidth":"120px","width":"100px"},"title":lang.status},
{"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"}
],
"empty": lang.empty,
@@ -442,6 +443,14 @@ jQuery(function($){
' ' + lang.remove + '' +
'';
item.chkbox = '';
+ if (item.is_running == 1) {
+ item.is_running = '' + lang.running + '';
+ } else {
+ item.is_running = '' + lang.waiting + '';
+ }
+ if (!item.last_run > 0) {
+ item.last_run = lang.waiting;
+ }
});
}
}),
diff --git a/data/web/js/user.js b/data/web/js/user.js
index 239507f4..900dced1 100644
--- a/data/web/js/user.js
+++ b/data/web/js/user.js
@@ -89,13 +89,14 @@ jQuery(function($){
{"name":"chkbox","title":"","style":{"maxWidth":"40px","width":"40px","text-align":"center"},"filterable": false,"sortable": false,"type":"html"},
{"sorted": true,"name":"id","title":"ID","style":{"maxWidth":"60px","width":"60px","text-align":"center"}},
{"name":"server_w_port","title":"Server"},
- {"name":"enc1","title":lang.encryption},
+ {"name":"enc1","title":lang.encryption,"breakpoints":"xs sm"},
{"name":"user1","title":lang.username},
- {"name":"exclude","title":lang.excludes},
+ {"name":"exclude","title":lang.excludes,"breakpoints":"xs sm"},
{"name":"mins_interval","title":lang.interval + " (min)"},
- {"name":"last_run","title":lang.last_run},
+ {"name":"last_run","title":lang.last_run,"breakpoints":"xs sm"},
{"name":"log","title":"Log"},
- {"name":"active","filterable": false,"style":{"maxWidth":"50px","width":"70px"},"title":lang.active},
+ {"name":"active","filterable": false,"style":{"maxWidth":"70px","width":"70px"},"title":lang.active},
+ {"name":"is_running","filterable": false,"style":{"maxWidth":"120px","width":"100px"},"title":lang.status},
{"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"}
],
"empty": lang.empty,
@@ -109,7 +110,11 @@ jQuery(function($){
success: function (data) {
$.each(data, function (i, item) {
item.log = 'Open logs'
- item.exclude = '' + item.exclude + '
'
+ if (!item.exclude > 0) {
+ item.exclude = '-';
+ } else {
+ item.exclude = '' + item.exclude + '
';
+ }
item.server_w_port = item.user1 + '@' + item.host1 + ':' + item.port1;
if (acl_data.syncjobs === 1) {
item.action = '
vars.inc.(local.)php
gelesen und können nicht mittels UI verändert werden.';
+$lang['mailbox']['waiting'] = "Wartend";
+$lang['mailbox']['status'] = "Status";
+$lang['mailbox']['running'] = "In Ausführung";
\ No newline at end of file
diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php
index 01996066..8832c334 100644
--- a/data/web/lang/lang.en.php
+++ b/data/web/lang/lang.en.php
@@ -160,6 +160,9 @@ $lang['user']['spamfilter_red'] = 'Red: This message is spam and will be rejecte
$lang['user']['spamfilter_default_score'] = 'Default values:';
$lang['user']['spamfilter_hint'] = 'The first value describes the "low spam score", the second represents the "high spam score".';
$lang['user']['spamfilter_table_domain_policy'] = "n/a (domain policy)";
+$lang['user']['waiting'] = "Waiting";
+$lang['user']['status'] = "Status";
+$lang['user']['running'] = "Running";
$lang['user']['tls_policy_warning'] = 'Warning: If you decide to enforce encrypted mail transfer, you may lose emails.vars.inc.(local.)php
and cannot be modified.';
+$lang['mailbox']['waiting'] = "Waiting";
+$lang['mailbox']['status'] = "Status";
+$lang['mailbox']['running'] = "Running";
$lang['edit']['tls_policy'] = "Change TLS policy";
$lang['edit']['spam_score'] = "Set a custom spam score";
diff --git a/data/web/modals/mailbox.php b/data/web/modals/mailbox.php
index 0dcdfd44..192124c2 100644
--- a/data/web/modals/mailbox.php
+++ b/data/web/modals/mailbox.php
@@ -44,6 +44,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {