Changeset 1691 in subversion


Ignore:
Timestamp:
Aug 28, 2008 2:04:19 PM (5 years ago)
Author:
alec
Message:
  • Added option 'quota_zero_as_unlimited' (#1484604)
Location:
trunk/roundcubemail
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r1687 r1691  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42008/08/28 (alec) 
     5---------- 
     6- Added option 'quota_zero_as_unlimited' (#1484604) 
    37 
    482008/08/28 (robin) 
  • trunk/roundcubemail/config/main.inc.php.dist

    r1683 r1691  
    175175// protect the default folders from renames, deletes, and subscription changes 
    176176$rcmail_config['protect_default_folders'] = TRUE; 
     177 
     178// if in your system 0 quota means no limit set this option to TRUE  
     179$rcmail_config['quota_zero_as_unlimited'] = FALSE; 
    177180 
    178181// Set TRUE if deleted messages should not be displayed 
  • trunk/roundcubemail/program/lib/imap.inc

    r1682 r1691  
    6464                - code cleanup and identation fixes 
    6565                - removed flush() calls in iil_C_HandlePartBody() to prevent from memory leak (#1485187) 
     66                - don't return "??" from iil_C_GetQuota() 
    6667 
    6768********************************************************/ 
     
    26222623                $storage_part = array_search('STORAGE', $parts); 
    26232624                if ($storage_part > 0) { 
    2624                         $result = array(); 
    2625                         $used   = $parts[$storage_part+1]; 
    2626                         $total  = $parts[$storage_part+2]; 
    2627              
    2628                         $result['used']    = $used; 
    2629                         $result['total']   = (empty($total)?"??":$total); 
    2630                         $result['percent'] = (empty($total)?"??":round(($used/$total)*100)); 
     2625                        $result['used']    = intval($parts[$storage_part+1]); 
     2626                        $result['total']   = intval($parts[$storage_part+2]); 
     2627                        $result['percent'] = min(100, round(($result['used']/max(1,$result['total']))*100)); 
    26312628                        $result['free']    = 100 - $result['percent']; 
    26322629                } 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r1686 r1691  
    458458function rcmail_quota_content($quota=NULL) 
    459459  { 
    460   global $IMAP, $COMM_PATH; 
     460  global $IMAP, $COMM_PATH, $RCMAIL; 
    461461 
    462462  $display = isset($_SESSION['quota_display']) ? $_SESSION['quota_display'] : ''; 
     
    472472    $quota = $IMAP->get_quota(); 
    473473 
    474   if ($quota) 
     474  if ($quota && !($quota['total']==0 && $RCMAIL->config->get('quota_zero_as_unlimited'))) 
    475475    { 
    476476    $quota_text = sprintf('%s / %s (%.0f%%)', 
Note: See TracChangeset for help on using the changeset viewer.