summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a00ea99)
raw | patch | inline | side by side (parent: a00ea99)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 05:38:59 +0000 (05:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 05:38:59 +0000 (05:38 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3572 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/mail/class_mailAccount.inc | patch | blob | history |
diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc
index c7eea83a8681709d3277880718877d1b5ade267e..9982147537f88c2f655eadf3d0f09eabcccdf98b 100644 (file)
/* attribute list for save action */
var $attributes= array("mail", "gosaMailServer", "gosaMailQuota", "gosaMailMaxSize","gosaMailForwardingAddress",
"gosaMailDeliveryMode", "gosaSpamSortLevel", "gosaSpamMailbox","gosaMailAlternateAddress",
- "gosaVacationMessage", "uid", "gosaMailAlternateAddress", "gosaMailForwardingAddress");
+ "gosaVacationMessage", "gosaMailAlternateAddress", "gosaMailForwardingAddress");
var $objectclasses= array("gosaMailAccount");
/* Load bases attributes */
plugin::plugin($config, $dn);
-
- /**********************
- Set mailMethod to the one defined in gosa.conf
- **********************/
-
+ if(isset($this->attrs['uid'])){
+ $this->uid = $this->attrs['uid'];
+ }
+
+ /* Set mailMethod to the one defined in gosa.conf */
if (isset($this->config->current['MAILMETHOD'])){
$method= $this->config->current['MAILMETHOD'];
if (class_exists("mailMethod$method")){
}
- /**********************
- Create the account prefix user. user/
- **********************/
+ /* Create the account prefix user. user/ */
/* Preset folder prefix. Will change it later to respect
altnamespace. */
}
- /**********************
- This is not a new account, parse additional attributes
- **********************/
+ /* This is not a new account, parse additional attributes */
#FIXME i think is_account would be enough
if (($dn != NULL) && ($dn != "new") && $this->is_account){
$this->initially_was_account= $this->is_account;
- /**********************
- If there is a server defined, connect and get some more infos
- **********************/
+ /* If there is a server defined, connect and get some more infos */
/* Only do IMAP actions if gosaMailServer attribute is set */
if (isset ($this->attrs["gosaMailServer"][0])){
$quota= $method->getQuota($this->folder_prefix.$this->$id);
if($quota){
-
if ($quota['gosaMailQuota'] == 2147483647){
$this->quotaUsage = "";
$this->gosaMailQuota = "";
}else{
print_red(sprintf(_("Can't get quota for for '%s'."),$this->folder_prefix.$this->$id));
}
-
/* Get mailboxes / folder like INBOX ..*/
$this->mailboxList= $method->getMailboxList($this->folder_prefix.$this->$id,$this->$id);
}
- /**********************
- Get vacation message
- **********************/
+ /* Get vacation message */
/* Fill vacation array */
$this->vacation= array();
}
- /**********************
- Create filter
- **********************/
+ /* Create filter */
/* Get global filter config */
if (!is_global("mailfilter")){
function execute()
{
- /* Call parent execute */
- plugin::execute();
+ /* Call parent execute */
+ plugin::execute();
+
+ /* Initialise vars */
/* Load templating engine */
$smarty= get_smarty();
$display= "";
+ /* Get available mailserver */
$mailserver= array();
foreach ($this->config->data['SERVERS']['IMAP'] as $key => $val){
$mailserver[]= $key;
}
+ /* Handle account state */
+
/* Do we need to flip is_account state? */
if (isset($_POST['modify_state'])){
$this->is_account= !$this->is_account;
}
- /* Show main page */
- $mailserver= array();
- foreach ($this->config->data['SERVERS']['IMAP'] as $key => $val){
- $mailserver[]= $key;
- }
-
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
}
}
+
+ /* Forwarder subdialog */
+
/* Trigger forward add dialog? */
if (isset($_POST['add_local_forwarder'])){
$this->forward_dialog= TRUE;
}
}
+
+ /* Alternate address handling */
+
/* Add alternate email addresses */
if (isset($_POST['add_alternate'])){
if ($_POST['alternate_address'] != "" &&
}
}
+
+ /* Vocation message */
+
/* Import vacation message? */
if (isset($_POST["import_vacation"]) && isset($this->vacation[$_POST["vacation_template"]])){
$contents= "";
$this->gosaVacationMessage= htmlspecialchars($contents);
}
+
+ /* Display forward dialog if requested above */
+
/* Show forward add dialog */
if ($this->forward_dialog){
$ldap= $this->config->get_ldap_link();
return ($display);
}
+ /* Display mail account tab */
+
$smarty->assign("mailServers", $mailserver);
foreach(array("gosaMailServer", "gosaMailQuota", "perms", "mail",
"gosaMailAlternateAddress", "gosaMailForwardingAddress",
$smarty->assign("mailACL", "disabled");
}
- /* Fill checkboxes */
+
if (!preg_match("/L/", $this->gosaMailDeliveryMode)) {
$smarty->assign("drop_own_mails", "checked");
} else {
$smarty->assign("drop_own_mails", "");
}
+
+ $types = array(
+ "V"=>"use_vacation",
+ "S"=>"use_spam_filter",
+ "R"=>"use_mailsize_limit",
+ "I"=>"only_local",
+ "C"=>"own_script");
+
+ /* Fill checkboxes */
+ foreach($types as $option => $varname){
+ if (preg_match("/".$option."/", $this->gosaMailDeliveryMode)) {
+ $smarty->assign($varname, "checked");
+ } else {
+ $smarty->assign($varname, "");
+ }
+ }
+
if (preg_match("/V/", $this->gosaMailDeliveryMode)) {
$smarty->assign("use_vacation", "checked");
} else {
$method= new $this->method($this->config);
$method->fixAttributesOnRemove($this);
- /* Mailmethod wants us to remove the entry from LDAP. Keep uid! */
- #fixme: || kolab || is differs here, you can't delete all attrs specified in this plugin ....
- #fixme: there are some attributes we have to keep, i think.
- unset ($this->attrs['uid']);
-
-
-
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, "Save");
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
-
+
show_ldap_error($ldap->get_error(), _("Saving mail account failed"));
/* Only do IMAP actions if we are not a template */