Conversation
Add a check for A or AAAA record, they could have the same hostname
For people who use other nameservers than the zpanel default it would be better to name the SOA as the first added namserver.
There was a problem hiding this comment.
$exists = ($exists ? true : false); does exactely ... nothing !
I'm afraid that there is something to redesign here
There was a problem hiding this comment.
It is a loop through all records. If there is a record wich exists $exists = true, but if the next record not is the same the $exists will not be reset to false because it is already true.
There was a problem hiding this comment.
With $exists = ($exists ? true : false);
- If $exists is true, it will turned to true,
- if $exists is false, it wll be turned to false.
=> $exists will never change (by this line), so the test and the loop have no sense !
did you want to enable both A and AAAA record for the same domain ?
It would be better to change only the query, something like :
$numrows = $zdbh->prepare('SELECT dn_id_pk FROM x_dns WHERE dn_host_vc=:hostName2 AND dn_vhost_fk=:domainID AND dn_type_vc<>:excludetype AND dn_deleted_ts IS NULL');
$hostName2 = $hostName[$NewId];
$numrows->bindParam(':hostName2', $hostName2);
$numrows->bindParam(':domainID', $domainID);
$numrows->bindParam(':excludetype', ($type[$NewId] == 'A') ? 'AAAA' : 'A' );
$numrows->execute();
.....
but i have not enought ime here to check and validate. Sorry :-(
|
@5050 I think it's better now. |
Add a check for A or AAAA record, they could have the same hostname and add an other naming for SOA (see commit message)