index 302f582fbbbdc42dc2575d860aaf145f14d32a69..13b378c3c2921ce70a42683ed5669132a354d7a3 100644 (file)
var $perms = array();
var $gosaMailDeliveryMode = "[L ]"; //
var $gosaMailMaxSize = ""; //
-
+
+ var $remove_folder_from_imap = true;
/* Helper */
var $indexed_acl= array();
}
}
+ $display = "";
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent == NULL){
- $display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
+
+ $display.= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
_("This 'dn' has no valid mail extensions.")."</b>";
return ($display);
}
$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 .= "<h2>Shared folder delete options</h2>
+ <input class='center' type='checkbox' name='remove_folder_from_imap' value='1' ".$c."
+ title='"._("Remove shared folder from mail server database")."'>";
+ $display .= _("Remove the shared folder and all its contents from mail server.");
+ }
return ($display);
}
}
if ($nr == $count - 1){
if($this->acl_is_writeable("acl")){
$tmp.= "<input type=submit value=\""._("Add")."\" ".
- "name=\"add_$nr\" $perm>";
+ "name=\"add_$nr\" >";
}
}
if ($count > 3){
if($this->acl_is_writeable("acl")){
$tmp.= "<input type=submit value=\""._("Remove")."\" ".
- "name=\"del_$nr\" $perm></td></tr>";
+ "name=\"del_$nr\" ></td></tr>";
}
}
}
/* 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));
/* 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
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){
if ($this->is_modified){
- $this->handle_post_events("mofify");
+ $this->handle_post_events("modify");
}
} else {
$this->handle_post_events("add");