catch errors if there is NO configured account at all

This commit is contained in:
Klaus Leithoff 2013-12-05 09:08:14 +00:00
parent 53006083e9
commit 892cdf5775

View File

@ -206,7 +206,7 @@ class mail_bo
egw_cache::setSession('mail','activeProfileID',$_profileID);
}
//error_log(__METHOD__.__LINE__.' RestoreSession:'.$_restoreSession.' ProfileId:'.$_profileID.' called from:'.function_backtrace());
if (!isset(self::$instances[$_profileID]) || $_restoreSession===false)
if ($_profileID && (!isset(self::$instances[$_profileID]) || $_restoreSession===false))
{
self::$instances[$_profileID] = new mail_bo('utf-8',$_restoreSession,$_profileID);
}
@ -225,10 +225,13 @@ class mail_bo
$newprofileID = emailadmin_bo::getUserDefaultAccID();
// try loading the default profile for the user
error_log(__METHOD__.__LINE__." Loading the Profile for ProfileID ".$_profileID.' failed for icServer; '.$e->getMessage().' Trigger new instance for Default-Profile '.$newprofileID.'. called from:'.function_backtrace());
if ($newprofileID)
{
self::$instances[$newprofileID] = new mail_bo('utf-8',false,$newprofileID);
$_profileID = $newprofileID;
}
}
}
self::$instances[$_profileID]->profileID = $_profileID;
if (!isset(self::$instances[$_profileID]->idna2)) self::$instances[$_profileID]->idna2 = new egw_idna;
//if ($_profileID==0); error_log(__METHOD__.__LINE__.' RestoreSession:'.$_restoreSession.' ProfileId:'.$_profileID);