From 3e4be8c6a8a23bdeaada8a873ca63284c75e7d90 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 23 Oct 2006 03:59:55 +0000 Subject: [PATCH] Added dgroup mail fixes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4914 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/class_groupMail.inc | 40 +++++++++++++++++++----- plugins/admin/groups/tabs_group.inc | 10 ++++++ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index ce5ec423e..13b378c3c 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -40,7 +40,8 @@ class mailgroup extends plugin var $perms = array(); var $gosaMailDeliveryMode = "[L ]"; // var $gosaMailMaxSize = ""; // - + + var $remove_folder_from_imap = true; /* Helper */ var $indexed_acl= array(); @@ -317,10 +318,12 @@ class mailgroup extends plugin } } + $display = ""; /* Do we represent a valid account? */ if (!$this->is_account && $this->parent == NULL){ - $display= "\"\" ". + + $display.= "\"\" ". _("This 'dn' has no valid mail extensions.").""; return ($display); } @@ -329,11 +332,23 @@ class mailgroup extends plugin $display= ""; if ($this->parent != NULL){ if ($this->is_account){ - $display= $this->show_disable_header(_("Remove mail account"), + $display.= $this->show_disable_header(_("Remove mail account"), _("This account has mail features enabled. You can disable them by clicking below.")); } else { - $display= $this->show_enable_header(_("Create mail account"), + $display.= $this->show_enable_header(_("Create mail account"), _("This account has mail features disabled. You can enable them by clicking below.")); + + /* Show checkbox that allows us to remove imap entry too*/ + if($this->initially_was_account){ + $c = ""; + if($this->remove_folder_from_imap){ + $c= " checked "; + } + $display .= "

Shared folder delete options

+ "; + $display .= _("Remove the shared folder and all its contents from mail server."); + } return ($display); } } @@ -636,18 +651,19 @@ class mailgroup extends plugin /* Connect to IMAP server for account deletion */ if ($this->initially_was_account){ + $method= new $this->method($this->config); - if ($method->connect($this->gosaMailServer)){ + $method->fixAttributesOnRemove($this); + if ($method->connect($this->gosaMailServer) && $this->remove_folder_from_imap){ + /* 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(), sprintf(_("Removing of groups/mail with dn '%s' failed."),$this->dn)); @@ -660,6 +676,16 @@ class mailgroup extends plugin /* Save data to object */ function save_object() { + + /* Check if user wants to remove the shared folder from imap too */ + if($this->initially_was_account && !$this->is_account){ + if(isset($_POST['remove_folder_from_imap'])){ + $this->remove_folder_from_imap = true; + }else{ + $this->remove_folder_from_imap = false; + } + } + /* Assemble mail delivery mode The mode field in ldap consists of values between braces, this must be called when 'mail' is set, because checkboxes may not be set when diff --git a/plugins/admin/groups/tabs_group.inc b/plugins/admin/groups/tabs_group.inc index 7ae739b5c..6fa256f5d 100644 --- a/plugins/admin/groups/tabs_group.inc +++ b/plugins/admin/groups/tabs_group.inc @@ -33,6 +33,16 @@ class grouptabs extends tabs } } + function delete() + { + /* Put baseobjects 'cn' to mailobjects 'uid' */ + $baseobject= $this->by_object['group']; + if (isset($this->by_object['mailgroup'])){ + $this->by_object['mailgroup']->uid= $baseobject->cn; + } + tabs::delete(); + } + function save() { $baseobject= $this->by_object['group']; -- 2.30.2