Code

Added new style dialog
[gosa.git] / gosa-plugins / mail / personal / mail / class_mail-methods-sendmail-cyrus.inc
index 8bb8d73be5ba14f57060d9f12b34dacfd8f0ca3c..70908a385a9b2ca3d62479da709e80d2e9853045 100644 (file)
 class mailMethodSendmailCyrus extends mailMethodCyrus
 {
 
-  function mailMethodSendmailCyrus(&$config)
-  {
-    $this->config= $config->data['SERVERS']['IMAP'];
-  }
-
-  function fixAttributesOnLoad(&$mailObject)
+  public function fixAttributesOnLoad()
   {
     /* Remove possible local alias from forwarders */
-    $newForwarder= array();
-    foreach ($mailObject->gosaMailForwardingAddress as $addr){
-      if (!preg_match('/^\\\\/', $addr)){
-        $newForwarder[]= $addr;
+    mailMethodCyrus::fixAttributesOnLoad();
+    if(isset($this->parent->attrs['gosaMailForwardingAddress'])){
+      $newForwarder= array();
+      for($i = 0; $i < $this->parent->attrs['gosaMailForwardingAddress']['count']; $i++){
+        $addr = $this->parent->attrs['gosaMailForwardingAddress'][$i];
+        if (!preg_match('/^\\\\/', $addr)){
+          $newForwarder[]= $addr;
+        }
       }
+      $newForwarder['count'] = count($newForwarder);
+      $this->parent->attrs['gosaMailForwardingAddress'] = $newForwarder;
     }
-    $mailObject->gosaMailForwardingAddress= $newForwarder;
   }
 
-  function fixAttributesOnStore(&$mailObject)
+  public function fixAttributesOnStore()
   {
+    mailMethodCyrus::fixAttributesOnStore();
+
     /* Add local user if checked */
+    $uattrib = $this->getUAttrib();
     if (preg_match("/L/", $mailObject->gosaMailDeliveryMode)) {
-      $mailObject->gosaMailForwardingAddress[]= "\\".$mailObject->uid;
+      if(!isset($this->parent->attrs['gosaMailForwardingAddress'])){
+        $this->parent->attrs['gosaMailForwardingAddress'] = array();
+      }
+      $this->parent->attrs['gosaMailForwardingAddress'][]= "\\".$this->parent->$uattrib;
     }
   }