From 76bf4b491a198d447d3401f5e01760fa6e69e44d Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 14 Aug 2008 13:13:29 +0000 Subject: [PATCH] Updated mailAccount & methods -Added folder and user prefix varible git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12215 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../mail/class_mail-methods-cyrus.inc | 10 +++++++ .../mail/personal/mail/class_mail-methods.inc | 2 ++ .../mail/personal/mail/class_mailAccount.inc | 27 +++++++++---------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc index e04ccaaa3..c1e524199 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc @@ -25,6 +25,9 @@ class mailMethodCyrus extends mailMethod var $gosaMailServer= ""; var $uattrib= "uid"; + var $folder_prefix = "share."; + var $user_prefix = "user."; + function mailMethodCyrus(&$config) { /* Check if the mail account identification attribute @@ -38,6 +41,13 @@ class mailMethodCyrus extends mailMethod trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.", $new_uattrib)); } } + + /* Create the account prefix user. user/ + Preset folder prefix. Will change it later to respect + altnamespace. */ + if ($config->get_cfg_value("cyrusunixstyle") == "true"){ + $this->user_prefix= "user/"; + } $this->config= $config->data['SERVERS']['IMAP']; } diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods.inc b/gosa-plugins/mail/personal/mail/class_mail-methods.inc index 422145069..a1f2af0ec 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods.inc @@ -22,6 +22,8 @@ class mailMethod { var $uattrib= "uid"; + var $folder_prefix = ""; + var $user_prefix = ""; function mailMethod(&$config) { diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc index 4918868be..23ff5785b 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -34,7 +34,9 @@ class mailAccount extends plugin var $quotaUsage = 0; var $forward_dialog = FALSE; + var $user_prefix = ""; var $folder_prefix = ""; + var $mailboxList = array("INBOX"); var $default_permissions = "none"; var $member_permissions = "post"; @@ -93,15 +95,11 @@ class mailAccount extends plugin } } - - /* Create the account prefix user. user/ - Preset folder prefix. Will change it later to respect - altnamespace. */ - if ($this->config->get_cfg_value("cyrusunixstyle") == "true"){ - $this->folder_prefix= "user/"; - } else { - $this->folder_prefix= "user."; - } + /* get user and folder prefix */ + $method = new $this->method($this->config); + $this->user_prefix = $method->user_prefix; + $this->folder_prefix = $method->folder_prefix; + /* This is not a new account, parse additional attributes */ if (($dn !== NULL) && ($dn != "new") && $this->is_account){ @@ -120,7 +118,6 @@ class mailAccount extends plugin /* Only do IMAP actions if gosaMailServer attribute is set */ if (isset ($this->attrs["gosaMailServer"][0])){ - $method = new $this->method($this->config); $id = $method->uattrib; /* Adapt attributes if needed */ @@ -135,7 +132,7 @@ class mailAccount extends plugin if ($method->connect($this->attrs["gosaMailServer"][0])){ /* Update quota values */ - $quota= $method->getQuota($this->folder_prefix.$this->$id); + $quota= $method->getQuota($this->user_prefix.$this->$id); if($quota){ if ($quota['gosaMailQuota'] == 2147483647){ @@ -151,7 +148,7 @@ class mailAccount extends plugin } /* Get mailboxes / folder like INBOX ..*/ - $this->mailboxList= $method->getMailboxList($this->folder_prefix.$this->$id,$this->$id); + $this->mailboxList= $method->getMailboxList($this->user_prefix.$this->$id,$this->$id); $method->disconnect(); }else{ @@ -704,7 +701,7 @@ class mailAccount extends plugin if ($method->connect($this->gosaMailServer)){ /* Remove account from IMAP server */ - $method->deleteMailbox($this->folder_prefix.$this->$id); + $method->deleteMailbox($this->user_prefix.$this->$id); $method->disconnect(); } } @@ -876,9 +873,9 @@ class mailAccount extends plugin if (!$this->is_template){ if ($method->connect($this->gosaMailServer)){ - $method->updateMailbox($this->folder_prefix.$this->$id); + $method->updateMailbox($this->user_prefix.$this->$id); - $method->setQuota($this->folder_prefix.$this->$id, $this->gosaMailQuota); + $method->setQuota($this->user_prefix.$this->$id, $this->gosaMailQuota); $method->disconnect(); /* Ensure that this is an existing account */ -- 2.30.2