Code

Udpated mail methods.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Feb 2008 13:12:34 +0000 (13:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Feb 2008 13:12:34 +0000 (13:12 +0000)
-Improved configuration falg detection for MAIL_ATTRIB

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8910 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_mail-methods-cyrus.inc
include/class_mail-methods-golab.inc
include/class_mail-methods-kolab.inc
include/class_mail-methods-sendmail-cyrus.inc
include/class_mail-methods.inc

index 2812f63b35ef54cb6894f5726c09b51e813fac72..6c822691b210e6088d12add1a88827abdec59e29 100644 (file)
@@ -30,8 +30,13 @@ var $uattrib= "uid";
     /* Check if the mail account identification attribute
        is overridden in the configuration file
      */
-    if(isset($config->current['MAIL_ATTRIB'])){
-      $this->uattrib = $config->current['MAIL_ATTRIB'];
+    if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){
+      $new_uattrib= strtolower($config->current['MAIL_ATTRIB']);
+      if(in_array($new_uattrib,array("mail","uid"))){
+        $this->uattrib = $new_uattrib;
+      }else{
+        trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.",            $new_uattrib));
+      }
     }
 
     $this->config= $config->data['SERVERS']['IMAP'];
index 64cd7dd69f2b7c711e39f05a089cc1985358442b..0ac850459fb122dce9dc82092e4fe45efa542cf3 100644 (file)
@@ -35,8 +35,13 @@ class mailMethodGolab extends mailMethodCyrus
     /* Check if the mail account identification attribute
        is overridden in the configuration file
      */
-    if(isset($config->current['MAIL_ATTRIB'])){
-      $this->uattrib = $config->current['MAIL_ATTRIB'];
+    if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){
+      $new_uattrib= strtolower($config->current['MAIL_ATTRIB']);
+      if(in_array($new_uattrib,array("mail","uid"))){
+        $this->uattrib = $new_uattrib;
+      }else{
+        trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.",            $new_uattrib));
+      }
     }
 
     $this->config= $config->data['SERVERS']['IMAP'];
index a4944df64636f187af39ad4da16f0a65d963c9ad..61d15c47fdf5b50c6936521383fb3dd670802dd0 100644 (file)
@@ -35,8 +35,13 @@ class mailMethodKolab extends mailMethodCyrus
     /* Check if the mail account identification attribute
        is overridden in the configuration file
      */
-    if(isset($config->current['MAIL_ATTRIB'])){
-      $this->uattrib = $config->current['MAIL_ATTRIB'];
+    if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){
+      $new_uattrib= strtolower($config->current['MAIL_ATTRIB']);
+      if(in_array($new_uattrib,array("mail","uid"))){
+        $this->uattrib = $new_uattrib;
+      }else{
+        trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.",            $new_uattrib));
+      }
     }
 
     $this->config= $config->data['SERVERS']['IMAP'];
index 255c855294a1df0094fe87f2fc64de4c988b47ee..ede415d6259dbdcf40f9a3b366788957fe132780 100644 (file)
@@ -27,8 +27,13 @@ class mailMethodSendmailCyrus extends mailMethodCyrus
     /* Check if the mail account identification attribute
        is overridden in the configuration file
      */
-    if(isset($config->current['MAIL_ATTRIB'])){
-      $this->uattrib = $config->current['MAIL_ATTRIB'];
+    if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){
+      $new_uattrib= strtolower($config->current['MAIL_ATTRIB']);
+      if(in_array($new_uattrib,array("mail","uid"))){
+        $this->uattrib = $new_uattrib;
+      }else{
+        trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.",$new_uattrib));
+      }
     }
 
     $this->config= $config->data['SERVERS']['IMAP'];
index 9c7c428fe5d79df7bb1b5564e551fd5dd31c3bb3..ad317fd20f9c809fe1a14067042f8abe5e0a59dc 100644 (file)
@@ -28,8 +28,13 @@ class mailMethod
     /* Check if the mail account identification attribute
        is overridden in the configuration file
      */
-    if(isset($config->current['MAIL_ATTRIB'])){
-      $this->uattrib = $config->current['MAIL_ATTRIB'];
+    if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){
+      $new_uattrib= strtolower($config->current['MAIL_ATTRIB']);
+      if(in_array($new_uattrib,array("mail","uid"))){
+        $this->uattrib = $new_uattrib;
+      }else{
+        trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.",            $new_uattrib));
+      }
     }
   }