From 7e9cecda9804e6137566795d67d6b6b5f95dd343 Mon Sep 17 00:00:00 2001 From: thomascube Date: Tue, 27 May 2008 14:36:59 +0000 Subject: Code cleanup: use common objects and methods --- program/include/rcube_template.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'program/include/rcube_template.php') diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index df6c3ccfc..d519f7533 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -829,7 +829,6 @@ class rcube_template extends rcube_html_page */ public function current_username($attrib) { - global $USER; static $username; // alread fetched @@ -838,14 +837,11 @@ class rcube_template extends rcube_html_page } // get e-mail address form default identity - if ($sql_arr = $USER->get_identity()) { - $s_username = $sql_arr['email']; - } - else if (strstr($_SESSION['username'], '@')) { - $username = $_SESSION['username']; + if ($sql_arr = $this->app->user->get_identity()) { + $username = $sql_arr['email']; } else { - $username = $_SESSION['username'].'@'.$_SESSION['imap_host']; + $username = $this->app->user->get_username(); } return $username; -- cgit v1.2.3