summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c4d763a)
raw | patch | inline | side by side (parent: c4d763a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 09:44:45 +0000 (09:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 09:44:45 +0000 (09:44 +0000) |
Allow kolab to remove quota restrictions
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3575 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3575 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_mail-methods-kolab.inc | patch | blob | history | |
plugins/personal/mail/class_mailAccount.inc | patch | blob | history | |
plugins/personal/mail/generic.tpl | patch | blob | history |
index c6f3f22de7fedb7799848788f463be7da66378d3..3b5045d5f336c239c01e01d0d36dda3380db94d9 100644 (file)
}
- /* 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)) {
return(false);
}
+ error_reporting(E_ALL);
+
return ($result);
}
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])){
diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc
index 4adef1da1ec6ad60da8d69bd56266877358e4385..1d45d563f48fba359856d11917467b99018210b4 100644 (file)
/* Update quota values */
$quota= $method->getQuota($this->folder_prefix.$this->$id);
-
+
if($quota){
if ($quota['gosaMailQuota'] == 2147483647){
$this->quotaUsage = "";
$this->gosaMailQuota = $quota['gosaMailQuota'];
}
}else{
+ $this->quotaUsage = "";
+ $this->gosaMailQuota = "";
print_red(sprintf(_("Can't get quota for for '%s'."),$this->folder_prefix.$this->$id));
}
/* Adapt attributes if needed */
$method= new $this->method($this->config);
$id= $method->uattrib;
+
$method->fixAttributesOnStore($this);
- /* Remove Mailquota if = "" */
- if((isset($this->attrs['gosaMailQuota']))&&($this->attrs['gosaMailQuota']=="")) {
- $this->attrs['gosaMailQuota']=array();
+ /* Remove Mailquota if = "" or "0" */
+ if((isset($this->attrs['gosaMailQuota']))&&(!$this->attrs['gosaMailQuota'])) {
+ $this->attrs['gosaMailQuota']=0;
}
if(empty($this->attrs['gosaSpamMailbox'])){
index c467a89f5c24d598be88550786a3c36601d76d26..1e99bb707bf2cdb1d6b9eaa04fa53c6f5a0a3b38 100644 (file)
<td><label for="gosaMailQuota">{t}Quota size{/t}</label></td>
<td>
<input id="gosaMailQuota" name="gosaMailQuota" size="6" align="middle" maxlength="60" {$gosaMailQuotaACL}
- value="{$gosaMailQuota}"> KB
+ value="{$gosaMailQuota}"> MB
</td>
</tr>
</table>