X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fgroups%2Fclass_groupMail.inc;h=31557a6c4c12aa858266cacd3f4ca4826feddfa5;hb=4f507bf6c24fd9a5c50928b3a0c334ba5529c42d;hp=eb103aac3ca6cf1adb98d46ae18add46de035f4a;hpb=1f56f14cf6e1b6cac9f04e167201814a4795bcb6;p=gosa.git diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index eb103aac3..31557a6c4 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -55,11 +55,11 @@ class mailgroup extends plugin var $objectclasses= array("gosaMailAccount"); - function mailgroup ($config, $dn= NULL, $ui= NULL) + function mailgroup ($config, $dn= NULL, $parent= NULL) { /* Initialise all available attributes ... if possible */ - plugin::plugin($config, $dn); + plugin::plugin($config, $dn, $parent); /* Set mailMethod to the one defined in gosa.conf */ @@ -112,10 +112,7 @@ class mailgroup extends plugin $method= new $this->method($this->config); if ($method->connect($this->attrs["gosaMailServer"][0])){ - - /* get Quota - */ - $quota= $method->getQuota($this->uid); + /* Maybe the entry is not saved in new style, get permissions from IMAP and convert them to acl attributes */ @@ -154,21 +151,30 @@ class mailgroup extends plugin } } // ENDE ! isset ($this->attrs['acl']) + + /* Adapt attributes if needed */ + $method->fixAttributesOnLoad($this); + + /* get Quota */ + $quota= $method->getQuota($this->uid); /* Update quota values */ - if ($quota['gosaMailQuota'] == 2147483647){ - $this->quotaUsage= ""; - $this->gosaMailQuota= ""; - } else { - $this->quotaUsage= $quota['quotaUsage']; - $this->gosaMailQuota= $quota['gosaMailQuota']; + if(is_array($quota)){ + if ($quota['gosaMailQuota'] == 2147483647){ + $this->quotaUsage= ""; + $this->gosaMailQuota= ""; + } else { + $this->quotaUsage= $quota['quotaUsage']; + $this->gosaMailQuota= $quota['gosaMailQuota']; + } + }else{ + $this->quotaUsage = ""; + $this->gosaMailQuota = ""; +// print_red(sprintf(_("Can't get quota information for '%s'."),$this->uid)); } $method->disconnect(); } // ENDE $method->connect($this->attrs["gosaMailServer"][0])){ - /* Adapt attributes if needed */ - $method->fixAttributesOnLoad($this); - } // ENDE gosaMailServer } // ENDE dn != "new" @@ -604,8 +610,7 @@ class mailgroup extends plugin $ldap->cd($this->dn); $ldap->modify ($this->attrs); - - show_ldap_error($ldap->get_error()); + show_ldap_error($ldap->get_error(), _("Removing group mail settings failed")); /* Optionally execute a command after we're done */ $this->handle_post_events("remove"); @@ -691,15 +696,7 @@ I: Only insider delivery */ /* Save arrays */ $this->attrs['gosaMailAlternateAddress'] = $this->gosaMailAlternateAddress; $this->attrs['gosaMailForwardingAddress'] = $this->gosaMailForwardingAddress; - - /* Save shared folder target */ - if(preg_match("/kolab/i",$this->mmethod)){ - /* Kolab style */ - $this->attrs['gosaSharedFolderTarget']= "kolab+shared.".$this->uid; - }else { - /* GOsa style */ - $this->attrs['gosaSharedFolderTarget']= "share+".$this->uid; - } + $this->attrs['gosaSharedFolderTarget'] = "share+".$this->uid; if(preg_match("/kolab/i",$this->mmethod)){ /* Save acl's */ @@ -777,13 +774,12 @@ I: Only insider delivery */ $ldap->cd($this->dn); $this->cleanup(); $ldap->modify ($this->attrs); - - show_ldap_error($ldap->get_error()); + show_ldap_error($ldap->get_error(), _("Saving group mail settings failed")); /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ if ($this->is_modified){ - $this->handle_post_events("mofify"); + $this->handle_post_events("modify"); } } else { $this->handle_post_events("add");