From 01bd9c6eedc08b9489af21f84681b9a7f040eafa Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 2 Mar 2006 12:36:13 +0000 Subject: [PATCH] Fixed mail stuff, to be able to remove groups git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2804 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_mail-methods-kolab.inc | 6 ++++-- plugins/admin/groups/class_groupMail.inc | 26 ++++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/include/class_mail-methods-kolab.inc b/include/class_mail-methods-kolab.inc index ecc405d8d..59e9aceb5 100644 --- a/include/class_mail-methods-kolab.inc +++ b/include/class_mail-methods-kolab.inc @@ -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); } } diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index 32ae8a21d..a3a3cc957 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -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"); -- 2.30.2