Skip to content

Commit 1d6b37d

Browse files
author
Till Brehm
committed
Merge branch '6417-quota-unlimited-zero-vs--1' into 'develop'
Unlimited quota is stored as -1, not zero, #6417 Closes #6417 See merge request ispconfig/ispconfig3!1668
2 parents 29f90a2 + b5b8a58 commit 1d6b37d

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
ALTER TABLE `mail_user` CHANGE `quota` `quota` BIGINT(20) NOT NULL DEFAULT '0';

install/sql/ispconfig3.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ CREATE TABLE `mail_user` (
10701070
`gid` int(11) NOT NULL default '5000',
10711071
`maildir` varchar(255) NOT NULL default '',
10721072
`maildir_format` varchar(255) NOT NULL default 'maildir',
1073-
`quota` bigint(20) NOT NULL default '-1',
1073+
`quota` bigint(20) NOT NULL default '0',
10741074
`cc` text,
10751075
`forward_in_lda` enum('n','y') NOT NULL default 'n',
10761076
`sender_cc` varchar(255) NOT NULL default '',

interface/lib/classes/quota_lib.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public function get_databasequota_data($clientid = null, $readable = true) {
326326
if($used_ratio >= 0.8) $databases[$i]['display_colour'] = '#fd934f';
327327
if($used_ratio >= 1) $databases[$i]['display_colour'] = '#cc0000';
328328

329-
if($databases[$i]['database_quota'] == 0){
329+
if($databases[$i]['database_quota'] == -1) {
330330
$databases[$i]['database_quota'] = $app->lng('unlimited_txt');
331331
} else {
332332
$databases[$i]['database_quota'] = $databases[$i]['database_quota'] . ' MB';

interface/web/dashboard/dashlets/templates/databasequota.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<td>{tmpl_var name='database_name'}</td>
1515
<td>{tmpl_var name='used'}</td>
1616
<td>{tmpl_var name='database_quota'}</td>
17-
{tmpl_if name="quota_raw" op="!=" value="0"}<td>
17+
{tmpl_if name="quota_raw" op="!=" value="-1"}<td>
1818
<div class='progress'>
1919
<div class='progress-bar-striped progress-bar progress-bar-{tmpl_if name="used_percentage" op="<" value="50"}success{tmpl_elseif name="used_percentage" op="<" value="75"}warning{tmpl_else}danger{/tmpl_if}' role='progressbar' aria-valuemin='0' aria-valuemax='100' aria-valuenow='{tmpl_var name="used_percentage"}' style='width: {tmpl_var name="used_percentage"}%'><span>{tmpl_var name="used_percentage"}%</span>
2020
<span class='sr-only'>{tmpl_var name='used'} {tmpl_var name='of_txt'} {tmpl_var name='database_quota'}</span>

interface/web/mail/form/mail_user.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
'regex' => '/^([0-9]{1,})$/',
167167
'errmsg'=> 'quota_error_value'),
168168
),
169-
'default' => '-1',
169+
'default' => '0',
170170
'value' => '',
171171
'width' => '30',
172172
'maxlength' => '255'

0 commit comments

Comments
 (0)