Code

Check for valid imap servers.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Dec 2008 11:51:04 +0000 (11:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Dec 2008 11:51:04 +0000 (11:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13258 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc

index 152daee4d5ec2d1d74fb3b119f82c1b704143116..83876021874e2a7d546afa74abbd658cb9faf8ec 100644 (file)
@@ -25,15 +25,22 @@ class mailMethodCyrus extends mailMethod{
   protected function init()
   {
     mailMethod::init();
-    $this->ServerList = $this->config->data['SERVERS']['IMAP']; 
+    if(isset($this->config->data['SERVERS']['IMAP'])){
+      $this->ServerList = $this->config->data['SERVERS']['IMAP']; 
+    }
   }
 
   
   public function connect()
   {
     mailMethod::connect();
-    if (!isset($this->ServerList[$this->MailServer])){
+
+    if(!count($this->ServerList)){
+      $this->error = _("There are no imap compatible mail servers defined!");
+      @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,
+          "<b>IMAP: No mail servers configured, check systems->server->service->imap.</b>","");
+      return(FALSE);
+    }elseif (!isset($this->ServerList[$this->MailServer])){
       $this->error = _("Mail server for this account is invalid!");
       @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,
           "<b>IMAP: The selected mail server '".$this->MailServer."' is invalid.</b>","");