Skip to content

Commit 378d832

Browse files
author
Florian Schaal
committed
disallow spf, dkim, and dmarc-records when editing / creating a TXT record
1 parent 7255ec9 commit 378d832

24 files changed

+102
-29
lines changed

interface/web/dns/form/dns_txt.tform.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,31 @@
105105
'data' => array (
106106
'datatype' => 'VARCHAR',
107107
'formtype' => 'TEXT',
108-
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
109-
'errmsg'=> 'data_error_empty'),
108+
'validators' => array (
109+
0 => array (
110+
'type' => 'NOTEMPTY',
111+
'errmsg'=> 'data_error_empty'
112+
),
113+
1 => array (
114+
'type' => 'REGEX',
115+
'regex' => "/^((?!v=DKIM).)*$/s",
116+
'errmsg'=> 'invalid_type_dkim'
117+
),
118+
2 => array (
119+
'type' => 'REGEX',
120+
'regex' => "/^((?!v=DMARC).)*$/s",
121+
'errmsg'=> 'invalid_type_dmarc'),
122+
3 => array (
123+
'type' => 'REGEX',
124+
'regex' => "/^((?!v=spf).)*$/s",
125+
'errmsg'=> 'invalid_type_spf'
126+
),
110127
),
111128
'default' => '',
112129
'value' => '',
113130
'width' => '30',
114131
'maxlength' => '255'
115132
),
116-
/*
117-
'aux' => array (
118-
'datatype' => 'INTEGER',
119-
'formtype' => 'TEXT',
120-
'default' => '0',
121-
'value' => '',
122-
'width' => '10',
123-
'maxlength' => '10'
124-
),
125-
*/
126133
'ttl' => array (
127134
'datatype' => 'INTEGER',
128135
'formtype' => 'TEXT',
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<?php
2-
$wb['server_id_txt'] = 'Server';
3-
$wb['zone_txt'] = 'Zone';
4-
$wb['name_txt'] = 'Hostname';
5-
$wb['type_txt'] = 'type';
6-
$wb['data_txt'] = 'Text';
7-
$wb['ttl_txt'] = 'TTL';
8-
$wb['active_txt'] = 'Active';
9-
$wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.';
10-
$wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.';
11-
$wb['name_error_empty'] = 'The hostname is empty.';
12-
$wb['name_error_regex'] = 'The hostname has the wrong format.';
13-
$wb['data_error_empty'] = 'Text empty';
14-
$wb['data_error_regex'] = 'Text format invalid';
2+
$wb["server_id_txt"] = 'Server';
3+
$wb["zone_txt"] = 'Zone';
4+
$wb["name_txt"] = 'Hostname';
5+
$wb["type_txt"] = 'type';
6+
$wb["data_txt"] = 'Text';
7+
$wb["ttl_txt"] = 'TTL';
8+
$wb["active_txt"] = 'Active';
9+
$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
10+
$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
11+
$wb["name_error_empty"] = 'The hostname is empty.';
12+
$wb["name_error_regex"] = 'The hostname has the wrong format.';
13+
$wb["data_error_empty"] = 'Text empty';
14+
$wb["data_error_regex"] = 'Text format invalid';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
1619
?>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ $wb['name_error_regex'] = 'The hostname has the wrong format.';
1313
$wb['data_error_empty'] = 'Text empty';
1414
$wb['data_error_regex'] = 'Text format invalid';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
1619
?>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ $wb['name_error_regex'] = 'Hostname tem um formato inválido.';
1313
$wb['data_error_empty'] = 'Endereço IP em branco';
1414
$wb['data_error_regex'] = 'Endereço IP formato inválido';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
1619
?>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ $wb['name_error_regex'] = 'Hostname má chybný formát.';
1313
$wb['data_error_empty'] = 'Text je prázdný';
1414
$wb['data_error_regex'] = 'Text má chybný formát';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
1619
?>
17-

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ $wb['name_error_regex'] = 'Der Hostname hat das falsche Format.';
1313
$wb['data_error_empty'] = 'Text ist leer';
1414
$wb['data_error_regex'] = 'Textformat ungültig';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16+
$wb['invalid_type_dkim'] = 'DKIM ist nicht zulässig. Bitte den DKIM-Button nutzen';
17+
$wb['invalid_type_dmarc'] = 'DMARC ist nicht zulässig. Bitte den DMARC-Button nutzen';
18+
$wb['invalid_type_spf'] = 'SPF ist nicht zulässig. Bitte den SPF-Button nutzen';
1619
?>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ $wb['name_error_regex'] = 'Το hostname δεν έχει σωστή μορφοπ
1313
$wb['data_error_empty'] = 'Το κείμενο δεν έχει οριστεί';
1414
$wb['data_error_regex'] = 'Κείμενο με μη έγκυρη μορφοποίηση';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
1619
?>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ $wb["name_error_regex"] = 'The hostname has the wrong format.';
1313
$wb["data_error_empty"] = 'Text empty';
1414
$wb["data_error_regex"] = 'Text format invalid';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16-
?>
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
19+
?>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ $wb['name_error_regex'] = 'El formato del nombre de la máquina es incorrecto.';
1313
$wb['data_error_empty'] = 'Texto vacío.';
1414
$wb['data_error_regex'] = 'Formato de texto no válido';
1515
$wb['ttl_range_error'] = 'TTL mínimo es 60 segundos';
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
1619
?>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ $wb['name_error_regex'] = 'Verkkotunnus on vääränlainen.';
1313
$wb['data_error_empty'] = 'Tekstikenttä on tyhjä';
1414
$wb['data_error_regex'] = 'Tekstikenttä on vääränlainen';
1515
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
16+
$wb['invalid_type_dkim'] = 'DKIM is not allowed. Use the DKIM button';
17+
$wb['invalid_type_dmarc'] = 'DMARC is not allowed. Use the DMARC button';
18+
$wb['invalid_type_spf'] = 'SPF is not allowed. Use the SPF button.';
1619
?>

0 commit comments

Comments
 (0)