From: hickert Date: Tue, 9 Dec 2008 09:47:52 +0000 (+0000) Subject: Updated mail method.s X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b3b8235583c90cf067908dcce268958c48c22ca8;p=gosa.git Updated mail method.s git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13198 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc b/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc index a15945d2c..ef5bf392a 100644 --- a/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc +++ b/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc @@ -18,6 +18,8 @@ class mailMethodKolab extends mailMethodCyrus protected $enableFolderTypes = TRUE; protected $attributes = array( + "kolabDeleteflag" => "kolabDeleteflag", + "kolabFolderType" => "kolabFolderType", "alias" => "gosaMailAlternateAddress", "cyrus-userquota" => "gosaMailQuota", "kolabHomeServer" => "gosaMailServer"); @@ -28,11 +30,17 @@ class mailMethodKolab extends mailMethodCyrus protected $userObjectClasses = array("kolabInetOrgPerson"); protected $shareObjectClasses = array("kolabSharedFolder"); + public function fixAttributesOnLoad() + { + mailMethodCyrus::fixAttributesOnLoad(); + } + public function fixAttributesOnStore() { mailMethod::fixAttributesOnStore(); $this->build_account_id(); - $this->parent->attrs['kolabDeleteFlag'] = array(); + $this->parent->attrs['kolabDeleteflag'] = array(); + $this->parent->attrs['kolabFolderType'] = array(); if($this->type == "group"){ $this->parent->attrs['gosaSharedFolderTarget'] = "kolab+shared.".$this->parent->mail; } diff --git a/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc b/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc index 382d3600c..19835b188 100644 --- a/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc +++ b/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc @@ -1,7 +1,7 @@ "gosaMailAlternateAddress", - "cyrus-userquota" => "gosaMailQuota", - "kolabHomeServer" => "gosaMailServer"); - protected $userObjectClasses = array("kolabInetOrgPerson"); protected $shareObjectClasses = array("kolabSharedFolder"); - public function fixAttributesOnStore() - { - mailMethod::fixAttributesOnStore(); - $this->build_account_id(); - $this->parent->attrs['kolabDeleteFlag'] = array(); - if($this->type == "group"){ - $this->parent->attrs['gosaSharedFolderTarget'] = "kolab+shared.".$this->parent->mail; - } - } - - public function fixAttributesOnRemove() - { - mailMethod::fixAttributesOnRemove(); - foreach($this->attributes as $source => $dest){ - $this->attrs[$dest] = array(); - $this->attrs[$source] = array(); - } - if($this->type == "user"){ - $ocs = $this->userObjectClasses; - }else{ - $ocs = $this->shareObjectClasses; - } - $this->parent->attrs['objectClass'] = array_merge( $this->parent->attrs['objectClass'],$ocs); - $this->parent->attrs['objectClass'] = array_unique($this->parent->attrs['objectClass']); - $this->parent->attrs['gosaSharedFolderTarget'] =array(); - $this->parent->attrs['kolabDeleteFlag'] = $this->parent->gosaMailServer; - if($this->folderTypesEnabled()){ - $this->parent->attrs['kolabFolderType'] =array(); - } - } - - - /* \brief Some method require special folder types, "kolab" for example. - !! Those values are dummy values, the base class doesn't use folder types; - @return Array Return folder types. - */ - public function getAvailableFolderTypes() - { - $ret = array(); - $ret['CAT'][''] = _("Unspecified"); - $ret['CAT']['mail']= _("Mails"); - $ret['CAT']['task']= _("Tasks"); - $ret['CAT']['journal']= _("Journals"); - $ret['CAT']['calendar']= _("Calendar"); - $ret['CAT']['contact']= _("Contacts"); - $ret['CAT']['note']= _("Notes"); - - $ret['SUB_CAT'][''][''] = _("Unspecified"); - $ret['SUB_CAT']['mail'][''] = _("Unspecified"); - $ret['SUB_CAT']['mail']['inbox'] = _("Inbox"); - $ret['SUB_CAT']['mail']['drafts'] = _("Drafts"); - $ret['SUB_CAT']['mail']['sentitems'] = _("Sent items"); - $ret['SUB_CAT']['mail']['junkemail'] = _("Junk mail"); - - $ret['SUB_CAT']['task']['defailt'] = _("Default"); - $ret['SUB_CAT']['journal']['defailt'] = _("Default"); - $ret['SUB_CAT']['calendar']['defailt'] = _("Default"); - $ret['SUB_CAT']['contact']['defailt'] = _("Default"); - $ret['SUB_CAT']['note']['defailt'] = _("Default"); - - return($ret); - } - - - /* \brief Returns the selected folder type. - !! Those values are dummy values, the base class doesn't use folder types; - @return Array The folde type. + /*! \brief Returns a list of configured mail domains + @return Array A list of mail domains */ - public function getFolderType($default) - { - if($this->enableFolderTypes && $this->parent->attrs['kolabFolderType'][0]){ - list($cat,$sub) = split("\.",$this->parent->attrs['kolabFolderType'][0]); - return(array("CAT" => $cat, "SUB_CAT" => $sub)); - }else{ - return($default); - } - } - - - /* \brief Returns the selected folder type. - !! Those values are dummy values, the base class doesn't use folder types; - @return Array The folde type. - */ - public function setFolderType($type) - { - $ldap = $this->config->get_ldap_link(); - $ldap->cd ($this->parent->dn); - $ldap->modify(array("kolabFolderType" => $type['CAT'].".".$type['SUB_CAT'])); - echo "Move me to KOLAB"; - } - - - public function setQuota($number) - { - mailMethod::setQuota($number); - @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "Skipped, part of kolabd!", - "Set account quota on server '".$this->MailServer); - return(TRUE); - } - - public function setFolderACLs($permissions) - { - mailMethod::setFolderACLs($permissions); - @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "Skipped, part of kolabd!", - "Setting folder ACLs!",""); - return(TRUE); - } - - public function updateMailbox() - { - mailMethod::updateMailbox(); - @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "Skipped, part of kolabd!", - "Add/Update account on server :".$this->MailServer); - return(TRUE); - } - - public function deleteMailbox() + public function getMailDomains() { - mailMethod::deleteMailbox(); - @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "Skipped, part of kolabd!", - "Setting Quota"); - return(TRUE); - } + return(array("gonicus.de")); + } } diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods.inc b/gosa-plugins/mail/personal/mail/class_mail-methods.inc index 88b7c64d8..0d4e36a94 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods.inc @@ -112,6 +112,9 @@ class mailMethod{ if(isset($this->parent->$source)){ $this->parent->$dest = $this->parent->$source; } + if(isset($this->parent->attrs[$source][0])){ + $this->parent->saved_attributes[$source] = $this->parent->attrs[$source][0]; + } } }