From 538ef1720e644542055a8e938e45144964e75ef8 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 9 Dec 2008 11:52:08 +0000 Subject: [PATCH] Updated Mail Account ACLs -Ensure that GOsa keep unknown ACL settings. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13202 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../mail/kolab/class_mail-methods-kolab22.inc | 17 ------ .../admin/groups/mail/class_groupMail.inc | 2 +- .../mail/class_mail-methods-cyrus.inc | 9 +++ .../mail/personal/mail/class_mail-methods.inc | 57 +++++++++++-------- 4 files changed, 42 insertions(+), 43 deletions(-) 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 6b78f4653..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 @@ -27,23 +27,6 @@ class mailMethodKolab22 extends mailMethodKolab { return(array("gonicus.de")); } - - - /*! \brief Returns a list of all possible acls. - @return Array ACLs. - */ - public function getAclTypes() - { - $acls["lrsw"] = _("read"); - $acls["lrswp"] = _("post"); - $acls["p"] = _("external post"); - $acls["lrswip"] = _("append"); - $acls["lrswipcd"] = _("write"); - $acls["lrswipcda"]= _("admin"); - $acls["lrswipkxtecda"]= _("super-admin"); - $acls[" "]= _("none"); - return($acls); - } } diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc index 557537538..c829a64e8 100644 --- a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc +++ b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc @@ -52,7 +52,6 @@ class mailgroup extends plugin $this->mailMethod->fixAttributesOnLoad(); $this->mailDomainParts = $this->mailMethod->getMailDomains(); $this->AvailableFolderTypes = $this->mailMethod->getAvailableFolderTypes(); - $this->AclTypes = $this->mailMethod->getAclTypes(); $this->MailBoxes = array(); /* Remember account status @@ -149,6 +148,7 @@ class mailgroup extends plugin /* Disconnect mailMethod. Connect on demand later. */ $this->mailMethod->disconnect(); + $this->AclTypes = $this->mailMethod->getAclTypes(); /* Summarize most used ACLs as member acl */ 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 147a5d1f4..5f958c930 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc @@ -337,6 +337,15 @@ class mailMethodCyrus extends mailMethod{ $folder_acls[$user] = $acl; } + /* Merge given ACL with acl mapping + This ensures that no ACL will accidentally overwritten by gosa. + */ + foreach($folder_acls as $user => $acl){ + if(!isset($this->acl_mapping[$acl])){ + $this->acl_mapping[$acl] = $acl; + } + } + return($folder_acls); } diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods.inc b/gosa-plugins/mail/personal/mail/class_mail-methods.inc index 3d5698a94..7490d8c3f 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods.inc @@ -43,6 +43,18 @@ class mailMethod{ protected $error = ""; protected $parent = NULL; protected $MailServer = ""; + + + protected $acl_map = array( + "lrsw" => "read", + "lrswp" => "post", + "p" => "external post", + "lrswip" => "append", + "lrswipcd" => "write", + "lrswipcda"=> "admin", + " " => "none"); + + protected $acl_mapping = array(); /*! \brief Constructs the mail class @@ -98,6 +110,12 @@ class mailMethod{ sprintf(_("The configured mail attribute '%s' is unsupported!"), $new_uattrib), ERROR_DIALOG); } } + + /* Create ACL map */ + foreach($this->acl_map as $acl => $name){ + $this->acl_mapping[$acl] = _($name); + } + $this->build_account_id(); $this->initial_account_id = $this->account_id; } @@ -591,13 +609,8 @@ class mailMethod{ public function getAvailableFolderTypes() { $ret = array(); - $ret['CAT']['mail'] = _("Mail"); - $ret['CAT']['peter']= _("User"); - $ret['SUB_CAT']['mail']['a'] = "a"; - $ret['SUB_CAT']['mail']['b'] = "b"; - $ret['SUB_CAT']['peter']['tt'] = "tt"; - $ret['SUB_CAT']['peter']['dd'] = "dd"; - $ret['SUB_CAT']['peter']['did'] = "did"; + $ret['CAT'][''] = _("None"); + $ret['SUB_CAT'][''][''] = _("None"); return($ret); } @@ -608,12 +621,7 @@ class mailMethod{ */ 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); - } + return($default); } @@ -623,10 +631,7 @@ class mailMethod{ */ 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"; + return(TRUE) ; } @@ -634,6 +639,15 @@ class mailMethod{ */ public function getFolderACLs($folder_acls) { + /* Merge given ACL with acl mapping + This ensures that no ACL will accidentally overwritten by gosa. + */ + foreach($folder_acls as $user => $acl){ + if(!isset($this->acl_mapping[$acl])){ + $this->acl_mapping[$acl] = $acl; + } + } + return($folder_acls); } @@ -651,14 +665,7 @@ class mailMethod{ */ public function getAclTypes() { - $acls["lrsw"] = _("read"); - $acls["lrswp"] = _("post"); - $acls["p"] = _("external post"); - $acls["lrswip"] = _("append"); - $acls["lrswipcd"] = _("write"); - $acls["lrswipcda"]= _("admin"); - $acls[" "]= _("none"); - return($acls); + return( $this->acl_mapping); } public function folderTypesEnabled() -- 2.30.2