From fba1f5ab813f2eb4bedc5d9c4a75e77bbaa90131 Mon Sep 17 00:00:00 2001 From: thomascube Date: Mon, 10 Dec 2007 15:27:19 +0000 Subject: New class rcube_user + send message disposition notification --- program/include/rcmail_template.inc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'program/include/rcmail_template.inc') diff --git a/program/include/rcmail_template.inc b/program/include/rcmail_template.inc index 558bd4bf6..cc5a58ac1 100644 --- a/program/include/rcmail_template.inc +++ b/program/include/rcmail_template.inc @@ -761,27 +761,15 @@ function rcmail_message_container($attrib) */ function rcmail_current_username($attrib) { - global $DB; + global $USER; static $s_username; // alread fetched if (!empty($s_username)) return $s_username; - // get e-mail address form default identity - $sql_result = $DB->query( - "SELECT email AS mailto - FROM ".get_table_name('identities')." - WHERE user_id=? - AND standard=1 - AND del<>1", - $_SESSION['user_id']); - - if ($DB->num_rows($sql_result)) - { - $sql_arr = $DB->fetch_assoc($sql_result); - $s_username = $sql_arr['mailto']; - } + if ($sql_arr = $USER->get_identity()) + $s_username = $sql_arr['email']; else if (strstr($_SESSION['username'], '@')) $s_username = $_SESSION['username']; else -- cgit v1.2.3