浏览代码

show whether user has been notified yet (#3058)

* show wether user has been notified yet

* add translations
tinect 5 年之前
父节点
当前提交
51a8d58e3d

+ 3 - 3
data/web/inc/functions.quarantine.inc.php

@@ -624,7 +624,7 @@ function quarantine($_action, $_data = null) {
     break;
     break;
     case 'get':
     case 'get':
       if ($_SESSION['mailcow_cc_role'] == "user") {
       if ($_SESSION['mailcow_cc_role'] == "user") {
-        $stmt = $pdo->prepare('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created` FROM `quarantine` WHERE `rcpt` = :mbox');
+        $stmt = $pdo->prepare('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created`, `notified` FROM `quarantine` WHERE `rcpt` = :mbox');
         $stmt->execute(array(':mbox' => $_SESSION['mailcow_cc_username']));
         $stmt->execute(array(':mbox' => $_SESSION['mailcow_cc_username']));
         $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
         $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
         while($row = array_shift($rows)) {
         while($row = array_shift($rows)) {
@@ -632,7 +632,7 @@ function quarantine($_action, $_data = null) {
         }
         }
       }
       }
       elseif ($_SESSION['mailcow_cc_role'] == "admin") {
       elseif ($_SESSION['mailcow_cc_role'] == "admin") {
-        $stmt = $pdo->query('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created` FROM `quarantine`');
+        $stmt = $pdo->query('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created`, `notified` FROM `quarantine`');
         $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
         $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
         while($row = array_shift($rows)) {
         while($row = array_shift($rows)) {
           $q_meta[] = $row;
           $q_meta[] = $row;
@@ -641,7 +641,7 @@ function quarantine($_action, $_data = null) {
       else {
       else {
         $domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains'));
         $domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains'));
         foreach ($domains as $domain) {
         foreach ($domains as $domain) {
-          $stmt = $pdo->prepare('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created` FROM `quarantine` WHERE `rcpt` REGEXP :domain');
+          $stmt = $pdo->prepare('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created`, `notified` FROM `quarantine` WHERE `rcpt` REGEXP :domain');
           $stmt->execute(array(':domain' => '@' . $domain . '$'));
           $stmt->execute(array(':domain' => '@' . $domain . '$'));
           $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
           $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
           while($row = array_shift($rows)) {
           while($row = array_shift($rows)) {

+ 7 - 1
data/web/js/site/quarantine.js

@@ -15,10 +15,11 @@ jQuery(function($){
         {"name":"id","type":"ID","filterable": false,"sorted": true,"direction":"DESC","title":"ID","style":{"width":"50px"}},
         {"name":"id","type":"ID","filterable": false,"sorted": true,"direction":"DESC","title":"ID","style":{"width":"50px"}},
         {"name":"qid","breakpoints":"all","type":"text","title":lang.qid,"style":{"width":"125px"}},
         {"name":"qid","breakpoints":"all","type":"text","title":lang.qid,"style":{"width":"125px"}},
         {"name":"sender","title":lang.sender},
         {"name":"sender","title":lang.sender},
+        {"name":"subject","title":lang.subj, "type": "text"},
         {"name":"rcpt","title":lang.rcpt, "breakpoints":"xs sm md", "type": "text"},
         {"name":"rcpt","title":lang.rcpt, "breakpoints":"xs sm md", "type": "text"},
         {"name":"virus","title":lang.danger, "type": "text"},
         {"name":"virus","title":lang.danger, "type": "text"},
         {"name":"score","title": lang.spam_score, "type": "text"},
         {"name":"score","title": lang.spam_score, "type": "text"},
-        {"name":"subject","title":lang.subj, "type": "text"},
+        {"name":"notified","title":lang.notified, "type": "text"},
         {"name":"created","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.received,"style":{"width":"170px"}},
         {"name":"created","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.received,"style":{"width":"170px"}},
         {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right"},"style":{"width":"220px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"}
         {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right"},"style":{"width":"220px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"}
       ],
       ],
@@ -44,6 +45,11 @@ jQuery(function($){
             } else {
             } else {
               item.virus = '<span class="dot-neutral"></span>';
               item.virus = '<span class="dot-neutral"></span>';
             }
             }
+            if(item.notified > 0) {
+              item.notified = '&#10004;';
+            } else {
+              item.notified = '&#10006;';
+            }
             if (acl_data.login_as === 1) {
             if (acl_data.login_as === 1) {
             item.action = '<div class="btn-group">' +
             item.action = '<div class="btn-group">' +
               '<a href="#" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-info show_qid_info"><span class="glyphicon glyphicon-modal-window"></span> ' + lang.show_item + '</a>' +
               '<a href="#" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-info show_qid_info"><span class="glyphicon glyphicon-modal-window"></span> ' + lang.show_item + '</a>' +

+ 2 - 1
data/web/lang/lang.de.json

@@ -534,7 +534,8 @@
         "qhandler_success": "Aktion wurde an das System übergeben. Sie dürfen dieses Fenster nun schließen.",
         "qhandler_success": "Aktion wurde an das System übergeben. Sie dürfen dieses Fenster nun schließen.",
         "release_body": "Die ursprüngliche Nachricht wurde als EML-Datei im Anhang hinterlegt.",
         "release_body": "Die ursprüngliche Nachricht wurde als EML-Datei im Anhang hinterlegt.",
         "release_subject": "Potentiell schädliche Nachricht aus Quarantäne: %s",
         "release_subject": "Potentiell schädliche Nachricht aus Quarantäne: %s",
-        "confirm_delete": "Bestätigen Sie die Löschung dieses Elements."
+        "confirm_delete": "Bestätigen Sie die Löschung dieses Elements.",
+        "notified": "Benachrichtigt"
     },
     },
     "mailbox": {
     "mailbox": {
         "tls_policy_maps": "TLS-Richtlinien",
         "tls_policy_maps": "TLS-Richtlinien",

+ 2 - 1
data/web/lang/lang.en.json

@@ -533,7 +533,8 @@
         "confirm_delete": "Confirm the deletion of this element.",
         "confirm_delete": "Confirm the deletion of this element.",
         "qhandler_success": "Request successfully sent to the system. You can now close the window.",
         "qhandler_success": "Request successfully sent to the system. You can now close the window.",
         "release_body": "We have attached your message as eml file to this message.",
         "release_body": "We have attached your message as eml file to this message.",
-        "release_subject": "Potentially damaging quarantine item %s"
+        "release_subject": "Potentially damaging quarantine item %s",
+        "notified": "Notified"
     },
     },
     "mailbox": {
     "mailbox": {
         "tls_policy_maps": "TLS policy maps",
         "tls_policy_maps": "TLS policy maps",