From fba1f5ab813f2eb4bedc5d9c4a75e77bbaa90131 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 10 Dec 2007 10:27:19 -0500
Subject: [PATCH] New class rcube_user + send message disposition notification

---
 program/include/rcmail_template.inc |   18 +++---------------
 1 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/program/include/rcmail_template.inc b/program/include/rcmail_template.inc
index 558bd4b..cc5a58a 100644
--- a/program/include/rcmail_template.inc
+++ b/program/include/rcmail_template.inc
@@ -761,27 +761,15 @@
  */
 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

--
Gitblit v1.9.1