X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/0da9e6e7d82b2cb758626d1ee4eb6b3297d667b1..f1c0988bd7f213a40ce3cfcf6d7522bd2fd12afa:/quarantine.php diff --git a/quarantine.php b/quarantine.php index 6a2cf5a..28bd2bd 100644 --- a/quarantine.php +++ b/quarantine.php @@ -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; @@ -72,14 +73,26 @@ 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') {