Skip to content

Commit

Permalink
- Added option 'quota_zero_as_unlimited' (#1484604)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Aug 28, 2008
1 parent acbc487 commit 876b15d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------

2008/08/28 (alec)
----------
- Added option 'quota_zero_as_unlimited' (#1484604)

2008/08/28 (robin)
----------
- Added folder hierarchy collapsing
Expand Down
3 changes: 3 additions & 0 deletions config/main.inc.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ $rcmail_config['create_default_folders'] = FALSE;
// protect the default folders from renames, deletes, and subscription changes
$rcmail_config['protect_default_folders'] = TRUE;

// if in your system 0 quota means no limit set this option to TRUE
$rcmail_config['quota_zero_as_unlimited'] = FALSE;

// Set TRUE if deleted messages should not be displayed
// This will make the application run slower
$rcmail_config['skip_deleted'] = FALSE;
Expand Down
11 changes: 4 additions & 7 deletions program/lib/imap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
- added iil_PutLine() wrapper for fputs()
- code cleanup and identation fixes
- removed flush() calls in iil_C_HandlePartBody() to prevent from memory leak (#1485187)
- don't return "??" from iil_C_GetQuota()
********************************************************/

Expand Down Expand Up @@ -2621,13 +2622,9 @@ function iil_C_GetQuota(&$conn) {
$parts = explode(' ', $quota_line);
$storage_part = array_search('STORAGE', $parts);
if ($storage_part > 0) {
$result = array();
$used = $parts[$storage_part+1];
$total = $parts[$storage_part+2];

$result['used'] = $used;
$result['total'] = (empty($total)?"??":$total);
$result['percent'] = (empty($total)?"??":round(($used/$total)*100));
$result['used'] = intval($parts[$storage_part+1]);
$result['total'] = intval($parts[$storage_part+2]);
$result['percent'] = min(100, round(($result['used']/max(1,$result['total']))*100));
$result['free'] = 100 - $result['percent'];
}
}
Expand Down
4 changes: 2 additions & 2 deletions program/steps/mail/func.inc
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ function rcmail_quota_display($attrib)
*/
function rcmail_quota_content($quota=NULL)
{
global $IMAP, $COMM_PATH;
global $IMAP, $COMM_PATH, $RCMAIL;

$display = isset($_SESSION['quota_display']) ? $_SESSION['quota_display'] : '';

Expand All @@ -471,7 +471,7 @@ function rcmail_quota_content($quota=NULL)
else
$quota = $IMAP->get_quota();

if ($quota)
if ($quota && !($quota['total']==0 && $RCMAIL->config->get('quota_zero_as_unlimited')))
{
$quota_text = sprintf('%s / %s (%.0f%%)',
show_bytes($quota['used'] * 1024),
Expand Down

0 comments on commit 876b15d

Please sign in to comment.