use different method to determine the default/Global profile for the current User

This commit is contained in:
Klaus Leithoff 2012-11-20 14:00:03 +00:00
parent e861c2e0ed
commit 42660ddfa1
2 changed files with 4 additions and 3 deletions

View File

@ -158,11 +158,11 @@ class felamimail_activesync implements activesync_plugin_write, activesync_plugi
$identities = array(); $identities = array();
if (!isset($params['setup'])) if (!isset($params['setup']))
{ {
if (!$this->mail) $this->mail = felamimail_bo::getInstance(true,(self::$profileID=='G'?0:self::$profileID)); if (!$this->mail) $this->mail = felamimail_bo::getInstance(true,(self::$profileID=='G'?emailadmin_bo::getUserDefaultProfileID():self::$profileID));
$selectedID = $this->mail->getIdentitiesWithAccounts($identities); $selectedID = $this->mail->getIdentitiesWithAccounts($identities);
if (self::$profileID=='G') if (self::$profileID=='G')
{ {
if (is_object($this->mail->mailPreferences)) $activeIdentity =& $this->mail->mailPreferences->getIdentity(0); if (is_object($this->mail->mailPreferences)) $activeIdentity =& $this->mail->mailPreferences->getIdentity(emailadmin_bo::getUserDefaultProfileID());
} }
else else
{ {

View File

@ -169,9 +169,10 @@ class felamimail_bo
{ {
if ($_profileID == 0) if ($_profileID == 0)
{ {
$profileID = emailadmin_bo::getDefaultProfileID(); $profileID = emailadmin_bo::getUserDefaultProfileID();
if ($profileID!=$_profileID) $_restoreSession==false; if ($profileID!=$_profileID) $_restoreSession==false;
$_profileID=$profileID; $_profileID=$profileID;
error_log(__METHOD__.__LINE__.' called with profileID==0 using '.$profileID.' instead->'.function_backtrace());
} }
if ($_profileID != 0 && $_validate) if ($_profileID != 0 && $_validate)
{ {