/**
  * @param \RainLoop\Model\Account $oAccount
  * @param bool $bAuthLog = false
  *
  * @throws \RainLoop\Exceptions\ClientException
  */
 public function CheckMailConnection($oAccount, $bAuthLog = false)
 {
     try {
         $oAccount->IncConnectAndLoginHelper($this->Plugins(), $this->MailClient(), $this->Config());
     } catch (\RainLoop\Exceptions\ClientException $oException) {
         throw $oException;
     } catch (\MailSo\Net\Exceptions\ConnectionException $oException) {
         throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException);
     } catch (\MailSo\Imap\Exceptions\LoginBadCredentialsException $oException) {
         if ($bAuthLog) {
             $this->LoggerAuthHelper($oAccount);
         }
         if ($this->Config()->Get('labs', 'imap_show_login_alert', true)) {
             throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException, $oException->getAlertFromStatus());
         } else {
             throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException);
         }
     } catch (\Exception $oException) {
         throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException);
     }
 }
Esempio n. 2
0
 /**
  * @param \RainLoop\Model\Account $oAccount
  * @param bool $bAuthLog = false
  *
  * @throws \RainLoop\Exceptions\ClientException
  */
 public function CheckMailConnection($oAccount, $bAuthLog = false)
 {
     try {
         $oAccount->IncConnectAndLoginHelper($this->Plugins(), $this->MailClient(), $this->Config());
     } catch (\RainLoop\Exceptions\ClientException $oException) {
         throw $oException;
     } catch (\MailSo\Net\Exceptions\ConnectionException $oException) {
         throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException);
     } catch (\MailSo\Imap\Exceptions\LoginBadCredentialsException $oException) {
         if ($bAuthLog) {
             $sLine = $this->Config()->Get('logs', 'auth_logging_format', '');
             if (!empty($sLine)) {
                 $this->LoggerAuth()->Write($this->compileLogParams($sLine, $oAccount), \MailSo\Log\Enumerations\Type::WARNING, 'IMAP');
             }
         }
         if ($this->Config()->Get('labs', 'imap_show_login_alert', true)) {
             throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException, $oException->getAlertFromStatus());
         } else {
             throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException);
         }
     } catch (\Exception $oException) {
         throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException);
     }
 }