summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 543a94f)
raw | patch | inline | side by side (parent: 543a94f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 11:31:22 +0000 (11:31 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 11:31:22 +0000 (11:31 +0000) |
Updated this->uid via mailMethodKolab to match typical folder names like 'shared.abc@server.de',
else we can't get account quota etc.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3581 594d385d-05f5-0310-b6e9-bd551577e9d8
else we can't get account quota etc.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3581 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_mail-methods-kolab.inc | patch | blob | history | |
plugins/admin/groups/class_groupMail.inc | patch | blob | history |
index 3b5045d5f336c239c01e01d0d36dda3380db94d9..95ba9e5ee3e60959ddc3f6f1f8530ed910c249d9 100644 (file)
function getQuota($folder)
{
$result= array('quotaUsage' => '', 'gosaMailQuota' => '');
-
+
error_reporting(0);
/* Load quota settings */
function fixAttributesOnLoad(&$mailObject)
{
+ /* Kolab shared folder names are like ' shared.uid@server.de '
+ So overwrite uid to match these folder names. Else we can't read quota settings etc.
+ #FIXME is there a better way to detect if it is 'shared.' or 'shared+' or 'kolab+shared.' or what ever ?*/
+ $mailObject->uid = "shared.".$mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
+
/* Convert attributes and objectClasses */
foreach ($this->attribute_map as $dest => $source){
/* Hickert 11.11.05 : Alternate email addresses were saved, but not displayed again.
}
}
}
+
+ /* Save shared folder target */
+ $mailObject->attrs['gosaSharedFolderTarget']= "kolab+shared.".$mailObject->uid;
+
+ /* Kolab shared folder names are like ' shared.uid@server.de '
+ So overwrite uid to match these folder names. Else we can't read quota settings etc.
+ #FIXME is there a better way to detect if it is 'shared.' or 'shared+' or 'kolab+shared.' or what ever ?*/
+ $mailObject->uid = "shared.".$mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
/* Assign new acls */
$mailObject->attrs['acl']= array();
index abde8634bbe53cc1b295d042440aa57aaaf71cda..9bd73c3dffedad7be86e6ebe76c66536e78af1ff 100644 (file)
$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 */
}
} // 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 for 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"
/* 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 */