try to catch an empty connection error object too, while trying to auto recover on errors; try to disconnect, when connect was successful, but no username for login is supplied

This commit is contained in:
Klaus Leithoff 2011-10-10 10:17:07 +00:00
parent f444bb253d
commit 014775ab14
2 changed files with 2 additions and 1 deletions

View File

@ -535,6 +535,7 @@ class defaultimap extends Net_IMAP
if(empty($username))
{
if ($this->debug) error_log(__METHOD__."No username supplied.".function_backtrace());
if ($this->_connected) $this->disconnect(); // disconnect (if connected)
return false;
}
if( PEAR::isError($status = parent::login($username, $password, 'LOGIN', !$this->isAdminConnection)) ) {

View File

@ -3391,7 +3391,7 @@ class felamimail_bo
if (is_null($isError)) $isError =& egw_cache::getSession('email','icServerIMAP_connectionError');
if ( isset($isError[$_icServerID]) || PEAR::isError($this->icServer->_connectionErrorObject))
{
if (trim($isError[$_icServerID])==',')
if (trim($isError[$_icServerID])==',' || trim($this->icServer->_connectionErrorObject->message) == ',')
{
//error_log(__METHOD__.__LINE__.' Connection seemed to have failed in the past, no real reason given, try to recover on our own.');
emailadmin_bo::unsetCachedObjects($_icServerID);