From ef7a77ef4747d189ef939a6836103c9e1e5125b4 Mon Sep 17 00:00:00 2001 From: andryyy Date: Fri, 3 Mar 2017 19:12:27 +0100 Subject: [PATCH] Fix user details when goto has multiple values, fix wording --- data/web/inc/functions.inc.php | 11 +++++++---- data/web/lang/lang.de.php | 2 +- data/web/lang/lang.en.php | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index 7c83484b..a56a7ca6 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -1466,8 +1466,11 @@ function user_get_alias_details($username) { } try { $data['address'] = $username; - $stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') AS `aliases` FROM `alias` WHERE `goto` = :username_goto AND `address` NOT LIKE '@%' AND `address` != :username_address"); - $stmt->execute(array(':username_goto' => $username, ':username_address' => $username)); + $stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') AS `aliases` FROM `alias` + WHERE `goto` LIKE :username_goto + AND `address` NOT LIKE '@%' + AND `address` != :username_address"); + $stmt->execute(array(':username_goto' => '%' . $username . '%', ':username_address' => $username)); $run = $stmt->fetchAll(PDO::FETCH_ASSOC); while ($row = array_shift($run)) { $data['aliases'] = $row['aliases']; @@ -1492,8 +1495,8 @@ function user_get_alias_details($username) { while ($row = array_shift($run)) { $data['aliases_send_as_all'] = $row['send_as']; } - $stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') as `address` FROM `alias` WHERE `goto` = :username AND `address` LIKE '@%';"); - $stmt->execute(array(':username' => $username)); + $stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') as `address` FROM `alias` WHERE `goto` LIKE :username AND `address` LIKE '@%';"); + $stmt->execute(array(':username' => '%' . $username . '%')); $run = $stmt->fetchAll(PDO::FETCH_ASSOC); while ($row = array_shift($run)) { $data['is_catch_all'] = $row['address']; diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php index 8026bc78..c3e0f165 100644 --- a/data/web/lang/lang.de.php +++ b/data/web/lang/lang.de.php @@ -108,7 +108,7 @@ $lang['user']['alias'] = 'Alias'; $lang['user']['aliases'] = 'Aliasse'; $lang['user']['domain_aliases'] = 'Domain-Alias Adressen'; $lang['user']['is_catch_all'] = 'Ist Catch-All Adresse für Domain(s)'; -$lang['user']['aliases_also_send_as'] = 'Darf außerdem versenden als'; +$lang['user']['aliases_also_send_as'] = 'Darf außerdem versenden als Benutzer'; $lang['user']['aliases_send_as_all'] = 'Absender für folgende Domains und zugehörige Alias-Domains nicht prüfen'; $lang['user']['alias_create_random'] = 'Zufälligen Alias generieren'; $lang['user']['alias_extend_all'] = 'Gültigkeit +1h'; diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php index 9e0ad1d3..4c54438d 100644 --- a/data/web/lang/lang.en.php +++ b/data/web/lang/lang.en.php @@ -110,7 +110,7 @@ $lang['user']['alias'] = 'Alias'; $lang['user']['aliases'] = 'Aliases'; $lang['user']['domain_aliases'] = 'Domain alias addresses'; $lang['user']['is_catch_all'] = 'Catch-all for domain/s'; -$lang['user']['aliases_also_send_as'] = 'Also allowed to send as'; +$lang['user']['aliases_also_send_as'] = 'Also allowed to send as user'; $lang['user']['aliases_send_as_all'] = 'Do not check sender access for the following domain(s) and its alias domains'; $lang['user']['alias_create_random'] = 'Generate random alias'; $lang['user']['alias_extend_all'] = 'Extend aliases by 1 hour';