Code

Fixed mail stuff, to be able to remove groups
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 2 Mar 2006 12:36:13 +0000 (12:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 2 Mar 2006 12:36:13 +0000 (12:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2804 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_mail-methods-kolab.inc
plugins/admin/groups/class_groupMail.inc

index ecc405d8d83a8b7dbbde8e7a75085984f7023345..59e9aceb5b661adfbe1df3cec6819ba8c55b02d5 100644 (file)
@@ -181,8 +181,10 @@ class mailMethodKolab extends mailMethodCyrus
   {
     /* Add attribute for object deletion and remove GOsa specific
        values from entry. */
-    unset ($mailObject->attrs['mail']);
-    $mailObject->attrs['kolabDeleteFlag']= preg_replace('%imap://%', '', $mailObject->gosaMailServer);
+    foreach($this->attribute_map as $kolabAttr){
+      $mailObject->attrs[$kolabAttr] = array();
+    }  
+    //$mailObject->attrs['kolabDeleteFlag']= preg_replace('%imap://%', '', $mailObject->gosaMailServer);
   }
 
 }
index 32ae8a21dde9d536b81a00172b9da46d6a323425..a3a3cc957122d4bdb203189d83a3c3fd660c6cdc 100644 (file)
@@ -269,6 +269,11 @@ class mailgroup extends plugin
       }
     }
 
+    /* Load Mailserver  
+     */
+    if(isset($this->attrs['gosaMailServer'][0])){
+      $this->gosaMailServer =  $this->attrs['gosaMailServer'][0];
+    }
     /* Fill translations */
     $this->perms["lrs"]= _("read");
     $this->perms["lrsp"]= _("post");
@@ -569,7 +574,6 @@ class mailgroup extends plugin
      */
     if(isset($this->config->current['MAILMETHOD'])&&preg_match("/kolab/i",$this->config->current['MAILMETHOD'])){
       $this->attributes[]="acl";
-      $this->attributes[]="kolabHomeServer";
       $this->objectclasses[] = "kolabSharedFolder";
     }
     /* include global link_info */
@@ -583,24 +587,24 @@ class mailgroup extends plugin
     $this->attrs['gosaMailForwardingAddress']= array();
     $this->attrs['gosaSharedFolderTarget']= array();
 
-    /* Keep uid */
-    unset ($this->attrs['uid']);
-    $ldap->cd($this->dn);
-    $this->cleanup();
-    $ldap->modify ($this->attrs); 
-
-    show_ldap_error($ldap->get_error());
-
     /* Connect to IMAP server for account deletion */
-    if ($this->is_account){
+    if ($this->initially_was_account){
       $method= new $this->method($this->config);
-      if ($method->connect($this->attrs["gosaMailServer"][0])){
+      if ($method->connect($this->gosaMailServer)){
         /* Remove account from IMAP server */
         $method->deleteMailbox($this->uid);
         $method->disconnect();
       }
       $method->fixAttributesOnRemove($this);
     }
+    /* Keep uid */
+    unset ($this->attrs['uid']);
+
+
+    $ldap->cd($this->dn);
+    $ldap->modify ($this->attrs); 
+
+    show_ldap_error($ldap->get_error());
 
     /* Optionally execute a command after we're done */
     $this->handle_post_events("remove");