You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: interface/web/dns/dns_spf_edit.php
+27-11Lines changed: 27 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -72,13 +72,16 @@ function onShowNew() {
72
72
}
73
73
74
74
functiononShowEnd() {
75
-
global$app, $conf;
75
+
global$app;
76
+
77
+
$id = $app->functions->intval($_GET['id']);
76
78
77
-
$zone = $app->functions->intval($_GET['zone']);
79
+
// if there is no existing SPF record, assume we want a new active record
80
+
$app->tpl->setVar('active', 'CHECKED');
78
81
79
82
//* check for an existing spf-record
80
-
$sql = "SELECT data, active FROM dns_rr WHERE data LIKE 'v=spf1%' AND zone = ? AND " . $app->tform->getAuthSQL('r');
81
-
$rec = $app->db->queryOneRecord($sql, $zone);
83
+
$sql = "SELECT data, active FROM dns_rr WHERE id = ? AND " . $app->tform->getAuthSQL('r');
84
+
$rec = $app->db->queryOneRecord($sql, $id);
82
85
if ( isset($rec) && !empty($rec) ) {
83
86
$this->id = 1;
84
87
$old_data = strtolower($rec['data']);
@@ -132,7 +135,6 @@ function onShowEnd() {
132
135
functiononSubmit() {
133
136
global$app, $conf;
134
137
135
-
136
138
// Get the parent soa record of the domain
137
139
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($_POST["zone"]));
138
140
@@ -153,8 +155,27 @@ function onSubmit() {
153
155
}
154
156
}
155
157
} // end if user is not admin
158
+
159
+
// Check that the record does not yet exist
160
+
$existing_records = $app->db->queryAllRecords("SELECT id FROM dns_rr WHERE id != ? AND zone = ? AND name = ? AND type = 'TXT'", $this->dataRecord['id'], $_POST['zone'], $_POST['name']);
$check=$app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND type = ? AND data LIKE 'v=spf1%' AND name = ?", $this->dataRecord["zone"], $this->dataRecord["type"], $this->dataRecord['name']);
233
-
$this->id = $check['id'];
234
-
235
251
if (!isset($this->dataRecord['active'])) $this->dataRecord['active'] = 'N';
$wb['spf_record_exists_txt'] = 'SPF-Record already exists for hostname "{hostname}". Do you want to <a href="#" data-load-content="dns/dns_spf_edit.php?id={existing_record_id}">edit the existing record</a>?';
24
+
$wb['spf_record_exists_multiple_txt'] = 'Multiple SPF-Records exist for hostname "{hostname}". This will cause recipients to reject your mail! Delete or merge duplicate existing records and try again.';
22
25
$wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.';
23
26
$wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.';
24
27
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
28
+
$wb['btn_edit_as_txt_record_txt'] = 'Edit as TXT record';
$wb['spf_record_exists_txt'] = 'SPF-Record already exists for hostname "{hostname}". Do you want to <a href="#" data-load-content="dns/dns_spf_edit.php?id={existing_record_id}">edit the existing record</a>?';
24
+
$wb['spf_record_exists_multiple_txt'] = 'Multiple SPF-Records exist for hostname "{hostname}". This will cause recipients to reject your mail! Delete or merge duplicate existing records and try again.';
22
25
$wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.';
23
26
$wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.';
24
27
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
28
+
$wb['btn_edit_as_txt_record_txt'] = 'Edit as TXT record';
Copy file name to clipboardExpand all lines: interface/web/dns/lib/lang/br_dns_spf.lng
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
<?php
2
2
$wb['data_txt'] = 'Registro SPF';
3
+
$wb['name_txt'] = 'Hostname';
3
4
$wb['spf_mechanism_txt'] = 'Mecanismo SPF';
4
5
$wb['spf_mechanism_pass_txt'] = 'Pass - permitir e-mails de outros remetentes';
5
6
$wb['spf_mechanism_fail_txt'] = 'Fail - rejeitar e-mails de outros remetentes';
@@ -19,7 +20,10 @@ $wb['spf_invalid_domain_txt'] = 'O domínio é inválido.';
19
20
$wb['ttl_txt'] = 'TTL';
20
21
$wb['active_txt'] = 'Ativo';
21
22
$wb['record_exists_txt'] = 'Registro dns já existe.';
23
+
$wb['spf_record_exists_txt'] = 'SPF-Record already exists for hostname "{hostname}". Do you want to <a href="#" data-load-content="dns/dns_spf_edit.php?id={existing_record_id}">edit the existing record</a>?';
24
+
$wb['spf_record_exists_multiple_txt'] = 'Multiple SPF-Records exist for hostname "{hostname}". This will cause recipients to reject your mail! Delete or merge duplicate existing records and try again.';
22
25
$wb['limit_dns_record_txt'] = 'O limite de registros dns para esta conta foi alcançado.';
23
26
$wb['no_zone_perm'] = 'Você não tem permissão para adicionar registros dns nesta zona.';
24
27
$wb['ttl_range_error'] = 'O TTL mínimo são 60 segundos.';
28
+
$wb['btn_edit_as_txt_record_txt'] = 'Edit as TXT record';
$wb['spf_record_exists_txt'] = 'SPF-Record already exists for hostname "{hostname}". Do you want to <a href="#" data-load-content="dns/dns_spf_edit.php?id={existing_record_id}">edit the existing record</a>?';
24
+
$wb['spf_record_exists_multiple_txt'] = 'Multiple SPF-Records exist for hostname "{hostname}". This will cause recipients to reject your mail! Delete or merge duplicate existing records and try again.';
22
25
$wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.';
23
26
$wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.';
24
27
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
28
+
$wb['btn_edit_as_txt_record_txt'] = 'Edit as TXT record';
$wb['record_exists_txt'] = 'DNS záznam již existuje';
23
+
$wb['spf_record_exists_txt'] = 'SPF-Record already exists for hostname "{hostname}". Do you want to <a href="#" data-load-content="dns/dns_spf_edit.php?id={existing_record_id}">edit the existing record</a>?';
24
+
$wb['spf_record_exists_multiple_txt'] = 'Multiple SPF-Records exist for hostname "{hostname}". This will cause recipients to reject your mail! Delete or merge duplicate existing records and try again.';
22
25
$wb['limit_dns_record_txt'] = 'Byl dosažen max. počet DNS záznamů pro váš účet.';
23
26
$wb['no_zone_perm'] = 'Nemáte oprávnění přidat záznam do této zóny DNS.';
24
27
$wb['ttl_range_error'] = 'Min. TTL doba je 60 sekund.';
28
+
$wb['btn_edit_as_txt_record_txt'] = 'Edit as TXT record';
$wb['spf_record_exists_txt'] = 'SPF-Record already exists for hostname "{hostname}". Do you want to <a href="#" data-load-content="dns/dns_spf_edit.php?id={existing_record_id}">edit the existing record</a>?';
24
+
$wb['spf_record_exists_multiple_txt'] = 'Multiple SPF-Records exist for hostname "{hostname}". This will cause recipients to reject your mail! Delete or merge duplicate existing records and try again.';
22
25
$wb['ttl_range_error'] = 'Min. TTL time ist 60 Sekunden.';
23
26
$wb['limit_dns_record_txt'] = 'Die maximale Anzahl an DNS Einträgen für Ihr Konto wurde erreicht.';
24
27
$wb['no_zone_perm'] = 'Sie haben nicht die Berechtigung, einen Eintrag zu dieser DNS Zone hinzuzufügen.';
28
+
$wb['btn_edit_as_txt_record_txt'] = 'Edit as TXT record';
0 commit comments