]> git.datanom.net - qtadmin.git/blobdiff - quarantine.php
prepare for wblistadm server
[qtadmin.git] / quarantine.php
index 6a2cf5ac1a3bff965c4093689689041cb6b631e0..28bd2bd0a607a42ab823c4bf7707d2c3982f4b95 100644 (file)
@@ -56,6 +56,7 @@
                 } else if ($request == 'delete') {
                     $query[] = "UPDATE msgrcpt SET rs = 'D' WHERE mail_id = '$mail_id'";
                 } else if ($request == 'block') {
+                    $query[] = $recipient;
                 } else {
                     error("Unknown operation [$request]");
                     exit;
     if ($loggedIn && isset($_GET['id'])) {
         $ids = explode(',', $_GET['id']);
         if ($request == 'block') {
-            // call rest server
+            // /add/(whitelist|blacklist)/(.+)
+            $query = handleRequest($util, $request, $ids);
+            $data = json_encode($query);
+            if ($util->isAdmin()) {
+                $method = '/add/blacklist';
+            } else {
+                $method = '/add/blacklist/' . $util->getUser();
+            }
+            $success = $util->makeRestCall($method, $data);
         } else {
             $query = handleRequest($util, $request, $ids);
             $success = $DB->update($query);
-            if (! $success) {
+        }
+        if (! $success) {
+            if ($request == 'block') {
+                error("Could not blacklist sender");
+            } else {
                 error("Message not released, contact administrator [$query]");
-                exit;
             }
+            exit;
         }
         header('Location: index.php');
     } else if ($loggedIn && $request == 'purge') {
This page took 0.083461 seconds and 5 git commands to generate.