abstract class AbstractConsistencyChecks implements ConsistencyCheckerInterface (View source)

The backend-independent half of a consistency checker: zone ownership lives in the Poweradmin-native zones table under every backend, and the fix actions the consistency page posts map onto the same repairs whichever backend runs them.

Methods

__construct(ZoneOwnerRepair $ownerRepair, DefaultSoaBuilder $defaultSoa, AccountOwnerLookup|null $accountOwners = null, ZoneChangeRequestRepositoryInterface|null $changeRequests = null, LoggerInterface $changeRequestLogger = new NullLogger())

No description

bool
fixZoneWithoutOwner(int $zoneId, int $currentUserId)

Assign $currentUserId as the owner of a zone that has none.

string|null
zoneAccount(int $zoneId)

The zone's PowerDNS account, or null where this backend does not read it.

array
fixAllZonesWithoutOwner(int $currentUserId)

No description

array
fixOne(string $type, int $id, int $currentUserId)

Apply the single-item repair for a consistency page check type (zones_without_owners, zones_without_canonical_ids, records_with_uppercase_names, slave_zones_without_masters, orphaned_records, duplicate_soa, zones_without_soa) to one finding.

array
fixAll(string $type, int $currentUserId)

Apply a check type's bulk repair to every finding; only the two zone checks offer one.

array
groupByLowerName(array $zones)

One finding per zone name used by more than one zone in different letter case.

Details

__construct(ZoneOwnerRepair $ownerRepair, DefaultSoaBuilder $defaultSoa, AccountOwnerLookup|null $accountOwners = null, ZoneChangeRequestRepositoryInterface|null $changeRequests = null, LoggerInterface $changeRequestLogger = new NullLogger())

No description

Parameters

ZoneOwnerRepair $ownerRepair
DefaultSoaBuilder $defaultSoa
AccountOwnerLookup|null $accountOwners

Prefers the user a zone's PowerDNS account names (dns.adopt_zone_owner_from_account)

ZoneChangeRequestRepositoryInterface|null $changeRequests

Cancels the open change requests of a deleted slave zone

LoggerInterface $changeRequestLogger

bool fixZoneWithoutOwner(int $zoneId, int $currentUserId)

Assign $currentUserId as the owner of a zone that has none.

Parameters

int $zoneId
int $currentUserId

Return Value

bool

protected string|null zoneAccount(int $zoneId)

The zone's PowerDNS account, or null where this backend does not read it.

Parameters

int $zoneId

Return Value

string|null

array fixAllZonesWithoutOwner(int $currentUserId)

No description

Parameters

int $currentUserId

Return Value

array

array fixOne(string $type, int $id, int $currentUserId)

Apply the single-item repair for a consistency page check type (zones_without_owners, zones_without_canonical_ids, records_with_uppercase_names, slave_zones_without_masters, orphaned_records, duplicate_soa, zones_without_soa) to one finding.

Parameters

string $type
int $id
int $currentUserId

Return Value

array

status is success or error

array fixAll(string $type, int $currentUserId)

Apply a check type's bulk repair to every finding; only the two zone checks offer one.

Parameters

string $type
int $currentUserId

Return Value

array

status is success, warning or error

protected array groupByLowerName(array $zones)

One finding per zone name used by more than one zone in different letter case.

Parameters

array $zones

Return Value

array