summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 76bf4b4)
raw | patch | inline | side by side (parent: 76bf4b4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Aug 2008 13:14:46 +0000 (13:14 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Aug 2008 13:14:46 +0000 (13:14 +0000) |
-Use folder prefix defined in currenlty used mail mehtod instead of parsing our own.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12216 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12216 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/mail/admin/groups/mail/class_groupMail.inc | patch | blob | history |
diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
index 3493fb48b7c0943a724dca3564f570e0b070c3d0..277a1b230f8baa8b3cf0ef043f3c6760874f6297 100644 (file)
var $multiple_support = TRUE;
+
+
+ var $folder_prefix = "";
+ var $user_prefix = "";
+
+ var $account_name = "";
+
function mailgroup (&$config, $dn= NULL, $ui= NULL)
{
/* Initialise all available attributes ... if possible
$this->gosaMailServer = $this->attrs['gosaMailServer'][0];
}
- /* Convert cn to uid in case of existing entry
- */
- if (isset($this->attrs['cn'][0])){
- $this->uid= $this->attrs['cn'][0];
- }
-
/* Get folder type */
if(preg_match("/olab/i",$this->config->get_cfg_value("mailmethod"))){
if(isset($this->attrs['kolabFolderType'])){
}
}
+ /* Create new instance of our defined mailclass
+ */
+ $method= new $this->method($this->config);
+
+ $this->folder_prefix = $method->folder_prefix;
+ $this->user_prefix = $method->user_prefix;
+
+ /* Build account name
+ */
+ $uattrib = $method->uattrib;
+ if (isset($this->attrs[$uattrib][0])){
+ $this->account_name= $this->attrs[$uattrib][0];
+ if(preg_match("/@/",$this->account_name)){
+ $cn = "";
+ if(isset($this->attrs['cn'][0])){
+ $cn = $this->attrs['cn'][0];
+ }
+ $this->account_name = preg_replace("/^[^@]*/",$cn,$this->account_name);
+ }
+ }
+
/* If this isn't a new mailgroup, read all required data from ldap
*/
if (($dn != "new")&&($dn !== NULL)){
*/
if (isset ($this->attrs["gosaMailServer"][0])){
- /* Create new instance of our defined mailclass
- */
- $method= new $this->method($this->config);
if ($method->connect($this->attrs["gosaMailServer"][0])){
/* If we do NOT use kolab or equal methods,
They will be merged later with the ldap specified acls.
*/
if(!preg_match("/olab/i",$this->mmethod) && !empty($this->mmethod)){
- $this->imapacl= $method->getSharedFolderPermissions($this->uid);
+ $this->imapacl= $method->getSharedFolderPermissions($this->folder_prefix.$this->account_name);
/* Need to filter what a member acl could be... */
$vote= array();
$method->fixAttributesOnLoad($this);
/* get Quota */
- $quota= $method->getQuota($this->uid);
+ $quota= $method->getQuota($this->folder_prefix.$this->account_name);
/* Update quota values */
if(is_array($quota)){
if ($method->connect($this->gosaMailServer) && $this->remove_folder_from_imap){
/* Remove account from IMAP server */
- $method->deleteMailbox($this->uid);
+ $method->deleteMailbox($this->folder_prefix.$this->account_name);
$method->disconnect();
}
}
/* Save arrays */
$this->attrs['gosaMailAlternateAddress'] = $this->gosaMailAlternateAddress;
$this->attrs['gosaMailForwardingAddress'] = $this->gosaMailForwardingAddress;
- $this->attrs['gosaSharedFolderTarget'] = "share+".$this->uid;
+ $this->attrs['gosaSharedFolderTarget'] = "share+".$this->account_name;
$this->attrs['acl']= array();
/* Prepare Mail server attribute */
}
}
}
- /* Exchange '%member%' pseudo entry */
+
+ /* Exchange '%member%' pseudo entry */
$memberacl= $this->imapacl['%members%'];
foreach ($this->members as $user){
if (!isset($this->imapacl[$user])){
$method= new $this->method($this->config);
$method->fixAttributesOnStore($this);
if (($method->connect($this->gosaMailServer))){
- $method->updateMailbox($this->uid);
- $method->setQuota($this->uid, $this->gosaMailQuota);
+ $method->updateMailbox($this->folder_prefix.$this->account_name);
+ $method->setQuota($this->folder_prefix.$this->account_name, $this->gosaMailQuota);
/* Only write imap acls directly if we are not
* using a kolab like mail method.
*/
if(!preg_match("/olab/i",$this->mmethod)){
- $method->setSharedFolderPermissions($this->uid, $this->imapacl);
+ $method->setSharedFolderPermissions($this->folder_prefix.$this->account_name, $this->imapacl);
}
$method->disconnect();
}