X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_mail-methods-kolab.inc;h=95ba9e5ee3e60959ddc3f6f1f8530ed910c249d9;hb=ab934d9be3708301031548a94528fb9479fd5d7c;hp=c6f3f22de7fedb7799848788f463be7da66378d3;hpb=a00ea993e23555380a987626d86b143bf43b73c1;p=gosa.git diff --git a/include/class_mail-methods-kolab.inc b/include/class_mail-methods-kolab.inc index c6f3f22de..95ba9e5ee 100644 --- a/include/class_mail-methods-kolab.inc +++ b/include/class_mail-methods-kolab.inc @@ -50,12 +50,14 @@ class mailMethodKolab extends mailMethodCyrus } - /* Get quota and divide it by 1024, because in gosa we display in Kb - but we get bytes */ + /* Get quota and divide it by 1024, because in gosa we display in MB + but we get Kb */ function getQuota($folder) { $result= array('quotaUsage' => '', 'gosaMailQuota' => ''); + error_reporting(0); + /* Load quota settings */ $quota_value = @imap_get_quota($this->mbox, $folder); if(is_array($quota_value)) { @@ -72,12 +74,19 @@ class mailMethodKolab extends mailMethodCyrus return(false); } + error_reporting(E_ALL); + return ($result); } 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. @@ -109,6 +118,12 @@ class mailMethodKolab extends mailMethodCyrus function fixAttributesOnStore(&$mailObject) { global $config; + + /* If quota is empty, remove quota restrictions by setting quota to 0 */ + if(isset($mailObject->gosaMailQuota) && (empty($mailObject->gosaMailQuota))){ + $mailObject->attrs['gosaMailQuota'] = 0; + } + /* Convert attributes and objectClasses */ foreach ($this->attribute_map as $source => $dest){ if (isset($mailObject->attrs[$source])){ @@ -186,6 +201,14 @@ class mailMethodKolab extends mailMethodCyrus } } } + + /* 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();