add VDNSADDITIONALVALIDNAMERVERS var, change nameserver verification to only need one verified nameserver

This commit is contained in:
Matthew Saunders Brown 2024-03-28 11:47:59 -07:00
parent 1dbc0ba2f3
commit 119d180e87
3 changed files with 21 additions and 6 deletions

View File

@ -89,11 +89,23 @@ class Vdns extends \Panel {
if ($defaults_ns_array = $f3->call('\Panel\Vdns::returnZoneDefaultsNameserverArray', $zone)) { if ($defaults_ns_array = $f3->call('\Panel\Vdns::returnZoneDefaultsNameserverArray', $zone)) {
if ($ns_array = $f3->call('\Panel\Vdns::returnNameserverArray', $zone)) { if ($ns_array = $f3->call('\Panel\Vdns::returnNameserverArray', $zone)) {
if ($defaults_ns_array === $ns_array) { if ($f3->get('VDNSADDITIONALVALIDNAMERVERS') != '' && is_array($f3->get('VDNSADDITIONALVALIDNAMERVERS'))) {
return "Verified"; $defaults_ns_array = array_merge($defaults_ns_array, $f3->get('VDNSADDITIONALVALIDNAMERVERS'));
} else {
return "Pending";
} }
/* check for any nameserver match */
foreach ($ns_array as $k=>$v) {
if (in_array($v, $defaults_ns_array)) {
return "Verified";
}
}
/* not valid matches found, set pending */
return "Pending";
/* check for exact match */
// if ($defaults_ns_array === $ns_array) {
// return "Verified";
// } else {
// return "Pending";
// }
} else { } else {
return "Unknown"; return "Unknown";
} }

View File

@ -31,6 +31,9 @@ SHOWWRITEINFO=0
; DNS admin. 1 = Yes, blank or 0 = No ; DNS admin. 1 = Yes, blank or 0 = No
VDNSADMIN=0 VDNSADMIN=0
; Maximum number of results returned for DNS listings. Defaults to 100 if unspecified. ; Maximum number of results returned for DNS listings. Defaults to 100 if unspecified.
;PDNSMAX=100 ;VDNSMAX=100
; By default VDNS validates nameservers against what vdns returns for default nameservers
; You can list additional nameservers that will validate here, in case you have aliased names for example
; VDNSADDITIONALVALIDNAMERVERS=ns1.example.net,ns1.example.com
; URL to phpMyPDNS. If this is set, and VDNSADMIN is enabled, show link to phpMyPDNS ; URL to phpMyPDNS. If this is set, and VDNSADMIN is enabled, show link to phpMyPDNS
PHPMYPDNSURL= PHPMYPDNSURL=

View File

@ -23,7 +23,7 @@
</repeat> </repeat>
Note that after making this change it can take up to 24 hours for the changes to go through.<br> Note that after making this change it can take up to 24 hours for the changes to go through.<br>
<br> <br>
If you are intentionally using another provider for DNS you can reference the records below for what should be added to your DNS (excluding the NS & SOA records). If you are intentionally using another provider for DNS (e.g. Cloudflare) you can reference the records below for what should be added to your DNS (excluding the NS & SOA records).
</check> </check>
<check if="{{ @ns_info_array.status=='Unknown' }}"> <check if="{{ @ns_info_array.status=='Unknown' }}">
The Nameserver verification system could not find nameserver information for {{ @ns_info_array.zone }}.<br> The Nameserver verification system could not find nameserver information for {{ @ns_info_array.zone }}.<br>