Skip to content

Commit 26c616e

Browse files
author
Marius Burkard
committed
Merge branch '4355-db-quota' into 'develop'
Do not allow DB quota = 0 when db quota client limit > 0 (#4355) Closes #4355 See merge request ispconfig/ispconfig3!1246
2 parents 94713ac + 4e9dfce commit 26c616e

26 files changed

+33
-3
lines changed

interface/web/sites/database_edit.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ function onSubmit() {
211211
unset($global_config);
212212
unset($dbname_prefix);
213213
}
214+
215+
//* ensure that quota value is not 0 when quota is set for client
216+
if($client['limit_database_quota'] > 0 && isset($_POST["database_quota"]) && $_POST["database_quota"] == 0) {
217+
$app->tform->errorMessage .= $app->tform->lng("limit_database_quota_not_0_txt")."<br>";
218+
}
214219

215220
if($client['parent_client_id'] > 0) {
216221
// Get the limits of the reseller
@@ -357,7 +362,7 @@ function onBeforeUpdate() {
357362
if($tmp['server_id'] && $tmp['server_id'] != $this->dataRecord['server_id']) {
358363
// we need remote access rights for this server, so get it's ip address
359364
$server_config = $app->getconf->get_server_config($tmp['server_id'], 'server');
360-
365+
361366
// Add default remote_ips from Main Configuration.
362367
$remote_ips = explode(",", $global_config['default_remote_dbserver']);
363368
if (!in_array($server_config['ip_address'], $default_remote_db)) { $remote_ips[] = $server_config['ip_address']; }
@@ -380,7 +385,7 @@ function onBeforeUpdate() {
380385
}
381386
}
382387
}
383-
388+
384389
if ($app->tform->errorMessage == '') {
385390
// force update of the used database user
386391
if($this->dataRecord['database_user_id']) {
@@ -442,7 +447,7 @@ function onBeforeInsert() {
442447
if($tmp['server_id'] && $tmp['server_id'] != $this->dataRecord['server_id']) {
443448
// we need remote access rights for this server, so get it's ip address
444449
$server_config = $app->getconf->get_server_config($tmp['server_id'], 'server');
445-
450+
446451
// Add default remote_ips from Main Configuration.
447452
$remote_ips = explode(",", $global_config['default_remote_dbserver']);
448453
if (!in_array($server_config['ip_address'], $default_remote_db)) { $remote_ips[] = $server_config['ip_address']; }

interface/web/sites/lib/lang/ar_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['database_user_missing_txt'] = 'Please select a database user for this datab
4646
$wb['limit_database_quota_txt'] = 'Database quota';
4747
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
4848
$wb['limit_database_quota_free_txt'] = 'Max. available DB quota ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/bg_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['database_user_missing_txt'] = 'Please select a database user for this datab
4646
$wb['limit_database_quota_txt'] = 'Database quota';
4747
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
4848
$wb['limit_database_quota_free_txt'] = 'Max. available DB quota ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/br_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['globalsearch_suggestions_text_txt'] = 'Sugestões';
4646
$wb['limit_database_quota_txt'] = 'Cota do banco de dados';
4747
$wb['limit_database_quota_error_notint'] = 'O limite da cota do banco de dados deve ser um número.';
4848
$wb['limit_database_quota_free_txt'] = 'Limite da cota do banco de dados disponível';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/ca_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['database_user_missing_txt'] = 'Please select a database user for this datab
4646
$wb['limit_database_quota_txt'] = 'Database quota';
4747
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
4848
$wb['limit_database_quota_free_txt'] = 'Max. available DB quota ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/cz_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['database_user_missing_txt'] = 'Prosím vyberte uživatele databáze pro tut
4646
$wb['limit_database_quota_txt'] = 'Kvóta databáze';
4747
$wb['limit_database_quota_error_notint'] = 'Limit databázové kvóty musí být číslo.';
4848
$wb['limit_database_quota_free_txt'] = 'Max. dostupná DB kvóta je ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/de_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['globalsearch_suggestions_text_txt'] = 'Vorschläge';
4646
$wb['limit_database_quota_txt'] = 'Database quota';
4747
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
4848
$wb['limit_database_quota_free_txt'] = 'Max. available DB quota ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/dk_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['globalsearch_suggestions_text_txt'] = 'Forslag';
4646
$wb['limit_database_quota_txt'] = 'Database quota';
4747
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
4848
$wb['limit_database_quota_free_txt'] = 'Max. available DB quota ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/el_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['database_user_missing_txt'] = 'Please select a database user for this datab
4646
$wb['limit_database_quota_txt'] = 'Database quota';
4747
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
4848
$wb['limit_database_quota_free_txt'] = 'Max. available DB quota ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

interface/web/sites/lib/lang/en_database.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ $wb['globalsearch_suggestions_text_txt'] = 'Suggestions';
4646
$wb['limit_database_quota_txt'] = 'Database quota';
4747
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
4848
$wb['limit_database_quota_free_txt']='Max. available DB quota ';
49+
$wb['limit_database_quota_not_0_txt']= 'Database quota can not be 0';
4950
?>

0 commit comments

Comments
 (0)