diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-11-28 20:40:07 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-11-28 20:40:07 +0100 |
commit | 0247b89c38c7f7ef1a2111239c6a1c8c13394d93 (patch) | |
tree | 7039431e71de2a17df6b06f3b0836c95f94da304 /program/lib/Roundcube | |
parent | 30cc01f89daea932d15a1a505d25b543913664ac (diff) |
Move code for identity selection to function, move identities formatting to rcube_user::list_identities()
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r-- | program/lib/Roundcube/rcube_user.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php index 864f2e098..b027506ac 100644 --- a/program/lib/Roundcube/rcube_user.php +++ b/program/lib/Roundcube/rcube_user.php @@ -240,10 +240,12 @@ class rcube_user /** * Return a list of all identities linked with this user * - * @param string $sql_add Optional WHERE clauses + * @param string $sql_add Optional WHERE clauses + * @param bool $formatted Format identity email and name + * * @return array List of identities */ - function list_identities($sql_add = '') + function list_identities($sql_add = '', $formatted = false) { $result = array(); @@ -255,6 +257,15 @@ class rcube_user $this->ID); while ($sql_arr = $this->db->fetch_assoc($sql_result)) { + if ($formatted) { + $ascii_email = format_email($sql_arr['email']); + $utf8_email = format_email(rcube_utils::idn_to_utf8($ascii_email)); + + $sql_arr['email_ascii'] = $ascii_email; + $sql_arr['email'] = $utf8_email; + $sql_arr['ident'] = format_email_recipient($ascii_email, $ident['name']); + } + $result[] = $sql_arr; } |