Some minor changes to Aliases handling (#3572)

* Allows to get mailbox Aliases by both ID and address
Returns ID within the msg for newly created Aliases

* Uses different query for get Aliases

* Allows to get mailbox Aliases by both ID and address
Returns ID within the msg for newly created Aliases

* Uses different query for get Aliases

* Allows to delete aliases by address

* Update lang files
Reflect id information when adding an alias

Co-authored-by: programmierus <programmierus@icloud.com>
This commit is contained in:
Programmierus
2020-05-25 16:20:59 +02:00
committed by GitHub
parent b6933fdb96
commit e3d9a53eeb
9 changed files with 14 additions and 12 deletions

View File

@@ -777,10 +777,11 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
':active' => $active
));
}
$id = $pdo->lastInsertId();
$_SESSION['return'][] = array(
'type' => 'success',
'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
'msg' => array('alias_added', $address)
'msg' => array('alias_added', $address, $id)
);
}
break;
@@ -3119,9 +3120,10 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
`created`,
`modified`
FROM `alias`
WHERE `id` = :id AND `address` != `goto`");
WHERE (`id` = :id OR `address` = :address) AND `address` != `goto`");
$stmt->execute(array(
':id' => intval($_data),
':id' => $_data,
':address' => $_data,
));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt = $pdo->prepare("SELECT `target_domain` FROM `alias_domain` WHERE `alias_domain` = :domain");
@@ -3823,7 +3825,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
}
$stmt = $pdo->prepare("DELETE FROM `alias` WHERE `id` = :id");
$stmt->execute(array(
':id' => $id
':id' => $alias_data['id']
));
$stmt = $pdo->prepare("DELETE FROM `sender_acl` WHERE `send_as` = :alias_address");
$stmt->execute(array(