mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:07 +01:00
Try to catch exceptions from none existing account
This commit is contained in:
parent
0aa23fe1d3
commit
fd8b4a72f6
@ -170,7 +170,7 @@ class mail_bo
|
||||
* not matching the input profileID, if we can not find a profile matching the given ID
|
||||
* @return mail_bo
|
||||
*/
|
||||
public static function getInstance($_restoreSession=true, $_profileID=0, $_validate=true)
|
||||
public static function getInstance($_restoreSession=true, &$_profileID=0, $_validate=true)
|
||||
{
|
||||
//$_restoreSession=false;
|
||||
//error_log(__METHOD__.__LINE__.' RestoreSession:'.$_restoreSession.' ProfileId:'.$_profileID.' called from:'.function_backtrace());
|
||||
@ -261,7 +261,7 @@ class mail_bo
|
||||
}
|
||||
if (self::$debug) error_log(__METHOD__."($_acc_id) account NOT valid, no imap-host!");
|
||||
}
|
||||
catch (egw_exception_not_found $e) {
|
||||
catch (Exception $e) {
|
||||
unset($e);
|
||||
if (self::$debug) error_log(__METHOD__."($_acc_id) account NOT found!");
|
||||
}
|
||||
|
@ -119,9 +119,15 @@ class mail_hooks
|
||||
$profileID = 0;
|
||||
if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
|
||||
$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
|
||||
try
|
||||
{
|
||||
$mail_bo = mail_bo::getInstance(true,$profileID);
|
||||
$profileID = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = $mail_bo->profileID;
|
||||
} catch (Exception $ex) {
|
||||
error_log(__METHOD__."()" . $ex->getMessage());
|
||||
$profileID = null;
|
||||
}
|
||||
|
||||
$mail_bo = mail_bo::getInstance(true,$profileID);
|
||||
$profileID = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = $mail_bo->profileID;
|
||||
if($profileID && $mail_bo->openConnection($profileID)) {
|
||||
$folderObjects = $mail_bo->getFolderObjects(true, false);
|
||||
foreach($folderObjects as $folderName => $folderInfo) {
|
||||
@ -732,9 +738,15 @@ class mail_hooks
|
||||
$profileID = 0;
|
||||
if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
|
||||
$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
|
||||
try
|
||||
{
|
||||
$mail_bo = mail_bo::getInstance(true,$profileID);
|
||||
$profileID = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = $mail_bo->profileID;
|
||||
} catch (Exception $ex) {
|
||||
error_log(__METHOD__."()" . $ex->getMessage());
|
||||
$profileID = null;
|
||||
}
|
||||
|
||||
$mail_bo = mail_bo::getInstance(true,$profileID);
|
||||
$profileID = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = $mail_bo->profileID;
|
||||
$preferences =& $mail_bo->mailPreferences;
|
||||
$serverCounter = $sieveEnabledServerCounter = 0;
|
||||
if (count($preferences->ic_server)) {
|
||||
|
Loading…
Reference in New Issue
Block a user