From 82c45a19529e818dc6b290491e79e7e2feeedcf6 Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 10 Apr 2009 08:16:41 +0000 Subject: - clean up, use simpler _get_email() replacement --- program/steps/settings/edit_identity.inc | 2 +- program/steps/settings/func.inc | 19 ------------------- program/steps/settings/save_identity.inc | 2 +- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc index 9d3ff4c51..4129409bb 100644 --- a/program/steps/settings/edit_identity.inc +++ b/program/steps/settings/edit_identity.inc @@ -43,7 +43,7 @@ else { return; } else if (IDENTITIES_LEVEL == 1) - $IDENTITY_RECORD['email'] = rcmail_get_email(); + $IDENTITY_RECORD['email'] = $RCMAIL->user->get_username(); } diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index d0a3ae69c..3f0357717 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -469,24 +469,6 @@ function rcmail_get_skins() } -function rcmail_get_email() - { - global $RCMAIL; - - if (strpos($RCMAIL->user->data['username'], '@')) - return $RCMAIL->user->data['username']; - else { - if ($RCMAIL->config->get('virtuser_file')) - $user_email = rcube_user::user2email($RCMAIL->user->data['username']); - - if ($user_email == '') - $user_email = sprintf('%s@%s', $RCMAIL->user->data['username'], - $RCMAIL->config->mail_domain($_SESSION['imap_host'])); - - return $user_email; - } - } - // register UI objects $OUTPUT->add_handlers(array( 'userprefs' => 'rcmail_user_prefs_form', @@ -494,5 +476,4 @@ $OUTPUT->add_handlers(array( 'itentitieslist' => 'rcmail_identities_list' // keep this for backward compatibility )); - ?> diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index b34575dce..dba385f49 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -86,7 +86,7 @@ if ($_POST['_iid']) else if (IDENTITIES_LEVEL < 2) { if (IDENTITIES_LEVEL == 1) - $save_data['email'] = rcmail_get_email(); + $save_data['email'] = $RCMAIL->user->get_username(); if ($save_data['email'] && ($insert_id = $USER->insert_identity($save_data))) { -- cgit v1.2.3