[Web] Important fixes for quarantaine; other minor changes

This commit is contained in:
andre.peters
2018-01-17 15:23:33 +01:00
parent 003e6ef5cd
commit 8419266678
5 changed files with 36 additions and 4 deletions

View File

@@ -709,6 +709,16 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
);
return false;
}
try {
$redis->hSet('DOMAIN_MAP', $alias_domain, 1);
}
catch (RedisException $e) {
$_SESSION['return'] = array(
'type' => 'danger',
'msg' => 'Redis: '.$e
);
return false;
}
}
$_SESSION['return'] = array(
'type' => 'success',
@@ -3514,6 +3524,16 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
);
return false;
}
try {
$redis->hDel('DOMAIN_MAP', $alias_domain);
}
catch (RedisException $e) {
$_SESSION['return'] = array(
'type' => 'danger',
'msg' => 'Redis: '.$e
);
return false;
}
}
$_SESSION['return'] = array(
'type' => 'success',

View File

@@ -216,6 +216,13 @@ function quarantaine($_action, $_data = null) {
$q_meta[] = $row;
}
}
elseif ($_SESSION['mailcow_cc_role'] == "admin") {
$stmt = $pdo->query('SELECT `id`, `qid`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created` FROM `quarantaine`');
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
while($row = array_shift($rows)) {
$q_meta[] = $row;
}
}
else {
foreach (mailbox('get', 'mailboxes') as $mbox) {
$stmt = $pdo->prepare('SELECT `id`, `qid`, `rcpt`, `sender`, UNIX_TIMESTAMP(`created`) AS `created` FROM `quarantaine` WHERE `rcpt` = :mbox');