index 31557a6c4c12aa858266cacd3f4ca4826feddfa5..b4bdc2962562fe5a5a8d1c9cd3ae86f04cccd983 100644 (file)
var $uid = ""; // User id
var $cn = ""; // cn
var $uid = ""; // User id
var $cn = ""; // cn
+ var $orig_cn = ""; // cn
var $method = "mailMethod"; // Used Mail method
var $mmethod = ""; // Contains the gosa.conf MAILMETHOD
var $method = "mailMethod"; // Used Mail method
var $mmethod = ""; // Contains the gosa.conf MAILMETHOD
var $perms = array();
var $gosaMailDeliveryMode = "[L ]"; //
var $gosaMailMaxSize = ""; //
var $perms = array();
var $gosaMailDeliveryMode = "[L ]"; //
var $gosaMailMaxSize = ""; //
-
+
+ var $remove_folder_from_imap = true;
/* Helper */
var $indexed_acl= array();
var $indexed_user= array();
/* Helper */
var $indexed_acl= array();
var $indexed_user= array();
+ /* Copy & paste */
+ var $CopyPasteVars = array("quotaUsage","imapacl");
+
/* attribute list for save action */
var $attributes= array( "mail", "gosaMailServer", "gosaMailQuota", "gosaMailMaxSize",
"gosaMailAlternateAddress", "gosaMailForwardingAddress",
/* attribute list for save action */
var $attributes= array( "mail", "gosaMailServer", "gosaMailQuota", "gosaMailMaxSize",
"gosaMailAlternateAddress", "gosaMailForwardingAddress",
*/
plugin::plugin($config, $dn, $parent);
*/
plugin::plugin($config, $dn, $parent);
+ /* Save initial cn */
+ $this->orig_cn = $this->cn;
+
/* Set mailMethod to the one defined in gosa.conf
*/
if (isset($this->config->current['MAILMETHOD'])){
/* Set mailMethod to the one defined in gosa.conf
*/
if (isset($this->config->current['MAILMETHOD'])){
/* Load templating engine */
$smarty= get_smarty();
/* Load templating engine */
$smarty= get_smarty();
+ $display = "";
if ($_SESSION['js']==FALSE){
$smarty->assign("javascript", "false");
} else {
if ($_SESSION['js']==FALSE){
$smarty->assign("javascript", "false");
} else {
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent == NULL){
/* 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);
}
_("This 'dn' has no valid mail extensions.")."</b>";
return ($display);
}
$display= $this->show_header(_("Remove mail account"),
_("This account has mail features enabled. You can disable them by clicking below."));
} else {
$display= $this->show_header(_("Remove mail account"),
_("This account has mail features enabled. You can disable them by clicking below."));
} else {
- $display= $this->show_header(_("Create mail account"),
+ $display.= $this->show_header(_("Create mail account"),
_("This account has mail features disabled. You can enable them by clicking below."));
_("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 when entry gets removed in LDAP")."'>";
+ $display .= _("Remove the shared folder and all its contents after saving this account");
+ }
+
return ($display);
}
}
return ($display);
}
}
/* Connect to IMAP server for account deletion */
if ($this->initially_was_account){
/* Connect to IMAP server for account deletion */
if ($this->initially_was_account){
+
$method= new $this->method($this->config);
$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();
}
/* Remove account from IMAP server */
$method->deleteMailbox($this->uid);
$method->disconnect();
}
- $method->fixAttributesOnRemove($this);
}
/* Keep uid */
unset ($this->attrs['uid']);
}
/* Keep uid */
unset ($this->attrs['uid']);
-
$ldap->cd($this->dn);
$ldap->modify ($this->attrs);
show_ldap_error($ldap->get_error(), _("Removing group mail settings failed"));
$ldap->cd($this->dn);
$ldap->modify ($this->attrs);
show_ldap_error($ldap->get_error(), _("Removing group mail settings failed"));
/* Save data to object */
function save_object()
{
/* 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
/* 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
}
$ldap->cd($this->config->current['BASE']);
$ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=".$this->mail.")(gosaMailAlternateAddress=".
}
$ldap->cd($this->config->current['BASE']);
$ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=".$this->mail.")(gosaMailAlternateAddress=".
- $this->mail."))(!(uid=".$this->cn."))(!(cn=".$this->cn.")))");
+ $this->mail."))(!(uid=".$this->orig_cn."))(!(cn=".$this->orig_cn.")))");
if ($ldap->count() != 0){
$message[]= _("The primary address you've entered is already in use.");
}
if ($ldap->count() != 0){
$message[]= _("The primary address you've entered is already in use.");
}
}
}
}
}
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+ /* Reset alternate mail addresses */
+ $this->gosaMailAlternateAddress = array();
+ }
}
}
-
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>