Skip to content

Commit b33d7d5

Browse files
author
Till Brehm
committed
Fixed issue #3955 DNS module: Limit for maximum zones can be circumvented with "import zone file" function.
Removed TODO string in error template.
1 parent 855cf2a commit b33d7d5

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

interface/web/dns/dns_import.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,23 @@
3838
$error = '';
3939

4040
// Loading the template
41-
$app->uses('tpl,validate_dns');
41+
$app->uses('tform,tpl,validate_dns');
4242
$app->tpl->newTemplate("form.tpl.htm");
4343
$app->tpl->setInclude('content_tpl', 'templates/dns_import.htm');
4444
$app->load_language_file('/web/dns/lib/lang/'.$_SESSION['s']['language'].'_dns_wizard.lng');
4545

46+
// Check if dns record limit has been reached. We will check only users, not admins
47+
if($_SESSION["s"]["user"]["typ"] == 'user') {
48+
$app->tform->formDef['db_table_idx'] = 'id';
49+
$app->tform->formDef['db_table'] = 'dns_soa';
50+
if(!$app->tform->checkClientLimit('limit_dns_zone')) {
51+
$app->error($app->lng('limit_dns_zone_txt'));
52+
}
53+
if(!$app->tform->checkResellerLimit('limit_dns_zone')) {
54+
$app->error('Reseller: '.$app->lng('limit_dns_zone_txt'));
55+
}
56+
}
57+
4658
// import variables
4759
$template_id = (isset($_POST['template_id']))?$app->functions->intval($_POST['template_id']):0;
4860
$sys_groupid = (isset($_POST['client_group_id']))?$app->functions->intval($_POST['client_group_id']):0;

interface/web/dns/dns_wizard.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,23 @@
3636

3737

3838
// Loading the template
39-
$app->uses('tpl,validate_dns');
39+
$app->uses('tpl,validate_dns,tform');
4040
$app->tpl->newTemplate("form.tpl.htm");
4141
$app->tpl->setInclude('content_tpl', 'templates/dns_wizard.htm');
4242
$app->load_language_file('/web/dns/lib/lang/'.$_SESSION['s']['language'].'_dns_wizard.lng');
4343

44+
// Check if dns record limit has been reached. We will check only users, not admins
45+
if($_SESSION["s"]["user"]["typ"] == 'user') {
46+
$app->tform->formDef['db_table_idx'] = 'id';
47+
$app->tform->formDef['db_table'] = 'dns_soa';
48+
if(!$app->tform->checkClientLimit('limit_dns_zone')) {
49+
$app->error($app->lng('limit_dns_zone_txt'));
50+
}
51+
if(!$app->tform->checkResellerLimit('limit_dns_zone')) {
52+
$app->error('Reseller: '.$app->lng('limit_dns_zone_txt'));
53+
}
54+
}
55+
4456
// import variables
4557
$template_id = (isset($_POST['template_id']))?$app->functions->intval($_POST['template_id']):0;
4658
$sys_groupid = (isset($_POST['client_group_id']))?$app->functions->intval($_POST['client_group_id']):0;

interface/web/dns/lib/lang/de_dns_wizard.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ $wb['globalsearch_noresults_limit_txt'] = '0 Treffer';
4040
$wb['globalsearch_searchfield_watermark_txt'] = 'Suche';
4141
$wb['globalsearch_suggestions_text_txt'] = 'Vorschläge';
4242
$wb['error_no_server_id'] = 'No server provided.';
43-
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
43+
$wb['error_not_allowed_server_id'] = 'Der ausgewählte Server ist in diesem Konto nicht verfügbar.';
44+
$wb['limit_dns_zone_txt'] = 'Die maximale Anzahl an DNS Einträgen für Ihr Konto wurde erreicht.';
4445
?>

interface/web/dns/lib/lang/en_dns_wizard.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ $wb['globalsearch_searchfield_watermark_txt'] = "Search";
4141
$wb['globalsearch_suggestions_text_txt'] = "Suggestions";
4242
$wb['error_no_server_id'] = 'No server provided.';
4343
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
44+
$wb["limit_dns_zone_txt"] = 'The max. number of DNS zones for your account is reached.';
4445
?>

interface/web/themes/default/templates/error.tpl.htm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
<ol>
55
<li>###ERRORMSG###</li>
66
</ol>
7-
<div>TODO: WRONG HTML ELEMENTS</div>
87
</div>
98
</div>

0 commit comments

Comments
 (0)