forked from extern/egroupware
try to catch exeptions on ->no mail-accounts available at all<-
This commit is contained in:
parent
fb311f3ebf
commit
4bbda170bd
@ -242,8 +242,15 @@ class mail_bo
|
|||||||
// try loading the default profile for the user
|
// 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());
|
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)
|
if ($newprofileID)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
self::$instances[$newprofileID] = new mail_bo('utf-8',false,$newprofileID);
|
self::$instances[$newprofileID] = new mail_bo('utf-8',false,$newprofileID);
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
throw new egw_exception(__METHOD__." failed to instanciate mail_bo for $newprofileID with error:".$e->getMessage());;
|
||||||
|
}
|
||||||
$_profileID = $newprofileID;
|
$_profileID = $newprofileID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,11 +330,18 @@ class mail_bo
|
|||||||
$this->sessionData = array();
|
$this->sessionData = array();
|
||||||
$this->forcePrefReload();
|
$this->forcePrefReload();
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
$this->profileID = self::validateProfileID($_profileID);
|
$this->profileID = self::validateProfileID($_profileID);
|
||||||
$this->accountid = $GLOBALS['egw_info']['user']['account_id'];
|
$this->accountid = $GLOBALS['egw_info']['user']['account_id'];
|
||||||
|
|
||||||
//error_log(__METHOD__.__LINE__." ProfileID ".$this->profileID.' called from:'.function_backtrace());
|
//error_log(__METHOD__.__LINE__." ProfileID ".$this->profileID.' called from:'.function_backtrace());
|
||||||
$acc = emailadmin_account::read($this->profileID);
|
$acc = emailadmin_account::read($this->profileID);
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
throw new egw_exception(__METHOD__." failed to instanciate mail_bo for $_profileID / ".$this->profileID." with error:".$e->getMessage());;
|
||||||
|
}
|
||||||
//error_log(__METHOD__.__LINE__.array2string($acc->imapServer()));
|
//error_log(__METHOD__.__LINE__.array2string($acc->imapServer()));
|
||||||
$this->icServer = ($_oldImapServerObject?$acc->oldImapServer():$acc->imapServer());
|
$this->icServer = ($_oldImapServerObject?$acc->oldImapServer():$acc->imapServer());
|
||||||
$this->ogServer = $acc->smtpServer();
|
$this->ogServer = $acc->smtpServer();
|
||||||
|
@ -2588,7 +2588,7 @@ unset($query['actions']);
|
|||||||
*/
|
*/
|
||||||
function vfsSaveAttachment($ids,$path)
|
function vfsSaveAttachment($ids,$path)
|
||||||
{
|
{
|
||||||
error_log(__METHOD__.__LINE__.'("'.array2string($ids).'","'.$path."\")');");
|
//error_log(__METHOD__.__LINE__.'("'.array2string($ids).'","'.$path."\")');");
|
||||||
|
|
||||||
if (is_array($ids) && !egw_vfs::is_writable($path) || !is_array($ids) && !egw_vfs::is_writable(dirname($path)))
|
if (is_array($ids) && !egw_vfs::is_writable($path) || !is_array($ids) && !egw_vfs::is_writable(dirname($path)))
|
||||||
{
|
{
|
||||||
@ -2603,8 +2603,8 @@ unset($query['actions']);
|
|||||||
$mailbox = $hA['folder'];
|
$mailbox = $hA['folder'];
|
||||||
//error_log(__METHOD__.__LINE__.array2string($hA));
|
//error_log(__METHOD__.__LINE__.array2string($hA));
|
||||||
$this->mail_bo->reopen($mailbox);
|
$this->mail_bo->reopen($mailbox);
|
||||||
$attachment = $this->mail_bo->getAttachment($uid,$part,$is_winmail);
|
$attachment = $this->mail_bo->getAttachment($uid,$part,$is_winmail,false);
|
||||||
|
//error_log(__METHOD__.__LINE__.array2string($attachment));
|
||||||
if (!($fp = egw_vfs::fopen($file=$path.($name ? '/'.$name : ''),'wb')) ||
|
if (!($fp = egw_vfs::fopen($file=$path.($name ? '/'.$name : ''),'wb')) ||
|
||||||
!fwrite($fp,$attachment['attachment']))
|
!fwrite($fp,$attachment['attachment']))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user