mirror of
https://github.com/fernwerker/ownDynDNS.git
synced 2025-07-10 14:15:14 +02:00
cleanup previous tests
This commit is contained in:
parent
37d407939f
commit
312b0d9967
1 changed files with 1 additions and 27 deletions
|
@ -103,7 +103,6 @@ final class Handler
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function doRun()
|
public function doRun()
|
||||||
|
@ -133,21 +132,11 @@ final class Handler
|
||||||
$clientRequestId
|
$clientRequestId
|
||||||
);
|
);
|
||||||
|
|
||||||
// test: create new entry if it does not exist
|
|
||||||
$createnewentry = true;
|
|
||||||
$exists = false;
|
$exists = false;
|
||||||
$testing = true;
|
|
||||||
|
|
||||||
$ipv4changes = false;
|
$ipv4changes = false;
|
||||||
$ipv6changes = false;
|
$ipv6changes = false;
|
||||||
$txtchanges = false;
|
$txtchanges = false;
|
||||||
|
|
||||||
|
|
||||||
// TODO: delete, testing
|
|
||||||
// echo "--- EXISTING ENTRIES BELOW ---", PHP_EOL;
|
|
||||||
// $teststring = print_r($infoHandle->responsedata->dnsrecords, true);
|
|
||||||
// echo $teststring, PHP_EOL;
|
|
||||||
|
|
||||||
foreach ($infoHandle->responsedata->dnsrecords as $key => $record) {
|
foreach ($infoHandle->responsedata->dnsrecords as $key => $record) {
|
||||||
$recordHostnameReal = (!in_array($record->hostname, $this->payload->getMatcher())) ? $record->hostname . '.' . $this->payload->getDomainName() : $this->payload->getDomainName();
|
$recordHostnameReal = (!in_array($record->hostname, $this->payload->getMatcher())) ? $record->hostname . '.' . $this->payload->getDomainName() : $this->payload->getDomainName();
|
||||||
|
|
||||||
|
@ -195,10 +184,7 @@ final class Handler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo "--- Exists ---", $exists, PHP_EOL;
|
// if entry does not exist and createnewentry is true:
|
||||||
// echo "--- Createnewentry ---", $createnewentry, PHP_EOL;
|
|
||||||
|
|
||||||
// TODO: if entry does not exist and createnewentry is true:
|
|
||||||
if ( !$exists && $this->payload->getCreate() && $this->config->isAllowCreate() )
|
if ( !$exists && $this->payload->getCreate() && $this->config->isAllowCreate() )
|
||||||
{
|
{
|
||||||
// init new record set containing empty array
|
// init new record set containing empty array
|
||||||
|
@ -208,10 +194,6 @@ final class Handler
|
||||||
foreach ($this->payload->getTypes() as $key => $type)
|
foreach ($this->payload->getTypes() as $key => $type)
|
||||||
{
|
{
|
||||||
$record = new Soap\Dnsrecord();
|
$record = new Soap\Dnsrecord();
|
||||||
|
|
||||||
// echo "getDomain: ", $this->payload->getDomain(), PHP_EOL;
|
|
||||||
// echo "getDomainName: ", $this->payload->getDomainName(), PHP_EOL;
|
|
||||||
// echo "getHost: ", $this->payload->getHost(), PHP_EOL;
|
|
||||||
|
|
||||||
$record->hostname = $this->payload->getHost();
|
$record->hostname = $this->payload->getHost();
|
||||||
$record->type = $type;
|
$record->type = $type;
|
||||||
|
@ -219,7 +201,6 @@ final class Handler
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'A':
|
case 'A':
|
||||||
// echo "A record set: ", $this->payload->getIpv4(), PHP_EOL;
|
|
||||||
$record->destination = $this->payload->getIpv4();
|
$record->destination = $this->payload->getIpv4();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -231,17 +212,10 @@ final class Handler
|
||||||
$record->destination = $this->payload->getTxt();
|
$record->destination = $this->payload->getTxt();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// echo "destination: ", $record->destination, PHP_EOL;
|
|
||||||
// echo "--- NEW ENTRY BELOW ---", PHP_EOL;
|
|
||||||
// $teststring = print_r($record, true);
|
|
||||||
// echo $teststring, PHP_EOL;
|
|
||||||
|
|
||||||
array_push($newRecordSet->dnsrecords, $record); // push new record into array
|
array_push($newRecordSet->dnsrecords, $record); // push new record into array
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo "--- newRecordSet ---", PHP_EOL;
|
|
||||||
// $teststring = print_r($newRecordSet, true);
|
|
||||||
// echo $teststring, PHP_EOL;
|
|
||||||
|
|
||||||
$dnsClient->updateDnsRecords(
|
$dnsClient->updateDnsRecords(
|
||||||
$this->payload->getDomainName(),
|
$this->payload->getDomainName(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue