From 4e9b713321e2f644f7d014f86df8b26d5492319c Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Dec 2008 10:03:23 +0000 Subject: [PATCH] Updated mail account and account_id creation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13236 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../mail/kolab/class_mail-methods-kolab.inc | 6 +++++- .../mail/admin/groups/mail/class_groupMail.inc | 17 +++++++++++++++++ gosa-plugins/mail/admin/groups/mail/mail.tpl | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) 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 97f876c7f..81e6b4ffe 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 @@ -29,6 +29,10 @@ class mailMethodKolab extends mailMethodCyrus protected $user_prefix = 'user.'; protected $share_prefix = 'shared\\.'; + /* Account ID creation */ + protected $user_id = "__PREFIX____UATTRIB__"; + protected $share_id = "__PREFIX____CN__@__DOMAIN__"; + protected $userObjectClasses = array("kolabInetOrgPerson"); protected $shareObjectClasses = array("kolabSharedFolder"); @@ -136,7 +140,7 @@ class mailMethodKolab extends mailMethodCyrus */ public function getFolderType($default) { - if($this->enableFolderTypes && $this->parent->attrs['kolabFolderType'][0]){ + if($this->enableFolderTypes && isset($this->parent->attrs['kolabFolderType'][0])){ list($cat,$sub) = split("\.",$this->parent->attrs['kolabFolderType'][0]); return(array("CAT" => $cat, "SUB_CAT" => $sub)); }else{ diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc index 4d035aa43..695bae8d8 100644 --- a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc +++ b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc @@ -40,10 +40,22 @@ class mailgroup extends plugin var $objectclasses= array("gosaMailAccount"); var $multiple_support = FALSE; // Not tested yet + var $uid = ""; + var $cn =""; + function __construct (&$config, $dn= NULL, $ui= NULL) { plugin::plugin($config, $dn); + /* Get attributes from parent object + */ + foreach(array("uid","cn") as $attr){ + if(isset($this->parent->by_object['group']) && isset($this->parent->by_object['group']->$attr)){ + $this->$attr = &$this->parent->by_object['group']->$attr; + }elseif(isset($this->attrs[$attr])){ + $this->$attr = $this->attrs[$attr][0]; + } + } /* Intialize the used mailMethod */ @@ -390,6 +402,7 @@ class mailgroup extends plugin $smarty= get_smarty(); $smarty->assign("initially_was_account", $this->initially_was_account); $smarty->assign("isModifyableMail", $this->mailMethod->isModifyableMail()); + $smarty->assign("isModifyableServer", $this->mailMethod->isModifyableServer()); $smarty->assign("mailEqualsCN", $this->mailMethod->mailEqualsCN()); $smarty->assign("folder_acls" , $this->postable_acls()); $smarty->assign("AclTypes" , $this->AclTypes); @@ -546,8 +559,12 @@ class mailgroup extends plugin if (isset($_POST['mailedit'])){ $mail = $this->mail; + $server = $this->gosaMailServer; plugin::save_object(); + if(!$this->mailMethod->isModifyableServer() && $this->initially_was_account){ + $this->gosaMailServer = $server; + } if(!$this->mailMethod->isModifyableMail() && $this->initially_was_account){ $this->mail = $mail; }else{ diff --git a/gosa-plugins/mail/admin/groups/mail/mail.tpl b/gosa-plugins/mail/admin/groups/mail/mail.tpl index 25203886a..1d73a9d1b 100644 --- a/gosa-plugins/mail/admin/groups/mail/mail.tpl +++ b/gosa-plugins/mail/admin/groups/mail/mail.tpl @@ -34,6 +34,9 @@ + {if !$isModifyableServer && $initially_was_account} + + {else} {render acl=$gosaMailServerACL} {/render} + {/if} -- 2.30.2