when dealing with defaults and identities: retrieve the default identity associated with the current imap-account, rather than the default

This commit is contained in:
Klaus Leithoff 2015-02-19 11:32:38 +00:00
parent 5f0c0f6804
commit 94af47ef5d

View File

@ -374,6 +374,9 @@ class mail_compose
$this->changeProfile($_content['serverID']); $this->changeProfile($_content['serverID']);
$composeProfile = $this->mail_bo->profileID; $composeProfile = $this->mail_bo->profileID;
} }
// make sure $acc is set/initalized properly with the current composeProfile, as $acc is used down there
// at several locations and not neccesaryly initialized before
$acc = emailadmin_account::read($composeProfile);
$buttonClicked = false; $buttonClicked = false;
if ($_content['composeToolbar'] === 'send') if ($_content['composeToolbar'] === 'send')
{ {
@ -1022,7 +1025,7 @@ class mail_compose
// fetch the signature, prepare the select box, ... // fetch the signature, prepare the select box, ...
if (empty($content['mailidentity'])) { if (empty($content['mailidentity'])) {
$content['mailidentity'] = $acc['ident_id']; $content['mailidentity'] = $acc['ident_id']?$acc['ident_id']:$acc['acc_id'];
} }
$disableRuler = false; $disableRuler = false;
@ -3057,8 +3060,8 @@ class mail_compose
*/ */
function setDefaults($content=array()) function setDefaults($content=array())
{ {
// retrieve the signature accociated with the identity // retrieve the signature accociated with the identity associated with the current account, rather than the default
$id = $this->mail_bo->getDefaultIdentity(); $id = ($this->mail_bo->icServer->ident_id?$this->mail_bo->icServer->ident_id:$this->mail_bo->getDefaultIdentity());
if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['LastSignatureIDUsed']) && !empty($GLOBALS['egw_info']['user']['preferences']['mail']['LastSignatureIDUsed'])) if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['LastSignatureIDUsed']) && !empty($GLOBALS['egw_info']['user']['preferences']['mail']['LastSignatureIDUsed']))
{ {
$sigPref = $GLOBALS['egw_info']['user']['preferences']['mail']['LastSignatureIDUsed']; $sigPref = $GLOBALS['egw_info']['user']['preferences']['mail']['LastSignatureIDUsed'];