summaryrefslogtreecommitdiff
path: root/program/include/rcmail_template.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcmail_template.inc')
-rw-r--r--program/include/rcmail_template.inc18
1 files changed, 3 insertions, 15 deletions
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